There is a new version of this tutorial available for Debian 8 (Jessie).

Installing A Web, Email And MySQL Database Cluster (Mirror) On Debian 5.0 With ISPConfig 3 - Page 2

3 Installing ISPConfig On The First (Master) Server

In this step we will install ISPConfig on the master server. To get the download URL of the latest ISPConfig 3 stable release, please visit the ISPConfig website: http://www.ispconfig.org/ispconfig-3/download/

Now we have to add two new MySQL root user records in the master database to allow root access from the slave server hostname and IP address. The easiest way to do this is to use the webbased phpmyadmin administration tool that we installed already. Open the URL http://192.168.0.105/phpmyadmin in a webbrowser, log in as MySQL root user and execute these MySQL queries:

CREATE USER 'root'@'192.168.0.106' IDENTIFIED BY 'myrootpassword';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'192.168.0.106' IDENTIFIED BY 'myrootpassword' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

CREATE USER 'root'@'server2.example.tld' IDENTIFIED BY 'myrootpassword';
GRANT ALL PRIVILEGES ON * . * TO 'root'@'server2.example.tld' IDENTIFIED BY 'myrootpassword' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

In the above sql commands, replace 192.168.0.106 with the IP address of the second server, replace server2.example.tld with the hostname of the second server and myrootpassword with the desired root password.

Click on the reload permissions button or restart MySQL. Then close phpmyadmin.

Go back to the shell of server1.example.tld and download the latest ISPConfig 3 stable release:

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/

Start the install script:

php -q install.php

Select language (en,de) [en]: <-- en
Installation mode (standard,expert) [standard]: <-- standard
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.tld]: <-- server1.example.tld
MySQL server hostname [localhost]: <-- localhost
MySQL root username [root]: <-- root
MySQL root password []: <-- Enter your mysql root password here
MySQL database to create [dbispconfig]: <-- dbispconfig1 (the local ISPConfig database name of the master and slave must be different, as both servers share the same data directory)
MySQL charset [utf8]: <-- utf8

Country Name (2 letter code) [AU]: <-- DE (Enter the ISO country code where you live here)
State or Province Name (full name) [Some-State]: <-- Niedersachsen (Enter the state where you live here)
Locality Name (eg, city) []: <-- Lueneburg (Enter the city here)
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <- ENTER
Organizational Unit Name (eg, section) []: <- ENTER
Common Name (eg, YOUR name) []: <- ENTER
Email Address []: <- ENTER

ISPConfig Port [8080]: <-- 8080

Clean up the install directories:

rm -rf /tmp/ispconfig3_install/install
rm -f /tmp/ISPConfig-3-stable.tar.gz

 

4 Installing ISPConfig 3 On The Second Server

In this step we will install ISPConfig on the slave server (server2.example.tld). This time we use the expert mode of the ISPConfig installer to add this node to the master ISPConfig server and database. To get the download URL of the latest ISPConfig 3 stable release, please visit the ISPConfig website: http://www.ispconfig.org/ispconfig-3/download/

Download the latest ISPConfig 3 stable release:

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install/

Start the install script:

php -q install.php

Select language (en,de) [en]: <-- en
Installation mode (standard,expert) [standard]: <-- expert
Full qualified hostname (FQDN) of the server, eg server2.domain.tld [server2.example.tld]: <-- server2.example.tld
MySQL server hostname [localhost]: <-- localhost
MySQL root username [root]: <-- root
MySQL root password []: <-- Enter your mysql root password here
MySQL database to create [dbispconfig]: <-- dbispconfig2 (the local ISPConfig database name of the master and slave must be different, as both servers share the same data directory)
MySQL charset [utf8]: <-- utf8
Shall this server join an existing ISPConfig multiserver setup (y,n) [n]: <-- y
MySQL master server hostname []: <-- server1.example.tld
MySQL master server root username [root]: <-- root
MySQL master server root password []: <-- Enter the root password of the master server here
MySQL master server database name [dbispconfig]: <-- dbispconfig1
Configure Mail (y,n) [y]: <-- y

