Wednesday, January 1, 2014

Apache service configuration on Veritas Cluster

VERITAS +  APACHE SERVICE GROUP CONFIGURATION


We are going to configure Veritas cluster server for apache service.
Server hostname      :    node1.example.com
Server hostname      :    node2.example.com
OS                   :    RHEL 5.6 64 bit

Make sure the time sync is configured on both the nodes.

Make sure hostnames are resolving on both the nodes. Edit /etc/hosts file and update the hostnames.

# more /etc/hosts
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
192.168.80.21   node1.example.com       node1
192.168.80.22   node2.example.com       node2

Make ssh keyless authentication on both the nodes.

# ssh-keygen –t rsa

node1 # ssh-copy-id -i .ssh/id_rsa.pub node2

Do the same steps on node2

Cluster configuration file “/etc/VRTSvcs/conf/config/main.cf”
Cluster log file location “/var/VRTSvcs/log/engine_A.log”

By default configuration file will be in read only mode. We have to make that as RW.

# haclus -display | grep -i readonly
ReadOnly               1

# haconf –makerw à to make the config file to Read Write mode.

# haclus -display | grep -i readonly
ReadOnly               0

To make the config file as “RO”

# haconf -dump –makero

Creating apache service group

# hagrp –add apachesg
# hagrp –modify apachesg SystemList node1 0 node 1 à (0 and 1 are priority)
# hagrp –modify AutoStartList node1 node2 à (node1 and node2 are node names)

If we are going to use load balancer then
# hagrp –modify apachesg Parallel 1


To list out the cluster
# hagrp -list
ClusterService          node1
ClusterService          node2
apachesg                node1
apachesg                node2

To display the brief information
# hagrp –display

Creating resources

Creating NIC Resources

# hares –add nic_apache NIC apachesg
# hares –modify nic_apache Enabled 1
Enabled 1 à Veritas will not manage if it is not enabled
# hares –modify nic_apache Critical 0
# hares –modify nic_apache Device eth0

Creating IP resources

# hares –add ip_apache IP apachesg
# hares –modify ip_apache Enabled 1
# hares –modify ip_apache Device eth0
# hares –modify ip_apache Address 192.168.80.11
# hares –modify ip_apache NetMask 255.255.255.0
# hares –modify ip_apache Critical 0

Creating Disk Group resources
# hares –add apachedg DiskGroup apachesg
# hares –modify apachedg Enabled 1
# hares –modify apachedg DiskGroup appdg
# hares –modify apachedg Critical 0

Creating volume resources

# hares –add apachevol Volume apachesg
# hares –modify apachevol Enabled 1
# hares –modify apachevol DiskGroup appdg
# hares –modify apachevol Volume mirvol1
# hares –modify apachevol Critical 0

Creating mount point resources

# hares –add apachemount Mount apachesg
# hares –modify apachemount Enabled 1
# hares –modify apachemount BlockDevice /dev/vx/dsk/appdg/mirvol1
# hares –modify apachemount MountPoint /var/www/html
# hares –modify apachemount FsckOpt %-y
# hares –modify apachemount FSType vxfs
# hares –modify apachemount Critical 0

Creating apache resource

# hares –add apacheservice Apache apachesg
# hares –modify apacheservice Enabled 1
# hares –modify apacheserivce httpdDir /usr/sbin
# hares –modify apacheservice ConfigFile /etc/httpd/conf/httpd.conf
# hares –modify apacheservice Port 80
# hares –modify apacheservice Critical 1

Creating Dependencies

# hares –link ip_apache nic_apache
# hares –link apachevol apachedg
# hares –link apachemount apachevol

To list the dependencies

# hares –dep

Check hastauts –sum output

# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen

A  node1                RUNNING              0
A  node2                RUNNING              0

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State

B  ClusterService  node1                Y          N               OFFLINE
B  ClusterService  node2                Y          N               ONLINE
B  apachesg        node1                Y          N               OFFLINE
B  apachesg        node2                Y          N               ONLINE

Now the apache service group is online.

Switch the service group from node2 to node 1

# hagrp –switch apachesg –to node1

# hastatus -sum                                                                                     Thu Jan  2 03:23:32 2014


-- SYSTEM STATE
-- System               State                Frozen

A  node1                RUNNING              0
A  node2                RUNNING              0

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State

B  ClusterService  node1                Y          N               OFFLINE
B  ClusterService  node2                Y          N               ONLINE
B  apachesg        node1                Y          N               ONLINE
B  apachesg        node2                Y          N               OFFLINE


Now the apache service group is online on node1.

node1 ~]# ip a | grep -i 192.168.80.11 --color
    inet 192.168.80.11/24 scope global secondary eth0:0

--------------Veritas apache service group configuration completed successfully--------------






1 comment:

  1. Are you looking to earn cash from your websites using popunder advertisments?
    If so, have you considered using Clickadu?

    ReplyDelete