PowerHA 7.1.3 Install and Configuration with Apache Web Server

0
4927

We create a lab environment with 2 AIX Nodes backpart of VIOS.I gave two LUN caavg and apachevg and share of this two nodes on Storage.The Index Page is located on apachevg.

PowerHA is using a disk (caavg_private) as a topology repository diskIn this document you will setup and configure a PowerHA cluster to manage a flexible Apache Server.

caavg==> 5G

apachevg==> 30G

Node1= 192.168.128.2

Node2=192.168.128.3

Service IP=192.168.128.4

PowerHA1 (1)

  • Check /etc/hosts file (both nodes)
 root@PowerHA1:/home/root # cat /etc/hosts 

192.168.128.2 PowerHA1

192.168.128.3 PowerHA2

192.168.128.4 serviceip_apache

root@PowerHA2:/home/root # cat /etc/hosts 

192.168.128.2 PowerHA1

192.168.128.3 PowerHA2

192.168.128.4 serviceip_apache
  • Check connectivity between the two nodes (both nodes)
    root@PowerHA1:/home/root # ping PowerHA2
    
    PING PowerHA2: (192.168.128.3): 56 data bytes
    
    64 bytes from 192.168.128.3: icmp_seq=0 ttl=255 time=0 ms
  • Make sure that there is no /etc/resolv.conf file.If you have got a /etc/resolv.conf,you can move it another name.
    root@PowerHA1:/home/root # ls /etc/resolv.conf
    
    ls: 0653-341 The file /etc/resolv.conf does not exist.
  • Edit /etc/cluster/rhosts (both nodes)
    root@PowerHA1:/home/root # vi /etc/cluster/rhosts
    
    "/etc/cluster/rhosts" 3 lines, 19 characters 
    
    PowerHA2
    
    PowerHA1
 root@PowerHA2:/home/root # vi /etc/cluster/rhosts

"/etc/cluster/rhosts" 3 lines, 19 characters 

PowerHA2

PowerHA1
  • Start the clcomd daemon (both nodes)
    root@PowerHA2:/home/root # startsrc -s clcomd
    
    0513-059 The clcomd Subsystem has been started. Subsystem PID is 14221342.
  • To see if the clcomd is running :
 root@PowerHA2:/home/root # lssrc -s clcomd

 Subsystem Group PID Status 

 clcomd caa 14221342 active
  • Load the service if you do a change your config
 root@PowerHA2:/home/root # refresh -s clcomd

 0513-095 The request for subsystem refresh was completed successfully.
  • If you want to stop your deamon
root@PowerHA2:/home/root # stopsrc -s clcomd

 0513-044 The clcomd Subsystem was requested to stop.
  • Check your LUNS
    root@PowerHA1:/home/root # lspv
    
    hdisk0 00c4b8379a6bb1df rootvg active
    
    hdisk1 00c4b8379b1069e3 None
    
    hdisk2 00c4b8379b0904fc apache
root@PowerHA2:/home/root # lspv

hdisk0 00c4b8379a6bb25a rootvg active

hdisk1 00c4b8379b1069e3 None

hdisk2 00c4b8379b0904fc apache
  • The same LUN must be seen on the two nodes, for hdisk1 and hdisk2
    root@PowerHA1:/home/root # lscfg -vpl hdisk1 | grep Serial
    
    Serial Number...............50 17B1D
 root@PowerHA2:/home/root # lscfg -vpl hdisk1 | grep Serial

 Serial Number...............50 17B1D

 hdisk0 (rootvg) is local to each node

 hdisk1 will be used for Cluster Aware AIX (CAA) topology repository disk (caavg)

 hdisk2 is targeted for the HTML page, used by Apache web server (apachevg)
  • Check your default gateway address, and ping it to be sure.
root@PowerHA1:/home/root # netstat -rn

Routing tables

Destination Gateway Flags Refs Use If Exp Groups

Route Tree for Protocol Family 2 (Internet):

default 192.168.128.254 UG 2 798 en0 - -

192.168.128.0 192.168.128.2 UHSb 0 0 en0 - - =>

root@PowerHA1:/home/root # ping 192.168.128.254

PING .192.168.128.254: (192.168.128.254): 56 data bytes

64 bytes from 192.168.128.254: icmp_seq=0 ttl=255 time=1 ms
  • We downloaded 7.1.3 version of PowerHA and installed with installp command.
root@PowerHA1:/mnt/AIX/PowerHA713 # ls -ltr

-rwxrwxrwx 1 root system 16466 Nov 07 2013 release_notes_713

-rwxrwxrwx 1 root system 7691 Nov 07 2013 release_notes_assist_713

drwxrwxrwx 3 root system 256 Feb 17 2015 installp

drwxrwxrwx 5 root system 256 Feb 17 2015 director

