Nethence Newdoc Olddoc Lab Your IP BBDock  

Warning: those guides are mostly obsolete, please have a look at the new documentation.


Setting up HA services with redhat/centos Cluster Suite (RHCS)
on CentOS 6.7
Setting up failover domains
For an unrestricted failover domain, on e.g. cnode1,
ccs -h localhost --addfailoverdomain allnodes
ccs -h localhost --addfailoverdomainnode allnodes cnode1
ccs -h localhost --addfailoverdomainnode allnodes cnode2
ccs -h localhost --addfailoverdomainnode allnodes cnode3
ccs -h localhost --lsfailoverdomain
populate the changes,
cman_tool version -r
Setting up services
Define the resources you need for a service. For my davmail service, I need:
- the binary and configuration files located in /usr/local/davmail/ (copied on all nodes), which is a symlink to ./davmail-version/
cd /usr/local/
scp -r davmail-linux-x86_64-4.7.1-2416 cnode2:/usr/local/
scp -r davmail-linux-x86_64-4.7.1-2416 cnode3:/usr/local/
cd /etc/init.d/
scp davmail cnode2:/etc/init.d/
scp davmail cnode3:/etc/init.d/
also make sure openjdk is installed
also make sure postfix is disabled on port 25
see how to setup davmail
on cnode2 and cnode3 also,
cd /usr/local/
ln -s davmail-linux-x86_64-4.7.1-2416 davmail
cd ~/
ls -l /etc/init.d/davmail # already executable by scp
chkconfig --add davmail
chkconfig davmail off
- an LSB compilant init script to use the RHCS <script> statement.
- a floating IP --> this will be a RHCS resource
Disable the service at local system startup in case it is enabled,
chkconfig --list | grep davmail
chkconfig davmail off
See available resource types,
ccs -h localhost --lsresourceopts
ccs -h localhost --lsresourceopts ip
ccs -h localhost --lsresourceopts script
See available service options,
ccs -h localhost --lsserviceopts
Add this into the <rm> statement,
vi /etc/cluster/cluster.conf
<ip address="10.0.0.X" monitor_link="yes" sleeptime="5"/>
<script file="/etc/init.d/davmail" name="davmail_service"/>
<service autostart="0" domain="allnodes" name="davmail" recovery="relocate">
<ip ref="10.0.0.X"/>
<script ref="davmail_service"/>
increment the configuration version,
<cluster config_version="34" name="centosha">
check and populate the changes,
cman_tool version -r
Theorically you should also be able to setup this as follows (but we did it by hand),
ccs -h localhost --addresource ip address=10.0.0.X minitor_links=yes sleeptime=5
ccs -h localhost --addservice davmail domain=allnodes recovery=relocate autostart=0
ccs -h localhost --addsubservice davmail ip ref=10.0.0.X
cat /etc/cluster/cluster.conf
Ready to go
Check the the cluster is up and running,
cman_tool nodes
Enable the service,
clusvcadm -e davmail
#clusvcadm -e davmail -m cnode1
Check that the ip address is owned by the node on which the service has started,
ip addr  
Why is the virtual IP address, managed by RHCS, not listed when using ifconfig?:
Eventually check that the service is running using the local system, e.g.,
service davmail status
also test the service while you watch the logs,
cd /usr/local/davmail/
tail -f davmaill.log
Once everything is fine enable autostart,
vi /etc/cluster/cluster.conf
<cluster config_version="35" name="centosha">
<service autostart="1" domain="allnodes" name="davmail" recovery="relocate">
check and populate the changes,
cman_tool version -r
#ccs -h localhost --sync --activate
More commands
Disable a service,
clusvcadm -d davmail
Other services
Share a common NFS mount point on all the nodes e.g.,
cat >> /etc/fstab <<EOF
nfs_server:/export/rhcs /mnt/ict-rhcs nfs4 _netdev,rw 0 0
mkdir -p /mnt/rhcs/
mount /mnt/rhcs/

(obsolete, see the new doc)