Change/switch master server in a ISPConfig 3 multiserver scenario

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

  1. clixclix

    clixclix Member HowtoForge Supporter

    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.
     
    Fermin, CaptainBalou and ahrasis like this.
  2. mikerogers

    mikerogers Member

    A long time ago, I had done this before but the time has come where I need to do it again... this is the only part I'm hung up on... How do I ensure the ISPConfig admin web interface is installed and working on the "new master"?
     
  3. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I would connect to the server on port 8080 and log in to ISPConfig. The same way any ISPConfig server is used.
     
    Last edited: Aug 18, 2022
  4. mikerogers

    mikerogers Member

    The issue being that this was initially a "slave" server so it had no interface. I have moved everything over and even tried " ispconfig_update.sh --force" and reconfigure services hoping that would generate the proper "000-ispconfig.vhost" file but no luck?
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    during the update process, reconfiguring services, i believe one of the questions is to enable / reconfigure the interface.
    i would have thought that would create the 000-ispconfig.vhost file if it didn't already exist.
     
  6. mikerogers

    mikerogers Member

    I ended up copying my ispconfig.vhost file from the original master.

    I tried running the update process a couple of times and it never asked me anything other than changing the port.

    The interface will not load and is getting this error in the logs: ssl_stapling_init_cert: can't retrieve issuer certificate!
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The update is not intended to make a slave system a master, so it should not add a vhost for the GUI. There is actually no clean way of doing this, especially as you override the slave so that the slave does not exist anymore while it is still not fully the master and the slave will continue to exist in the copied master database. Copying over a master to a new clean system is fine (e.g. for hardware or OS upgrade), but copying it over to an existing slave system might mess things up.
     
    Th0m likes this.
  8. mikerogers

    mikerogers Member

    Well, now I'm kind of stuck here... I've already copied over the Database and done all of the steps in the OP's original post.
    What should I try next to get the interface working?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Copy the interface vhost config file from the existing master and the ISPConfig SSL certs.
     
  10. mikerogers

    mikerogers Member

    I copied the vhost config file but not the SSL Certs as this new master is a different hostname so that won't work?
     
  11. mikerogers

    mikerogers Member

    Wow... I am a complete idiot... LOL... so I was trying to pull up the "HTTP://" non-secure version of the new master instead of the SSL "https://" version.

    Doing that, things seem to be working just fine now... ;)
     
  12. mikerogers

    mikerogers Member

    Well, I may have spoken too soon... My "additional PHP versions" are not showing up in the interface:
    [​IMG]

    They are still in the database though:
    [​IMG]

    Any thoughts on what could be causing this?
     
  13. mikerogers

    mikerogers Member

    Also just FYI, I tried to create a new entry in the Interface and even that wouldn't show in the interface but it did show in the Database...
     
  14. mikerogers

    mikerogers Member

    @till - Any idea on how to fix this?
    I can't edit any site settings until I do.
     
  15. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Is the server_id correct? Check in the server column.
     
  16. mikerogers

    mikerogers Member

    It says server_id = "6".
    That's also what it says in all of the config files, etc, as well.
    Since it is now in a single server environment, should I change this to "1" or something?
     
  17. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Depends on what the ID set for your current server is, I think.
     
  18. mikerogers

    mikerogers Member

    I thought so as well.... this server thinks it's ID is 6... that's what it all says in the database... seems like it should be ok.
    @till - any thoughts?
     
  19. mikerogers

    mikerogers Member

    @till - Any thoughts on this?
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    See my post #6 on this topic. I mentioned there that it will likely not fully work what you did. A master server has always ID 1 in an ISPConfig multiserver setup, which is not the case anymore on your system due to the changes you made. This might or might not work, it's simply out of spec for the software, and as it seems on your system, it does not work. You can try experimenting with setting server_id to 6 in the two config.inc.php files on this server (if this server shall have ID 6 now).
     

Share This Page