drwxrwxrwx 3 root system 256 Feb 17 2015 usr

drwxrwxrwx 2 root system 4096 Feb 17 2015 pubs
  • Start the cluster configuration
    root@PowerHA1:/ smit sysmirror / Cluster Nodes and Networks / Standard Cluster Deployment / setup a Cluster, Nodes and Networks

    PowerHA1 (2)PowerHA1 (3)PowerHA1 (4)PowerHA1 (5)PowerHA1 (6)

    • Upon completion, scan the cltopinfo

      PowerHA1 (7)

      • Define the Cluster Aware AIX (CAA) repository disk
      root@PowerHA1:/mnt/AIX/PowerHA713 # smit sysmirror / Cluster Nodes and Networks / Standard Cluster Deployment / Define Repository Disk and Cluster IP address

      PowerHA1 (8)PowerHA1 (9)PowerHA1 (10)PowerHA1 (11)PowerHA1 (12)

      • You can check your caa disk with cltopinfo command.

        /usr/es/sbin/cluster/utilities/cltopinfo

      PowerHA1 (13)

      • Check your cluster on other node.

      PowerHA1 (14)

      root@PowerHA2:/home/root # lscluster -c
      
       1035-053 lscluster: Cluster services are not active.
      
       root@PowerHA2:/home/root # lssrc -g caa
      
       Subsystem Group PID Status 
      
       clcomd caa 16187426 active
      
       clconfd caa inoperative
      • Synchronize the cluster configuration
      root@PowerHA1:/home/root # smit sysmirror / Cluster Nodes and Networks / Verify and Synchronize Cluster Configuration

      PowerHA1 (15)PowerHA1 (16)

      root@PowerHA1:/home/root # lspv
      
      hdisk0 00c4b8379a6bb1df rootvg active 
      
      hdisk1 00c4b8379fc3b2f7 caavg_private active 
      
      hdisk2 00c4b8379b0904fc apache 
      
      root@PowerHA2:/home/root # lspv
      
      hdisk0 00c4b8379a6bb25a rootvg active 
      
      hdisk1 00c4b8379fc3b2f7 caavg_private active 
      
      hdisk2 00c4b8379b0904fc apache 
      • On second node:
      root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/cltopinfo
      
       Cluster Name: PowerHA_cluster
      
       Cluster Type: Standard
      
       Heartbeat Type: Unicast
      
       Repository Disk: hdisk1 (00c4b8379fc3b2f7)
      
       There are 2 node(s) and 1 network(s) defined
      
       NODE PowerHA1:
      
      Network net_ether_01
      
      PowerHA1 10.91.38.8
      
       NODE PowerHA2:
      
      Network net_ether_01
      
      PowerHA2 10.91.38.9
      
       No resource groups defined

      PowerHA1 (17)PowerHA1 (18)

      • Import Apache volume group into PowerHA
      root@PowerHA2:/home/root # smit sysmirror / System Management (C-SPOC) / Storage / Volume Groups / Import a Volume Group / apachevg (on hdisk2)

      PowerHA1 (19)PowerHA1 (20)PowerHA1 (21)PowerHA1 (22)PowerHA1 (23)PowerHA1 (24)PowerHA1 (25)PowerHA1 (26)

      • PowerHA SystemMirror Application and Resource configuration
      In PowerHA terminology, a Resource Group is a set of information and resources needed to run the application you want to protect with the cluster.
      
      We prepare start and stop apache scripts.
      
      root@PowerHA1:/usr/IBMAHS # ls -ltr *apache*
      
      -rwxr--r-- 1 root system 31 May 11 11:18 stop_apache.sh
      
      -rwxr--r-- 1 root system 73 May 11 11:48 start_apache.sh
      
      root@PowerHA1:/usr/IBMAHS # cat start_apache.sh
      
      print "$(hostname)" > /apache/index.html
      
      /usr/IBMAHS/bin/apachectl start
      
      root@PowerHA1:/usr/IBMAHS # cat stop_apache.sh
      
      /usr/IBMAHS/bin/apachectl stop
      You can download apache package on your web package site.
      
      https://www-01.ibm.com/marketing/iwm/iwm/web/reg/pick.do?source=aixbp&lang=en_US

      PowerHA1 (27)

      And change your docs directory on your httpd.conf file.
      
      <Directory /apache>
      
      AllowOverride none
      
      # Require all denied
      
      </Directory>
      
      DocumentRoot "/apache"
      
      Then restart your http server
      
       /usr/IBMAHS/bin/apachectl stop
      
       /usr/IBMAHS/bin/apachectl start
      • Define the Application Controller
      root@PowerHA2:/home/root # smit sysmirror / Cluster Application and Resources /Resources / Configure User Applications (Scripts and Monitors) / Application Controller Scripts / Add Application Controller Scripts

      PowerHA1 (28)PowerHA1 (29)

      • Define the Service IP address
      root@PowerHA2:/home/root # smit sysmirror / Cluster Application and Resources /Resources / Configure Service IP Labels/Addresses / Add a Service IP Label/Address

      PowerHA1 (30)PowerHA1 (31)PowerHA1 (32)PowerHA1 (33)PowerHA1 (34)PowerHA1 (35)

      • Define the Resource Group
      root@PowerHA2:/home/root # smit sysmirror / Cluster Application and Resources / Resource Groups / Add a Resource Group

      PowerHA1 (36)PowerHA1 (37)

      • Add service IP address and apachevg volume group to the Resource Group
      root@PowerHA2:/home/root # smit sysmirror / Cluster Application and Resources /Resource Groups / Change/Show Resources and Attributes for a Resource Group

      PowerHA1 (38)

      • Check your final PowerHA cluster configuration
        root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/cltopinfo
        
        Cluster Name: PowerHA_cluster
        
        Cluster Type: Standard
        
        Heartbeat Type: Unicast
        
        Repository Disk: hdisk1 (00c4b8379fc3b2f7)
        
        There are 2 node(s) and 1 network(s) defined
        
        NODE PowerHA1:
        
        Network net_ether_01
        
        serviceip_apache 192.168.128.4
        
        PowerHA1 192.168.128.2
        
        NODE PowerHA2:
        
        Network net_ether_01
        
        serviceip_apache 192.168.128.10
        
        PowerHA2 192.168.128.3
        
        Resource Group rg_apache
        
        Startup Policy Online On Home Node Only
        
        Fallover Policy Fallover To Next Priority Node In The List
        
        Fallback Policy Fallback To Higher Priority Node In The List
        
        Participating Nodes PowerHA2 PowerHA1
        
        Service IP Label serviceip_apache
        
        root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/cllsres
        
        APPLICATIONS="app_con_apache"
        
        FILESYSTEM=""
        
        FORCED_VARYON="false"
        
        FSCHECK_TOOL="fsck"
        
        FS_BEFORE_IPADDR="false"
        
        MANAGE_RDISK="no"
        
        RECOVERY_METHOD="sequential"
        
        SERVICE_LABEL="serviceip_apache"
        
        SSA_DISK_FENCING="false"
        
        VG_AUTO_IMPORT="false"
        
        VOLUME_GROUP="apache"
        
        USERDEFINED_RESOURCES=""
        • Synchronize the PowerHA configuration
        root@PowerHA2:/home/root # smit sysmirror / Cluster Applications and Resources / Verify and Synchronize Cluster Configuration

        PowerHA1 (39)

        • Start PowerHA SystemMirror Services
        root@PowerHA2:/home/root #smit sysmirror / System Management (C-SPOC) / PowerHA SystemMirror Services / Start Cluster Services

        PowerHA1 (40)PowerHA1 (41)PowerHA1 (42)PowerHA1 (43)

        • check your web server with service ip
          http://192.168.128.4

        PowerHA1 (52)

        root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/clRGinfo
        
        -----------------------------------------------------------------------------
        
        Group Name State Node 
        
        -----------------------------------------------------------------------------
        
        rg_apache ONLINE PowerHA2 
        
                       OFFLINE PowerHA1 

        PowerHA1 (44)

        • check service
        root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/clshowsrv -v
        
        Status of the RSCT subsystems used by PowerHA SystemMirror:
        
        Subsystem Group PID Status 
        
        cthags cthags 15728694 active
        
        ctrmc rsct 8585364 active
        
        Status of the PowerHA SystemMirror subsystems:
        
        Subsystem Group PID Status 
        
        clstrmgrES cluster 12714004 active
        
        clevmgrdES cluster 17760284 active
        
        Status of the CAA subsystems:
        
        Subsystem Group PID Status 
        
        clconfd caa 18546798 active
        
        clcomd caa 15073370 active
        
        Details of PowerHA SystemMirror cluster manager:
        
        Current state: ST_STABLE
        • Move the web server on the second node
        root@PowerHA2:/home/root # smit sysmirror / System Management (C-SPOC) / Resource Groups and Applications / Move Resource Groups to Another Node

        PowerHA1 (45)PowerHA1 (46)PowerHA1 (47)PowerHA1 (48)PowerHA1 (49)

        • check again your browser

        PowerHA1 (50)

        root@PowerHA2:/home/root # /usr/es/sbin/cluster/utilities/clRGinfo
        
        -----------------------------------------------------------------------------
        
        Group Name State Node 
        
        -----------------------------------------------------------------------------
        
        rg_apache OFFLINE PowerHA2 
        
                         ONLINE PowerHA1 

        PowerHA1 (51)

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.