ISPConfig 3 replication and Stunnel

Discussion in 'Installation/Configuration' started by stefanm, Aug 3, 2011.

  1. stefanm

    stefanm New Member HowtoForge Supporter

    Hi Everyone,

    I am currently planing a small HA setup with two servers and ISPConfig 3 running. In contrast to the sample cluster setup in the manual, I'd like to route the database part of the replication through stunnel and use master-master replication. As I understand the manual, there is only one common setting for a ISPconfig slave server that is used both for database connections (using the standard port 3306) and the remote API. However for the stunnel I would need to configure ISPConfig to use localhost and a different port for database replication.

    Can anybody give me a hint where I might change this in the ISPConfig source? Had a quick glance at the sources, but couldn't find a suitable place.
    Perhaps Till or Falko?

    Many thanks for your help.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can use master-master replication for client databases but make sure that you exclude the databases "mysql" and the ispconfig database (dbispconfig). If they would be in a mysql master/master replication the setup will fail as ispconfig manages the replication of mysql users and its own database content automatically.

    The remote api is not related to replication. It is a API for external applications to connect to ISPConfig.

    If you have to reconfigure the mysql port, you will have to edit the db_mysql.lib.php file in the server classes directory (/usr/local/ispconfig/server/lib/classes)on the slave servers.
  3. stefanm

    stefanm New Member HowtoForge Supporter

    Hi Till,

    thanks for your hints. I looked at the source you pointed to and I am not sure that I am not breaking the db connectivity when editing the class.

    To render clear what I am planning. Lets say I have two servers named master and slave. As I understand in the manual, normally I open the Server configuration panel on "master", add "slave" to the known servers and tick the option "Is mirror of" and enter "master" to the textfield. Now, I assume ISPConfig propagates all changes to the dbispconfig database on "master" to the "slave" (or does the slave poll for changes?). For the database connection to "slave", I guess ISPConfig uses the name of the server I entered into the panel (here: slave) and the default mysql port 3306. However, to use stunnel for replication I would need to set the database connection parameters to "localhost" and e.g. port 3999. (stunnel is transparent, so to access the remote database I connect to a local port).

    Sorry for bothering and thanks for youe help!
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The slave polls for changes. Thats why you have to edit the library only on the slave server.

    The slave gets added to the master server by the ispconfig installer while the slave gets installed, so you dont add anything in ispconfig on the master server and you can not add anything there, as this would not result in a working setup.

    All mysql hostnames except of localhost have to be FQDN. So "slave" is not a valid hostname for that setup as the systm tries to resolve the names, you can e.g. use slave.yourdomain.tld instead.

    Please be aware that ispconfig has to connect to the mysql db on localhost for its own purposes, so you can not change the IP address for localhost to a different IP in /etc/hosts.

    I guess you will have to extend the settings in so that you can set the mysql port there to a different port for the master and the slave connection and then change the mysql library to use the default port for the local connection and the otherv port for the remote connection.

Share This Page