Configure WiClient Failover Version 3.x

From WiDirect
Jump to: navigation, search

Configuring failover on a WiClient is simpler than configuring failover on a WiDirect. These instructions do not utilize any shared storage, which greatly simplifies the configuration. Since no shared storage is used it is important that the configurations between the two WiClients be made consistent. DNS, DHCP, and firewall changes must be made simultaneously on both devices.

Install Packages

Run these commands from the command line:

su -
rpm -i https://www.allcitywireless.com/failover/epel-release-6-8.noarch.rpm
yum install -y pacemaker corosync cman pcs ccs resource-agents


Network Configuration

Set the hostnames for the two WiClients in the /etc/hosts file. In this example we are using node1 and node2, which have the respective IPs 10.8.2.119 and 10.8.2.73. Example /etc/hosts file:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.8.9.107  node1
10.8.2.73 node2

The eth1 IP of 10.4.1.1 should only be active on one box at a time, and the configuration below will control which device has that IP address active. Update the IP address on one device to be 10.4.1.2, and the other device to be 10.4.1.3. If using additional interfaces or VLANs then those interfaces should be configured similarly.

Configure Firewall Rules

Firewall rules must be created to allow the devices to communicate their status.

Pacemaker configuration

Information below is quoted from http://clusterlabs.org/quickstart-redhat.html Visit the site above for more information.

[ONE] # ccs -f /etc/cluster/cluster.conf --createcluster pacemaker1  
[ONE] # ccs -f /etc/cluster/cluster.conf --addnode node1 
[ONE] # ccs -f /etc/cluster/cluster.conf --addnode node2 

Next we need to teach CMAN how to send it's fencing requests to Pacemaker. We do this regardless of whether or not fencing is enabled within Pacemaker.

[ONE] # ccs -f /etc/cluster/cluster.conf --addfencedev pcmk agent=fence_pcmk  
[ONE] # ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect node1
[ONE] # ccs -f /etc/cluster/cluster.conf --addmethod pcmk-redirect node2  
[ONE] # ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk node1 pcmk-redirect port=node1 
[ONE] # ccs -f /etc/cluster/cluster.conf --addfenceinst pcmk node2 pcmk-redirect port=node2 

Now copy /etc/cluster/cluster.conf to all the other nodes that will be part of the cluster.

Start the Cluster

CMAN was originally written for rgmanager and assumes the cluster should not start until the node has quorum, so before we try to start the cluster, we need to disable this behavior:

[ALL] # echo "CMAN_QUORUM_TIMEOUT=0" >> /etc/sysconfig/cman 


On both WiClients run these commands:

service cman start 
service pacemaker start
chkconfig cman on
chkconfig pacemaker on

Configure Services

The next step will be to configure the services that are going to be shared between the two WiClients. The command below will create the 10.4.1.1 IP address as a resource that will only be running on one device at a time.

 pcs resource create mainIP ocf:heartbeat:IPaddr2 params ip="10.4.1.1" nic="eth1" cidr_netmask="24"
 pcs resource create secondaryIP ocf:heartbeat:IPaddr2 params ip="10.8.1.100" nic="eth0" cidr_netmask="16"
 pcs resource create awicp_client lsb:awicp_client
 pcs resource create awicp_watchdog lsb:awicp_watchdog
 pcs constraint colocation add mainIP awicp_client INFINITY
 pcs constraint colocation add secondaryIP awicp_client INFINITY
 pcs constraint colocation add awicp_client awicp_watchdog INFINITY

Additional Commands

These commands should be run on one of the WiClients:

pcs property set stonith-enabled=false 
pcs property set no-quorum-policy=ignore 
pcs resource defaults migration-threshold=1

For additional information please consult the Pacemaker guide http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Clusters_from_Scratch/index.html

DHCP Configuration

The DHCP service needs to be configured to share information between the two WiClients.

Create a section in the DHCP configuration where the primary and secondary servers will be specified. In this case the primary server will have the IP 10.4.1.2, and the secondary will have the IP 10.4.1.3.

Primary server:

failover peer "dhcp-failover" {
  primary; # declare this to be the primary server
  address 10.4.1.2;
  port 647;
  peer address 10.4.1.3;
  peer port 647;
  max-response-delay 30;
  max-unacked-updates 10;
  load balance max seconds 3;
  mclt 1800;
  split 128;
}

Secondary server:

failover peer "dhcp-failover" {
  secondary; # declare this to be the primary server
  address 10.4.1.3;
  port 647;
  peer address 10.4.1.2;
  peer port 647;
  max-response-delay 30;
  max-unacked-updates 10;
  load balance max seconds 3;
}

The subnet decription should be updated so that the range line is included in a pool block that also lists the failover peer. An example is below:

# Private Lan Subnet 10.4.1.0/24
subnet 10.4.1.0 netmask 255.255.255.0 {
    option routers 10.4.1.1;
    option domain-name-servers 10.4.1.1;
    option ntp-servers 10.4.1.1;
    option subnet-mask 255.255.255.0;
    pool{
    failover peer "dhcp-failover";
    range 10.4.1.20 10.4.1.254;
    }
}