Replicate users HA cluster and ispconfig3

Discussion in 'Installation/Configuration' started by stevegjacobs, Jun 18, 2010.

  1. stevegjacobs

    stevegjacobs New Member

    Hi
    I've set up a 2 server high available cluster using drbd and heartbeat with ISPconfig3. After a lot of trial and error, I have most things working. I've got apache, mysql and a number of other services and some configuration files on the drbd partition. My current setup works and when one server fails the other server is picking up all other services. One problem seems to remain.

    Creating a new site in Ispconfig3 creates a new linux user. This means that the linux configuration files /etc/passwd, /etc/group and /etc/shadow are changed. As I have things now, if changes are made on server1 from ispconfig3, the users aren't replicated in server2. This means in the event of a failover, apache2 won't start because it can't find the users.

    I know this is probably more of a heartbeat question, but is there a good way to reliably replicate the passwd, shadow and group files from whichever server is master in the cluster to the slave?

    Thanks

    steve
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig 3 is doing all the configuration file and user replication automatically, you just have to enable it under System > Server services > "click on the secondary Server, the one that does not run the controlpanel interface" and select the master system in the "is mirror of server" select field.
     
  3. xrstokes

    xrstokes Member

    Fantastic

    Thanks again to all those who've put this software together. It amazing what you've done so far. When I turned the open source community a few months ago to look for answers I didn't expect to find something as professional as this. I’m quite blown away; it's even got a complete manual. :)
    I’ve completed a similar setup to the one above. 2 systems in separate locations with a mirror for failover. The mysql databases are identical and I’ve had a near perfect run with master/master replication. The one thing I can't seem to work out is how to make the ispconfig interface available on the second host. I understand you don't want both to write to the 1 database at the same time but can't one of them be a hot standby. I'm fairly new to this stuff and am probably, wait, definitely missing something here, but this is my understanding of what's going on under the hood.
    "Ispconfig" is like a modern website. It’s made up of two main parts. The web directory and an sql database. When a user accesses the site it reads the database to see their privileges/sites emails etc. if a user makes changes or adds something. It goes and modifies the server through cron jobs and the like. Can’t the site be replicated by means of file sync and master/master replication? Or would that double up the cronjobs and stuff. I’m not trying to undermine the work in any way or make it sound simple. Just trying to get my head around it all. I hadn't used Linux a month ago and now I’m over my eyeballs in it.

    Grant
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not run 2 ispconfig servers from the same mysql database. But what you can do is that you run 2 copies of the ispconfig interface which connect to the same database while the server pasrt have their own databases.

    Examle:

    You have 2 mysql servers, both connected with master/master replication. The only datavase that should be exluded from the replication is the database "mysql" as the users in that database gets managed by ispconfig on each server.

    Now you install ispconfig on the first server, use the database name "dbispconfig1" and the ispconfig mysql user "ispconfig1".

    Then install ispconfig on the second server, use the database name "dbispconfig2" and the ispconfig user "ispconfig2" for the installation on the slave and select that the slave shall connect to the master server and that the slave shall have a interface as well. The option to choose a different name for the ispconfig user has been added in 3.0.4.2, just for your info if you havent seen this on your install.

    Now we have the databases dbisponfig1 and dbispconfig 2 on both servers, replicated by mysql master/master replication and ispconfig on the first server connects to dbisponfig1 and ispconfig on the slave connects to dbisponfig2. Thats the "normal" master/slave setup. To enable the ispconfig 3 interface on the slave, we must reconnect it now to use dbispconfig1 instead of dbispconfig2. Edit the file /usr/local/ispconfig/interface/lib/config.inc.php and reconfigure the database details so that it connects to dbispconfig1. The details in the server part configuration file /usr/local/ispconfig/server/lib/config.inc.php should not be modified, so that the server part connects to dbispconfig2.
     
  5. xrstokes

    xrstokes Member

    Wow

    Thanks Heaps. It's getting late here so I'll hit it up when I'm fresh in the morning.

    Thanks Again.
     
  6. xrstokes

    xrstokes Member

    Adding ispconfig interface

    i just tryed to add the interface using the update function and got the following error. any idea's?

    Updating ISPConfig
    PHP Notice: Undefined property: installer::$ispconfig_interface_installed in /tmp/ispconfig3_install/install/update.php on line 365
    Reconfigure Crontab? (yes,no) [yes]: no

    I tryed putting the relevant files in sites-enabled and sites-available. made some ssl certs and the site seems to work but no one can log in. must be more too it than that. oh yeah, both servers are opensuse 12.1 with latest ispconfig and nginx. i've updated the interface config file with the right details. i copied the username and password from the interface config file of the first server so i know that much is right. do i need to set unison to sync the interface web folder?

    whoops, didn't need to change the password. just the database. ran update again and it went through. I now have exactly what i wanted.

    Thankyou so much.

    Grant.

    Grant.
     
    Last edited: Feb 7, 2012
  7. xrstokes

    xrstokes Member

    HA/Mirror/Failover

    So now i've got my dream mirror's running i think. the files in www and emails are in sync with a slight delay through use of unison. The mysql servers are in sync through master/master replication. Found a useful tip to stop conflicts here. http://www.neocodesoftware.com/replication/
    and now even the interface is available on both machines which are in two different locations.
    Now for my next question.
    If the master server was out for a week say. would the slave be able to be used for all of the normal tasks during that time. I assume to bring the master backup i would need to do the following.
    resync sql.
    resync mail and www files.
    resync .passwd files
    resync quota's [any shortcut for this by the way]
    would this work by any chance.
     

Share This Page