Table of Contents
Configuring CTDB (4.9 and above)
Issue
CTDB being updated to a version in 4.9.x series brings an overhaul in configuration file format, parameters and default locations. Thus in an environment where CTDB configuration under /etc/sysconfig/ or /etc/ctdb/ctdbd.conf has been modified previously might experience some irregularities unless proper migration procedures are performed after the update.
Section 1 – A Working CTDB Configuration Pre 4.9.X
Config files:
/etc/sysconfig/ctdb
[root@smb1 ~]# grep -v '^$\|^\s*\#' /etc/sysconfig/ctdb CTDB_RECOVERY_LOCK="!/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper ceph client.admin cephfs_metadata lockfile" #CTDB_RECOVERY_LOCK=/mnt/cephfs/ctdb/.lockfile CTDB_NODES=/etc/ctdb/nodes CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses CTDB_MANAGES_SAMBA=yes CTDB_DEBUGLEVEL=NOTICE CTDB_SET_MonitorInterval=5 CTDB_SET_TakeoverTimeout=5 CTDB_SET_ElectionTimeout=2 CTDB_SET_KeepaliveLimit=3 CTDB_SET_KeepaliveInterval=1 CTDB_SET_ControlTimeout=15 CTDB_NOSETSCHED=yes
/etc/ctdb/nodes
192.168.102.50 192.168.102.51
/etc/ctdb/public_addresses
192.168.102.52/16 eth0
/etc/samba/smb.conf
[root@smb1 ~]# cat /etc/samba/smb.conf # See smb.conf.example for a more detailed config file or # read the smb.conf manpage. # Run 'testparm' to verify the config is correct after # you modified it. [global] clustering = yes workgroup = SAMBA security = user passdb backend = tdbsam log level = 3 [ceph] path = /mnt/cephfs/fsgw valid users = root write list = root
Section 2 – Update CentOS7.7, CTDB & Samba 4.9.X
PLEASE NOTE DOWNTIME IS REQUIRED TO COMPLETE THIS UPDATE
-
Stop CTDB on each node
-
systemctl stop ctdb
-
-
Update each node
-
yum update -y
-
-
Reboot each node
-
reboot
-
-
Verify Update
-
[root@smb1 ~]# cat /etc/centos-release CentOS Linux release 7.7.1908 (Core) [root@smb1 ~]# rpm -qa | egrep "samba|ctdb" samba-winbind-modules-4.9.1-6.el7.x86_64 samba-winbind-krb5-locator-4.9.1-6.el7.x86_64 samba-common-libs-4.9.1-6.el7.x86_64 samba-client-libs-4.9.1-6.el7.x86_64 samba-common-tools-4.9.1-6.el7.x86_64 samba-winbind-4.9.1-6.el7.x86_64 samba-winbind-clients-4.9.1-6.el7.x86_64 samba-4.9.1-6.el7.x86_64 ctdb-4.9.1-6.el7.x86_64 samba-common-4.9.1-6.el7.noarch samba-libs-4.9.1-6.el7.x86_64
-
Section 3 – Fix CTDB Configuration
-
Make a temporary directory:
-
# mkdir /tmp/ctdb-migration/
-
-
Run the migration script:
-
# /usr/share/doc/ctdb-4.9.1/examples/config_migrate.sh -o /tmp/ctdb-migration /etc/sysconfig/ctdb
-
-
The script would output a message like below:
-
Assuming "/etc/ctdb" as ctdb configuration directory If that's not correct, please specify config dir with -d
-
-
Navigate to /tmp/ctdb-migration
-
# cd /tmp/ctdb-migration & ls
-
-
Link legacy event scripts
-
# mkdir /etc/ctdb/events/legacy CTDB# ln -s /usr/share/ctdb/events/legacy/00.ctdb.script /etc/ctdb/events/legacy/ IP # ln -s /usr/share/ctdb/events/legacy/10.interface.script /etc/ctdb/events/legacy/ SMB # ln -s /usr/share/ctdb/events/legacy/50.samba.script /etc/ctdb/events/legacy/ WINB# ln -s /usr/share/ctdb/events/legacy/49.winbind.script /events/ctdb/events/legacy/ NFS # ln -s /usr/share/ctdb/events/legacy/06.nfs.script /events/ctdb/events/legacy/
-
Ensure core CTDB directories exist. This should only be neccesary on systems where CTDB has not bee running pre 4.9.X. In either case it is best to be sure each of these directories exist
-
# mkdir /var/lib/ctdb/volatile
-
# mkdir /var/lib/ctdb/persistent
-
# mkdir /var/lib/ctdb/state
-
# mkdir /etc/ctdb/events/legacy/
-
-
/tmp/ctdb-migration directory should now have the files named commands.sh, ctdb.conf and script.options. Optionally it can have files named ctdb.tunables, ctdb.sysconfig and README.warn based on extra changes present for CTDB configuration before the upgrade.
-
Backup current ctdb.conf and install new style configuration file:
-
# mv /etc/ctdb/ctdb.conf /etc/ctdb/ctdb.conf.default
-
# mv ctdb.conf /etc/ctdb/
-
-
If present move “script.options” &/or “ctdb.tunables” to /etc/ctdb
-
# mv script.options /etc/ctdb/
-
# mv ctdb.tunables /etc/ctdb/
-
-
Section 4 — Start CTDB and Verify
-
Start ctdb on each node
-
systemctl start ctdb
-
-
Wait to go healthy
-
Mount share
- When configuring CTDB 4.9.X, it may be necessary to re-join the nodes to the domain.
Section 5 — Final Config files
Config files:
/etc/ctdb/ctdb.conf
[legacy] realtime scheduling = false [cluster] recovery lock = !/usr/libexec/ctdb/ctdb_mutex_ceph_rados_helper ceph client.admin cephfs_metadata lockctdb # recovery lcok = /mnt/cephfs/ctdb/.lockctdb
/etc/ctdb/ctdb.tunables
ControlTimeout=15 ElectionTimeout=2 KeepaliveInterval=1 KeepaliveLimit=3 MonitorInterval=5 TakeoverTimeout=5
EVENT SYMLINKS
CTDB # ln -s /usr/share/ctdb/events/legacy/00.ctdb.script /etc/ctdb/events/legacy/ IP # ln -s /usr/share/ctdb/events/legacy/10.interface.script /etc/ctdb/events/legacy/ SMB # ln -s /usr/share/ctdb/events/legacy/50.samba.script /etc/ctdb/events/legacy/
/etc/ctdb/nodes
192.168.102.50 192.168.102.51
/etc/ctdb/public_addresses
192.168.102.52/16 eth0
/etc/samba/smb.conf
# See smb.conf.example for a more detailed config file or # read the smb.conf manpage. # Run 'testparm' to verify the config is correct after # you modified it. [global] clustering = yes workgroup = SAMBA security = user passdb backend = tdbsam log level = 3 [ceph] path = /mnt/cephfs/fsgw valid users = root write list = root
Views: 3472