Project

General

Profile

CMI HA Cluster Installation

CMI service can be installed as a active/passive cluster attached to a floating VIP.

Installation and setup procedure

Deploy CMI node1

  1. Deploy a CMI as usual.
  2. Run ./first_run.sh to customize as a usual/standalone CMI. Leave node real IP here for collectd, rsyslog and chefserver. VIP will be autoset later in Step2.
  3. Attach a second 20GB disk dedicated to HA operation.

Run Step1 script

  1. Find the cluster setup scripts in /root (They can also be found in /usr/share/cmi-api/scripts/cluster)
[root@cmi1_node1 ~]# ls -l setup_cmi_cluster_step*
-rwxr-xr-x 1 root root   507 Jan 19 12:02 setup_cmi_cluster_step1.sh
-rwxr-xr-x 1 root root 13122 Jan 19 12:02 setup_cmi_cluster_step2.sh
-rwxr-xr-x 1 root root   337 Jan 19 12:02 setup_cmi_cluster_step3.sh
# Run Step1. Node will reboot when finish.
[root@cmi1_node1 ~]# ./setup_cmi_cluster_step1.sh
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package drbd84-utils.x86_64 0:8.4.4-2.el6.elrepo will be installed
---> Package kmod-drbd84.x86_64 0:8.4.4-1.el6.elrepo will be installed
[...]
Complete!

Broadcast message from root@cmi1_node1.test
        (/dev/pts/0) at 12:13 ...

The system is going down for reboot NOW!

Run Step2 script

WARNING

The disk must be partitioned but not formatted. If there's ext2/3/4 or another filesystem then execute:
 dd if=/dev/zero of=/dev/XX1 bs=1M count=128
The hostname input below must be the same of output of "uname -n" 

  1. Provide the following information:
    [root@cmi1_node1 ~]# ./setup_cmi_cluster_step2.sh
    Cluster CMI setup stript version:: 1665 $
    ###################################################################
    
    Node 1 real ip: 192.168.104.227
    Node 1 hostname: cmi1_node1.demo
    Node 2 real ip: 192.168.104.229
    Node 2 hostname: cmi1_node2.demo
    Virtual ip for cluster: 192.168.104.228
    Virtual ip netmask for cluster (i.e. 24): 24
    Virtual ip interface: eth1
    Block device for cluster disk (i.e. /dev/sdb): /dev/sdb
    [...]
    

Clone node1 to node2. Change hostname/IP in node2

  1. Poweroff node1.
  2. Clone node1 to node2. Node2 has to have same network and disks devices (including the second 20GB cluster dedicated disk)
  3. PowerOn node2. Change settings described in "script" setup_cmi_cluster_step3.sh. Then reboot.
    [root@cmi1_node1 ~]# cat ./setup_cmi_cluster_step3.sh #to see instructions
    [root@cmi1_node1 ~]# vi /etc/hosts  #change hostname to node2 hostname
    [root@cmi1_node1 ~]# vi /etc/sysconfig/network #change hostname to node2 hostname
    [root@cmi1_node1 ~]# rm -f /etc/udev/rules.d/70-persistent-net.rules
    [root@cmi1_node1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ethX(s) #change IP(s) to node2 real IP(s)
    [root@cmi1_node1 ~]# vi /etc/ha.d/ha.cf #change unicast ip to node 1
    [root@cmi1_node1 ~]# reboot
    
  4. PowerOn node1.
  5. Done. Log on "https://VIP" and configure General and Chef settings under "Config" as usual. Use VIP for "CMI rpm repo".

To test HA Cluster switching see this section

Comments about this functionality