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.
Perform the following to setup CTDB:
- Create a replicated volume.Ensure that the bricks are in different machines.
- Update the
META=allto 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.shand/var/lib/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh. - Start the volume.The
S29CTDBsetup.shscript runs on all Red Hat Storage servers and adds the following lines to the[global]section of your Samba configurationclustering = 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.shscript runs on all Red Hat Storage servers and removes the following lines from[global]section of your Samba configurationclustering = yes idmap backend = tdb2
It also removes an entry in/etc/fstab/for the mount and unmount the volume at/gluster/lock. - Create
/gluster/lock/ctdbfile 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
- Create
/gluster/lock/nodesfile 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
- Create
/etc/ctdb/public_addressesfile on all Red Hat Storage servers which require IP failover and list the Virtual IPs that CTDB should create. Replaceeth0with the interface available on that node for CTDB to use.192.168.1.20/24 eth0 192.168.1.21/24 eth0
- 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.