9.4. Configuring Automated IP Failover for NFS and SMB

In replicated volume environment, you can configure Cluster Trivial Database (CTDB) to provide high availability for NFS and SMB exports. CTDB adds virtual IP addresses (VIPs) and a heartbeat service to Red Hat Storage Server.
When a node in the trusted storage pool fails, CTDB enables a different node to take over the IP address of the failed node. This ensures the IP addresses for the services provided are always available.

Note

EC2 (Amazon Elastic Compute Cloud) does not support VIPs, hence CTDB is not supported with Red Hat Storage for Amazon Web Services.

9.4.1. Setting Up CTDB

Perform the following to setup CTDB:
  1. Create a replicated volume.
    Ensure that the bricks are in different machines.
  2. Update the META=all to the newly created volume name on all Red Hat Storage servers which require IP failover in the hook scripts available at /var/lib/glusterd/hooks/1/start/post/S29CTDBsetup.sh and /var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh.
  3. Start the volume.
    The S29CTDBsetup.sh script runs on all Red Hat Storage servers and adds the following lines to the [global] section of your Samba configuration
    clustering = yes
    idmap backend = tdb2
    The script stops Samba server, modifies Samba configuration, adds an entry in /etc/fstab/ for the mount, and mounts the volume at /gluster/lock. It also enables automatic start of CTDB service on a reboot.

    Note

    When you stop a volume, S29CTDB-teardown.sh script runs on all Red Hat Storage servers and removes the following lines from [global] section of your Samba configuration
    clustering = yes
    idmap backend = tdb2
    It also removes an entry in /etc/fstab/ for the mount and unmount the volume at /gluster/lock.
  4. Create /gluster/lock/ctdb file and add the following entries:
    CTDB_RECOVERY_LOCK=/gluster/lock/lockfile
    #SMB only
    CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
    CTDB_MANAGES_SAMBA=yes #SMB only
    CTDB_NODES=/etc/ctdb/nodes
  5. Create /gluster/lock/nodes file and list the IPs of Red Hat Storage servers which require IP failover.
    192.168.1.60
    192.168.1.61
    192.168.1.62
    192.168.1.63
  6. Create /etc/ctdb/public_addresses file on all Red Hat Storage servers which require IP failover and list the Virtual IPs that CTDB should create. Replace eth0 with the interface available on that node for CTDB to use.
    192.168.1.20/24 eth0
    192.168.1.21/24 eth0
  7. Run the following commands on all Red Hat Storage servers which require IP failover to create symbolic links:
    # ln -s /gluster/lock/ctdb /etc/sysconfig/ctdb
    # ln -s /gluster/lock/nodes /etc/ctdb/nodes

Note

You must ensure to open Port 4379 between the Red Hat Storage servers.
In CTDB based high availability environment of NFS and SMB, the locks will not be migrated on failover.