Country Name (2 letter code) [AU]: <-- DE (Enter the ISO country code where you live here)
State or Province Name (full name) [Some-State]: <-- Niedersachsen (Enter the state where you live here)
Locality Name (eg, city) []: <-- Lueneburg (Enter the city here)
Organization Name (eg, company) [Internet Widgits Pty Ltd]: <- ENTER
Organizational Unit Name (eg, section) []:
<- ENTER
Common Name (eg, YOUR name) []:
<- ENTER
Email Address []:
<- ENTER

Configure Jailkit (y,n) [y]: <-- y
Configure FTP Server (y,n) [y]: <-- y
Configure DNS Server (y,n) [y]: <-- y
Configure Apache Server (y,n) [y]: <-- y
Configure Firewall Server (y,n) [y]: <--y
Install ISPConfig Web-Interface (y,n) [y]: <--n

Run:

rm -f /var/www/ispconfig

to remove the ISPConfig interface link in the /var/www directory.

Clean up the install directories:

rm -rf /tmp/ispconfig3_install/install
rm -f /tmp/ISPConfig-3-stable.tar.gz

 

5 Configure Replication In ISPConfig

Log in to ISPConfig on the master server with a web browser:

http://192.168.0.105:8080

Click on System > Server services > server2.example.tld:

Selecte server1.example.tld in the Is mirror of Server field and click on Save.

 

6 Additional Notes

When you want to activate a firewall on the master or slave server, ensure that you open port 6996 for GlusterFS on both servers.

 

Share this page:

Suggested articles

12 Comment(s)

Add comment

Comments

By: ICNET

Excellent guide!

Is having a mirror server supposed to provide automatic redundancy? as in, if server 1 goes down, will server 2 automatically take over? If so, how is this possible when it comes to DNS? since the 2 servers have different IP addresses and hostnames, the bind server is not exactly the same so would people have to use additional name servers in their domain names so that they can have true redundancy?

Thank you.

By: Anonymous

Has anyone tried MySQL in a Gridlock high availability cluster?

By: Ron Nitzsche

Hello,

load balancing should do the trick.

Greets

By: Liquid

Hi, great tutorial.

 But i have problem et the end. After i install second server, then i cannoct login to the ispconfig management interface on port 8080.

Any idea what is wrong???

By: Anonymous

I get the same issue after adding the second server.

When I try to log into the master control panel, I get a 'access denied for user [email protected]' message.

I have not changed anything and it worked before adding the second server.

Have you managed to resolve the issue?

By: ihamouda

Did you find a solution, I'm facing the same problem

By:

Before you install the control panel on the second server login to phpmyadmin on the primary server and export the mysql  database.  Install the second server as per the instructions.  When completed it will have replace your [email protected] password on the primary server.  Replace this password with the one from the mysql dump (Just this password) and then reload your privileges

By:

The interface is only available on the master server. You can not login to the interface on the slave.

By: fiwal61

Hi, this turorial is realy great. But I think there is an error in step 4. If you do the rm -f /var/www/ispconfig then you delete the ipsconfig at all since the /var/www is clustered using glusterfs. Is this right?

By:

This does not delete ispconfig, as /var/www/ispconfig is not the ispconfig installation directory, it is just a symlink.

By: cps

same here,, trying to tail /var/log/syslog the problem directed to /var/lib/mysql/mysql/*.HYM ls -l /var/lib/mysql/ drwxr-xr-x 2 ntp ntp 4096 2010-11-20 23:46 mysql

the owner of mysql directory is ntp,, not the mysql himself.. trying to chown -R mysql:mysql /var/lib/mysql/mysql wow,, the slave server is running!!! ok,, check the master server.. errrr... we've got many error folks..

ERROR 1017 (HY000) at line 1: Can't find file: './mysql/columns_priv.frm' (errno: 13) ERROR 1017 (HY000) at line 1: Can't find file: './mysql/db.frm' (errno: 13) ERROR 1017 (HY000) at line 1: Can't find file: './mysql/func.frm' (errno: 13) ERROR 1017 (HY000) at line 1: Can't find file: './mysql/help_category.frm' (errno: 13) ERROR 1017 (HY000) at line 1: Can't find file: './mysql/help_keyword.frm' (errno: 13)

now i'm trying to figure it out,, did anybody can resolve this problem!?

By: Anonymous

I followed the step, worked during configuration. After I reboot the server,  it show following :

df: `/var/lib/mysql': Transport endpoint is not connected

How Can I fix it.