Debian 7 ISPConfig 3 Apache Cluster

Discussion in 'Installation/Configuration' started by rickconn, Feb 28, 2015.

  1. rickconn

    rickconn New Member

    Gday All,

    I have been looking at this tutorial from 2012:
    Installing A Web, Email & MySQL Database Cluster On Debian 6.0 With ISPConfig 3
    I have read though this a few times now and I am still not clear whether I can achieve what I want.
    I have an existing server in production with Debian 7, Apache, ISPconfig having followed the Perfect server setup.

    I have purchased a second server, and would like to build the Cluster from the tutorial above.
    I can not start from scratch with both servers as one is now 'live'.

    Does anyone have any ideas whether I can promote my existing sever (server1) to a ISPConfig master server, and follow the tutorial through with a live master?

    Thank you kindly.
    Rick



     
  2. florian030

    florian030 Well-Known Member HowtoForge Supporter

    If you´re running ispconfig on server 1 this is already your master-server. server2 can join a multi-server-setup the server 1 as the master. You can use this tutorial even if one server is already a live-system. but keep in mind, that the described setup for a mysql master-master-replikation will not work with current mysql-versions. you can´t set the master-server in the my.cnf. you have to do this in the mysql-console.
     
  3. rickconn

    rickconn New Member

    Florian030,

    Thank you for your time...
    When you say: "you can´t set the master-server in the my.cnf. you have to do this in the mysql-console."
    Do you mean from the command line, via bash and run mysql?

    Kind regards
     
  4. florian030

    florian030 Well-Known Member HowtoForge Supporter

    No, enter mysql as root (mysql -u root -p) and enter something like
    Code:
    CHANGE MASTER TO MASTER_HOST='master', MASTER_USER='slave', MASTER_PASSWORD='password';
    You may find additional informations here.
     
    rickconn likes this.
  5. rickconn

    rickconn New Member

    Florian,
    Very much appreciated...
    Danke
     
  6. rickconn

    rickconn New Member

    Florian,

    I have got most of the way through this, and replication worked. However when I restarted mysql on the slave I got the following error:


    Mar 2 09:45:48 server2 mysqld: 150302 9:45:48 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000017' at position 163130464, relay log '/var/lib/mysql/mysqld-relay-bin.000010' position: 163130610
    Mar 2 09:45:48 server2 mysqld: 150302 9:45:48 [ERROR] Slave SQL: Error 'Duplicate entry '1' for key 'PRIMARY'' on query. Default database: 'dbispconfig2'. Query: 'INSERT INTO `server` (`sys_userid`, `sys_groupid`, `sys_perm_user`, `sys_perm_group`, `sys_perm_other`, `server_name`, `mail_server`, `web_server`, `dns_server`, `file_server`, `db_server`, `vserver_server`, `config`, `updated`, `active`, `dbversion`,`firewall_server`,`proxy_server`) VALUES (1, 1, 'riud', 'riud', 'r', 'xxx.mydomain.tld', '0', '0', '0', '1', '1', '0', '[global]\nwebserver=apache\nmailserver=postfix\ndnsserver=mydns\n\n[server]\nauto_network_configuration=n\nip_address=xxx.xx.xx.xx\nnetmask=255.255.255.0\ngateway=0.0.0.0\nhostname=xxx.mydomain.tld\nnameservers=8.8.8.8,8.8.4.4\nfirewall=bastille\nloglevel=2\nadmin_notify_events=1\nbackup_dir=/var/backup\nbackup_dir_is_mount=n\nbackup_mode=rootgz\nmonit_url=\nmonit_user=\nmonit_password=\nmunin_url=\nmunin_user=\nmunin_password=\nmonitor_system_updates=y\n\n[mail]\nmodule=postfix_mysql\nmaildir_path=/var/vm
    Mar 2 09:45:48 server2 mysqld: ail/[domain]/[localpart]
    Mar 2 09:45:48 server2 mysqld: 150302 9:45:48 [Warning] Slave: Duplicate entry '1' for key 'PRIMARY' Error_code: 1062
    Mar 2 09:45:48 server2 mysqld: 150302 9:45:48 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.000017' position 163130464

    Looking for any clues.
    Not sure if adding: slave_skip_errors = 1062 is a good idea...

    Thank you
     
  7. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Skipping an error keeps the replication alive but you loose data. ;)

    The error occours because you have data in dbispconfig2. I think, you missed a step duing the setup.
     
  8. rickconn

    rickconn New Member

    Hello Florian,

    Thank you for your time.
    I have somehow managed to have an dbispconfig1 on both the server1 and server2.
    When I do a mysqldump on both of them they are exactly the same.

    Should I remove the dbispconfig2 from the slave (server2)?
    I can not tell you whether I have missed a step, though I did follow the first 8 steps of the install from debian 6, where I am on debian 7.

    Another issue I have come up with is at the end of the tutorial:
    https://www.howtoforge.com/installi...ase-cluster-on-debian-6.0-with-ispconfig-3-p5
    It says at the top:
    "Log into ISPConfig on the master server with a webbrowser:"
    "Click on System > Server Services > server2.example.tld:"

    When I log into server1, and follow the steps server2 is not listed.

    If you have any more thoughts it would be much appreciated.

    Thank you
    Rick
     
  9. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Did you let server2 join an existing setup?
    There are only some differences for a cluster-setup against a multi-server-setup: you need different local database-names, create a mysql-master-master-replcation between server1 and server2 and make sure, that interface/lib/config.inc.php is the same on both servers.
     
    rickconn likes this.
  10. rickconn

    rickconn New Member

    Hi Florian,

    As it is now, I can go on server1:8080 and server2:8080 and I so see the same data.
    Having never used ispconfig in this way before, I am not sure if it is or isn't working correctly.

    Are you employable to have a look, or are there others here who are?

    Again, thank you for your time, its very kind of you.

    Rick
     
  11. florian030

    florian030 Well-Known Member HowtoForge Supporter

    Just create a new website an check the result on both servers?
     

Share This Page