Change/switch master server in a ISPConfig 3 multiserver scenario

Discussion in 'General' started by clixclix, May 6, 2021.

  1. clixclix

    clixclix ISPConfig Developer ISPConfig Developer

    Hi everybody,
    I just would like to share with the ISPConfig community a successful experience changing the master server in a multiserver scenario.
    Premise: I had to dismiss the master server, so I had to "promote" one of the slave servers to master. I looked for a complete solution here on the forum, but I only found partial hints.
    Note: Obviously, I first moved all the services (websites, etc.) on the "old master" server to the other servers.
    1. Precautionary actions
      1. backup the dbispconfig database on designated "new master" server
      2. backup ISPConfig Config files (/usr/local/ispconfig/server/lib/config.inc.php and /usr/local/ispconfig/interface/lib/config.inc.php) on all servers
      3. ensure that the ISPConfig admin web interface is installed and working on the "new master" server
    2. Copy whole dbispconfig database from “old master” server onto “new master” server
    3. On the "new master" server,
      • change both ISPConfig Config files, from:
        • $conf['dbmaster_host'] = '[old master]';
          $conf['dbmaster_user'] = 'username';
      • to:
        • $conf['dbmaster_host'] = '';
          $conf['dbmaster_user'] = '';
    4. On the "old master" server
      • change both ISPConfig Config files, from:
        • $conf['dbmaster_host'] = '';
          $conf['dbmaster_user'] = '';
          $conf['dbmaster_password'] = '[whatever]';
      • to:
        • $conf['dbmaster_host'] = '[new master]';
          $conf['dbmaster_user'] = 'ispcsrv[id]'; // I think you can set any username you want
          $conf['dbmaster_password'] = '[any long password]';
      • Run: ispconfig_update.sh --force
        • Reconfigure Permissions in master database? => yes
    5. On all the other slave servers
      • change both ISPConfig Config files, from:
        • $conf['dbmaster_host'] = '[old master]';
      • to:
        • $conf['dbmaster_host'] = '[new master]';
      • Run: ispconfig_update.sh --force
      • Reconfigure Permissions in master database? => yes
    • Start using ISPConfig admin web interface on the new master server.
    That's it. Everythink worked perfectly for me.
    Feel free to add your comments or express any perplexity about it.
     
    ahrasis likes this.

Share This Page