Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd August 2011, 15:04
stefanm stefanm is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Thanks: 32
Thanked 5 Times in 4 Posts
Default ISPConfig 3 replication and Stunnel

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.
Reply With Quote
Sponsored Links
  #2  
Old 3rd August 2011, 16:00
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,070
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 3rd August 2011, 16:31
stefanm stefanm is offline
Junior Member
 
Join Date: Oct 2009
Posts: 21
Thanks: 32
Thanked 5 Times in 4 Posts
Default

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!
Reply With Quote
  #4  
Old 3rd August 2011, 17:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,070
Thanks: 826
Thanked 5,396 Times in 4,240 Posts
Default

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 config.inc.php 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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
stefanm (3rd August 2011)
Reply

Bookmarks

Tags
database, replication, stunnel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:19.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.