The clustering model utilizes IP takeover techniques to ensure that the full set of public IP addresses assigned to services on the cluster will always be available to the clients even when some nodes have failed and become unavailable.
When CTDB is installed, it will install template versions of these files which you need to edit to suit your system. The current set of config files for CTDB are also available from http://samba.org/~tridge/ctdb/config
When you installed ctdb, a template config file should have been installed in /etc/sysconfig/ctdb.
Edit this file, following the instructions in the template.
The most important options are:
This should be a private non-routable subnet which is only used for internal cluster traffic. This file must be the same on all nodes in the cluster.
Make sure that these IP addresses are automatically started when the cluster node boots and that each node can ping each other node.
Example 4 node cluster:
CTDB_NODES=/etc/ctdb/nodesContent of /etc/ctdb/nodes:
10.1.1.1 10.1.1.2 10.1.1.3 10.1.1.4The default for this file is /etc/ctdb/nodes.
While running the CTDB cluster will assign each public address that exists in the entire cluster to one node that will host that public address.
These are the addresses that the SMBD daemons and other services will bind to and which clients will use to connect to the cluster.
CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addressesContent of /etc/ctdb/public_addresses:
192.168.1.1/24 eth0 192.168.1.2/24 eth0 192.168.2.1/24 eth1 192.168.2.2/24 eth1These are the IP addresses that you should configure in DNS for the name of the clustered samba server and are the addresses that CIFS clients will connect to.
Configure it as one DNS A record (==name) with multiple IP addresses and let round-robin DNS distribute the clients across the nodes of the cluster.
The CTDB cluster utilizes IP takeover techniques to ensure that as long as at least one node in the cluster is available, all the public IP addresses will always be available to clients.
This means that if one physical node fails, the public addresses that node was serving will be taken over by a different node in the cluster. This provides a guarantee that all ip addresses exposed to clients will always be reachable by clients as long as at least one node still remains available in the cluster with the capability to host that public address (i.e. the public address exists in that nodes public_addresses file). Do not assign these addresses to any of the interfaces on the host. CTDB will add and remove these addresses automatically at runtime.
This parameter is used when CTDB operated in takeover ip mode.
The usual location for this file is /etc/ctdb/public_addresses.
Node 0 : /etc/ctdb/public_addresses 10.1.1.1/24 eth0 10.1.2.1/24 eth1
Node 1 : /etc/ctdb/public_addresses 10.1.2.1/24 eth1 10.1.3.1/24 eth2
Node 2 : /etc/ctdb/public_addresses 10.1.3.2/24 eth2In this example we have three nodes but a total of 4 public addresses.
10.1.2.1 can be hosted by either node 0 or node 1 and will be available to clients as long as at least one of these nodes are available. Only if both nodes 0 and 1 fails will this public address become unavailable to clients.
All other public addresses can only be served by one single node respectively and will therefore only be avialable if the respective node is also available.
You do not need to modify these scripts if you just want to use clustered Samba or NFS but they serve as examples in case you want to add clustering support for other application servers we do not yet proivide event scripts for.
Please see the service scripts that installed by ctdb in /etc/ctdb/events.d for examples of how to configure other services to be aware of the HA features of CTDB.
Also see /etc/ctdb/events.d/README for additional documentation on how to create and manage event scripts.
Configuring a different port to use for CTDB traffic is done by adding a ctdb entry to the /etc/services file.
Example: for change CTDB to use port 9999 add the following line to /etc/services
ctdb 9999/tcpNote: all nodes in the cluster MUST use the same port or else CTDB will not start correctly.
We recommend that you use public ip addresses using CTDB_PUBLIC_INTERFACE/CTDB_PUBLIC_ADDRESSES and that you setup a round-robin DNS entry for your cluster, listing all the public IP addresses that CTDB will be managing as a single DNS A record.
You may also wish to setup a static WINS server entry listing all of your cluster nodes IP addresses.