45 Drives Knowledge Base
KB450182 - Configuring CTDB (4.9 and above)
http://knowledgebase.45drives.com/kb/kb450182-configuring-ctdb-4-9-and-above/

KB450182 - Configuring CTDB (4.9 and above)

Posted on October 18, 2019 by Rob MacQueen


Configuring CTDB (4.9 and above)

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.

Config files:
/etc/sysconfig/ctdb

	# 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

	# 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.

	
		clustering = yes
		workgroup = SAMBA
		security = user

		passdb backend = tdbsam
		log level = 3

	
		path = /mnt/cephfs/fsgw
		valid users = root
		write list = root

PLEASE NOTE DOWNTIME IS REQUIRED TO COMPLETE THIS UPDATE

  1. Stop CTDB on each node
    1. systemctl stop ctdb
  2. Update each node
    1. yum update -y
  3. Reboot each node
    1. reboot
  4. Verify Update
    1.       # cat /etc/centos-release
            CentOS Linux release 7.7.1908 (Core)
      
            # 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
  1. Make a temporary directory:
    1. # mkdir /tmp/ctdb-migration/
  2. Run the migration script:
    1. # /usr/share/doc/ctdb-4.9.1/examples/config_migrate.sh -o /tmp/ctdb-migration /etc/sysconfig/ctdb
  3. The script would output a message like below:
    1.  Assuming "/etc/ctdb" as ctdb configuration directory
          If that's not correct, please specify config dir with -d
      
  4. Navigate to /tmp/ctdb-migration
    1. # cd /tmp/ctdb-migration & ls
  5. Link legacy event scripts
    1. # 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/
    2. 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
      1. # mkdir /var/lib/ctdb/volatile
      2. # mkdir /var/lib/ctdb/persistent
      3. # mkdir /var/lib/ctdb/state
      4. # mkdir /etc/ctdb/events/legacy/
    3. /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.
    4. Backup current ctdb.conf and install new style configuration file:
      1. # mv /etc/ctdb/ctdb.conf /etc/ctdb/ctdb.conf.default
      2. # mv ctdb.conf /etc/ctdb/
    5. If present move “script.options” &/or “ctdb.tunables” to /etc/ctdb
      1. # mv script.options /etc/ctdb/
      2. # mv ctdb.tunables /etc/ctdb/
  1. Start ctdb on each node
    1. systemctl start ctdb
  2. Wait to go healthy
  3. Mount share
  4. When configuring CTDB 4.9.X, it may be necessary to re-join the nodes to the domain.

Config files:
/etc/ctdb/ctdb.conf

	realtime scheduling = false


	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.

		clustering = yes
		workgroup = SAMBA
		security = user
		passdb backend = tdbsam
		log level = 3

	path = /mnt/cephfs/fsgw
	valid users = root
	write list = root
KB450182 – Configuring CTDB (4.9 and above) – 45 Drives Knowledge Base

KB450182 – Configuring CTDB (4.9 and above)

Last modified: January 29, 2020
You are here:
Estimated reading time: 2 min

Configuring CTDB (4.9 and above)

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.

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

PLEASE NOTE DOWNTIME IS REQUIRED TO COMPLETE THIS UPDATE

  1. Stop CTDB on each node
    1. systemctl stop ctdb
  2. Update each node
    1. yum update -y
  3. Reboot each node
    1. reboot
  4. Verify Update
    1.       [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
  1. Make a temporary directory:
    1. # mkdir /tmp/ctdb-migration/
  2. Run the migration script:
    1. # /usr/share/doc/ctdb-4.9.1/examples/config_migrate.sh -o /tmp/ctdb-migration /etc/sysconfig/ctdb
  3. The script would output a message like below:
    1.  Assuming "/etc/ctdb" as ctdb configuration directory
          If that's not correct, please specify config dir with -d
      
  4. Navigate to /tmp/ctdb-migration
    1. # cd /tmp/ctdb-migration & ls
  5. Link legacy event scripts
    1. # 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/
    2. 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
      1. # mkdir /var/lib/ctdb/volatile
      2. # mkdir /var/lib/ctdb/persistent
      3. # mkdir /var/lib/ctdb/state
      4. # mkdir /etc/ctdb/events/legacy/
    3. /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.
    4. Backup current ctdb.conf and install new style configuration file:
      1. # mv /etc/ctdb/ctdb.conf /etc/ctdb/ctdb.conf.default
      2. # mv ctdb.conf /etc/ctdb/
    5. If present move “script.options” &/or “ctdb.tunables” to /etc/ctdb
      1. # mv script.options /etc/ctdb/
      2. # mv ctdb.tunables /etc/ctdb/
  1. Start ctdb on each node
    1. systemctl start ctdb
  2. Wait to go healthy
  3. Mount share
  4. When configuring CTDB 4.9.X, it may be necessary to re-join the nodes to the domain.

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
Was this article helpful?
Dislike 0
Views: 956
Unboxing Racking Storage Drives Cable Setup Power UPS Sizing Remote Access