Why is migration needed post CTDB upgrade to 4.9.X series with Red Hat Gluster Storage?

Solution Verified - Updated

Environment

  • Red Hat Gluster Storage 3.4
  • Samba/CTDB-4.9.X

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/ has been modified previously might experience some irregularities unless proper migration procedures are performed after the update.

Resolution

  • Prerequisite :

    • Upgrade to latest Red Hat Gluster Storage 3.4 using yum update to consume a version of CTDB from 4.9.x series.
  • With newer packages installed, verify the need of performing the migration as follows:

       # rpm -V $(rpm -qf /etc/sysconfig/ctdb)
    
    • If No output for the above command, migration was successfully handled via update process and migration steps detailed below can be skipped.

    • If it outputs something along the following lines, then further steps to migrate under new CTDB configuration style should be followed.

         S.5....T.  c /etc/sysconfig/ctdb
      
  • Migration steps:

    • Make a temporary directory:
       # mkdir /tmp/ctdb-migration/
    
    • Run the migration script:
       # /usr/share/doc/ctdb-4.9.8/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
    
    • /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/
    
    • Move script.options to CTDB configuration directory:
       # mv script.options /etc/ctdb/
    
    • commands.sh contains additional commands to be executed. Run the script after making it executable:
       # chmod +x commands.sh
       # ./commands.sh
    
    • If file ctdb.tunables is present, move it to /etc/ctdb/:
       # mv ctdb.tunables /etc/ctdb/
    
    • Check for presence of ctdb.sysconfig file

      • If present, Move it to /etc/sysconfig/ after backing up old file:
         # mv /etc/sysconfig/ctdb /etc/sysconfig/ctdb.old
         # mv ctdb.sysconfig /etc/sysconfig/ctdb
      
      • Else, replace current /etc/sysconfig/ctdb with new one coming from updated packages:
         # mv /etc/sysconfig/ctdb /etc/sysconfig/ctdb.old
         # mv /etc/sysconfig/ctdb.rpmnew /etc/sysconfig/ctdb
      
    • Finally, if README.warn is present, it gives a heads-up on parameters that are invalid/removed. If it says removed, then there won't be any replacement

Root Cause

  • Newer version of CTDB in 4.9.x series revamps configuration file format inside /etc/sysconfig/ctdb. Apart from location changes, this upgrade removes some configurational parameters that were present previously with and without replacements in the newer version. RPM packaging process cannot guarantee complete migration for all available CTDB options in newer format but only for default ones. Thus, in a customized setup, where additional CTDB parameters/options were used, it is bound to experience irregularities since those additional parameters won't get migrated automatically via update.
SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.