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

Want to support HowtoForge? Become a subscriber!
 
Submitted by till (Contact Author) (Forums) on Tue, 2010-08-10 16:24. ::

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.

 

7 Links


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Mon, 2010-11-08 16:58.

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.

Submitted by fiwal61 (not registered) on Fri, 2010-09-03 15:29.
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?
Submitted by till (registered user) on Wed, 2010-11-24 08:18.
This does not delete ispconfig, as /var/www/ispconfig is not the ispconfig installation directory, it is just a symlink.
Submitted by Liquid (not registered) on Sun, 2010-08-22 15:13.

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???

Submitted by till (registered user) on Wed, 2010-11-24 08:19.
The interface is only available on the master server. You can not login to the interface on the slave.
Submitted by Anonymous (not registered) on Fri, 2010-11-05 19:14.

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 ispconfig@localhost' message.

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

Have you managed to resolve the issue?

Submitted by TheCaptain (registered user) on Sat, 2011-01-01 05:31.
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 ispconfig@localhost password on the primary server.  Replace this password with the one from the mysql dump (Just this password) and then reload your privileges
Submitted by ihamouda (not registered) on Tue, 2010-11-09 01:10.
Did you find a solution, I'm facing the same problem
Submitted by cps (not registered) on Sat, 2010-11-20 21:15.

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!?

Submitted by ICNET (not registered) on Tue, 2010-08-10 18:45.

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.

Submitted by Ron Nitzsche (not registered) on Tue, 2014-06-17 04:04.

Hello,

load balancing should do the trick.

Greets

Submitted by Anonymous (not registered) on Tue, 2010-09-21 10:29.
Has anyone tried MySQL in a Gridlock high availability cluster?