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
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 and Example /etc/hosts file:   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6  node1 node2

The eth1 IP of 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, and the other device to be 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 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 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="" nic="eth1" cidr_netmask="24"
 pcs resource create secondaryIP ocf:heartbeat:IPaddr2 params ip="" 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

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, and the secondary will have the IP

Primary server:

failover peer "dhcp-failover" {
  primary; # declare this to be the primary server
  port 647;
  peer address;
  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
  port 647;
  peer address;
  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
subnet netmask {
    option routers;
    option domain-name-servers;
    option ntp-servers;
    option subnet-mask;
    failover peer "dhcp-failover";