How to change master/slave roles between servers

Discussion in 'Installation/Configuration' started by ethraza, Aug 24, 2017.

  1. ethraza

    ethraza New Member

    Hi.
    I would like to know how to change places between a master and a slave server in ISPConfig 3.1.6, without move the services.

    What I have:
    Server1 (Master) - Ubuntu 10.04 / MySQL / Apache / Pure-FTP
    Server2 (Slave) - Ubuntu 10.04 / MySQL / Postfix
    Server3 (Slave) - Ubuntu 16.04 / MariaDB / Apache
    Server4 (Slave) - Ubuntu 16.04 / MariaDB

    What I would like to change to:
    Server1 (Slave) - Ubuntu 10.04 / MySQL / Apache / Pure-FTP
    Server2 (Slave) - Ubuntu 10.04 / MySQL / Postfix
    Server3 (Master) - Ubuntu 16.04 / MariaDB / Apache
    Server4 (Slave) - Ubuntu 16.04 / MariaDB

    Right now I go to server1:8080 to access ISPConfig panel. I have installed the web interface on server3 as well, so server3:8080 already works but it does not administrate all the servers because it is not the master.
    So, how do I change roles between servers without affect the services they are running, or IPs or hostnames? Just move the administration role to the newer server. All the Sites, FTP users, and DBs must stay in the server they are.

    Thanks in advance.
     
    Last edited: Aug 24, 2017
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not change the roles of the servers as the slaves do not hold all data (only the master has a complete dataset), or at least it would be a lot of work to do so.
     
  3. ethraza

    ethraza New Member

    Hi @till
    2 years later and I'm still locked up in the same setup.

    But this year I have a different idea.
    I'm planning to use Jerob's ISPConfig Docker image as the destination to the master role.

    So From:
    Server1 (Master) - Ubuntu 10.04 / MySQL / Apache / Pure-FTP --> Docker1 (New)

    To:
    Server1 (Slave) - Ubuntu 10.04 / MySQL / Apache / Pure-FTP --> Docker1 (Master)

    * All my server are running the latest (3.1.13p1) ISPConfig.

    To me, the perfect scenario would be to get Docker1 to be the ISPConfig master Control Panel only, and let the websites, users and all the good stuff in Server1, so I can migrate it slowly to other servers.

    Can I do that?
    Is ISPConfig Migration Tool able to do that? Or there is some howto explaning how to accomplish that?

    Thank you in advance
     
    Last edited: Apr 10, 2019
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use the Migration tool to import the master and the slave into a new server, that this new server uses docker does not matter for the import. I had fast look at that docker image and to me it seems as if it is not completely ok, the mail system of an ispconfig server is in /var/vmail, but he exports /var/mail, so the emails are not in an exported folder, they are in the docker image. And be careful if you ever rebuild the docker image, you will lose all config and users as this is buried into the docker image (/etc folder) and not stored outside of the container.

    Personally, I won't use Docker for a hosting server. Docker does not support Linux filesystem quota, so you can't limit the size of websites and the benefit of docker to rebuild the system in case you want new software won't work as hosting systems have a lot of config files and Linux system users in /etc and these are not exported, at least not in the image you want to use. And if you would export all these files, you will probably lose the ability to rebuild the system with docker too as the config files might be incompatible with a newer version of software.
     
  5. ethraza

    ethraza New Member

    Thank you for the quick answer.
    Yeah, you are right about docker limitations using it as a host server. The main reason I wanted to use docker is to hold just the master ISPConfig control panel, no websites, FTP, mail or anything. That is because this services are easy to move from one slave to another, but the master hole is not, it is stuck with the host I first installed it back in 2010 and now the hardware is defunct. Maybe the Migration tool will make it easy to move the master, but I'm still inclined to think that have this one inside a docker or VM will make it easier to manage it, not sure though.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Using Docker for the master should be fine. But the master is basically just the database plus some mysql users, so it can be moved easier than any slave server which hosts mail, websites or DNS.
     
  7. ethraza

    ethraza New Member

    So, if I copy just the database and passwd from Server1 to Docker1, it will have all it needs to be the master.
    Then I run php -q update.php (from install folder) in every node, including Server1, to tell them the master database is in Docker1.
    Is that right?
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You must also
    • check the database users for all hosts are added
    • add all hosts to /etc/hosts file on all hosts in the cluster
    I would go through the ISPConfig Manual to check everything is set up as is should for the multiserver setup.
     
  9. ethraza

    ethraza New Member

    Got it... Gonna try! :scared:

    1) Copy passwd and, dbispconfig and mysql DBs from Server1 to Docker1
    2) Check mysql.user hosts in all nodes
    3) Check /etc/hosts in all nodes
    4) php -q update.php in Docker 1, then in Server1, 2, 3 and 4
    5) Check Docker1 panel and breathe again.
     
  10. Jeremy007

    Jeremy007 Member

    Make sure to back up all your servers before actually committing to the change. Trust me, it's a necessary step if you haven't already did it.
     

Share This Page