Servers

Steps to Set Up MySQL Cluster For Multiple Dedicated Servers

Main aim to set up clustering MySQL is to have redundancy – you host and also applications can run easily if one server goes downhill.

Note: To superior performance that you ought to have a 3rd server as a management node however this can be shut down following the cluster begins. Also remember that shutting down the direction server is not advocated (see the added notes at the base of this record for more details ). You can’t run a MySQL Cluster with only two Dedicated servers And also possess true redundancy ip booter.

It’s likely to establish the cluster on two wheeled Servers you will not get the power to”destroy” a server and for the bunch to remain as normal. With this you require a third host conducting the direction node.

I had given the example for three servers:

mysql1.domain.com – 192.168.0.1
mysql2.domain.com – 192.168.0.2
mysql3.domain.com – 192.168.0.3

Servers 1 and two are both that find yourself”clustered”. This would be ideal for just two servers behind a load balancer or using round robin DNS and is a good replacement for replication. Server 3 needs to possess only minor alterations made to it does NOT call for a MySQL setup. Additionally, it is sometimes a non invasive system and could be taking out other activities.

STAGE 1 ): Set up MySQL on the two servers:

Complete the Subsequent steps on both mysql1 and also mysql2:

C d / / usr/local/
dev.mysql.com/get/Downloads/MySQL-4.1/mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz/

from/signal42. com/mirrors/mysql/

Chown -R mysql info
chgrp -R mysql.
cp support-files/mysql. Waiter /
etc

/rc. d/init. d/init. d/mysql.

Do not commence MySQL but.

Phase 2: Install and configure the control server

You want the following files out of the bin/ of this mysql listing: ndb_mgm and also ndb_mgmd. Download the whole mysql-max tarball and extract them by the bin/ directory.

Mkdir / / usr/src/mysql-mgm
Cd / / usr/src/mysql-mgm
dev.mysql.com/get/Downloads/MySQL-4.1/mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz/

from/www. Signal42.com/ / mirrors/mysql/
Tar -zxvf mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
rm mysql-max-4.1.9-pc-linux-gnu-i686.tar.gz
C-D mysql-max-4.1.9-pc-linux-gnu-i686
mv bin/ndb_mgm.

You now Should Establish the config file for this control:

Mkdir /var/lib/mysql-cluster
Cd /var/lib/mysql-cluster
vi [or emacs or any other editor] config.ini

Now, insert the following (changing the bits as indicated):

NoOfReplicas=2
[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]
Number Managment Server
[NDB_MGMD]
HostName=192.168.0.3 # the IP of the SERVER
# Storage Engines
[NDBD]
HostName=192.168.0.1 Number the IP of the FIRST SERVER
DataDir= /var/lib/mysql-cluster
[NDBD]
HostName=192.168.0.2 Number the IP of the SECOND SERVER
DataDir=/var/lib/mysql-cluster
No 2 MySQL Customers
# I personally leave this blank to Permit rapid changes of this mysql customers;
# you can input the hostnames of this above two servers here. I suggest you don t.
[MYSQLD]
[MYSQLD]

Now, Begin the management server

ndb_mgmd

This may be actually the MySQL management host, perhaps not management console. You should hence not expect any outcome (we will begin the console after ).

Phase 3: Establish the storage/SQL servers and start MySQL

On Every One of the two storage/SQL servers (192.168.0.1 along with 192.168.0.2) input the following (altering the bits as appropriate):

Leave a Reply

Your email address will not be published. Required fields are marked *