Setting Up Multiple Server Steps Involved

Image result for servers

Main aim to setup clustering MySQL is to have redundancy – you server and applications will run smoothly even if one server goes down.

Go To Site : cloud server videos

Keep in mind: For better efficiency you must have a 3rd server as a management node however this can be closed down after the cluster starts. Also note that shutting down the management server is not advised (see the additional notes at the bottom of this document for more information). You can not run a MySQL Cluster with simply two Dedicated servers And have real redundancy.

It is possible to set up the cluster on 2 Committed Servers you will not get the capability to “kill” one server and for the cluster to continue as regular. For this you require a third server running the management node.

Now below I had actually provided 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 2 will be the two that wind up “clustered”. This would be best for 2 servers behind a load balancer or using round robin DNS and is a great replacement for replication. Server 3 has to have just small changes made to it and does NOT require a MySQL set up. It can be a low-end device and can be performing other tasks.

PHASE 1: Set up MySQL on the very first 2 servers:

Total the following actions on both mysql1 and mysql2:

cd/ 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/.
groupadd mysql.
useradd -g mysql 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.
ln -s mysql-max-4.1.9- pc-linux-gnu-i686 mysql.
cd mysql.
scripts/mysql _ install_db– user= mysql.
chown -R root.
chown -R mysql information.
chgrp -R mysql.
cp support-files/mysql. server/ etc/rc. d/init. d/.
chmod +x/ etc/rc. d/init. d/mysql. server.
chkconfig– include mysql.server.

Do not begin MySQL yet.

STAGE 2: Set up and set up the management server.

You need the following files from the bin/ of the mysql directory: ndb_mgm and ndb_mgmd. Download the entire mysql-max tarball and extract them from the bin/ directory site.

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.
cd mysql-max-4.1.9- pc-linux-gnu-i686.
mv bin/ndb _ mgm.
mv bin/ndb _ mgmd.
chmod +x ndb_mg *.
mv ndb_mg */ usr/bin/.
cd.
rm -rf/ usr/src/mysql-mgm.

You now need to set up the config file for this management:.

mkdir/ var/lib/mysql-cluster.
cd/ var/lib/mysql-cluster.
vi [or emacs or other editor] config.ini.

Now, place the following (altering the bits as shown):.

[NDBD DEFAULT] NoOfReplicas= 2.
[MYSQLD DEFAULT] [NDB_MGMD DEFAULT] [TCP DEFAULT] # Managment Server.
[NDB_MGMD] HostName= 192.168.0.3 # the IP of THIS SERVER.
# Storage Engines.
[NDBD] HostName= 192.168.0.1 # the IP of the FIRST SERVER.
DataDir=/ var/lib/mysql-cluster.
[NDBD] HostName= 192.168.0.2 # the IP of the SECOND SERVER.
DataDir=/ var/lib/mysql-cluster.
# 2 MySQL Clients.
# I personally leave this blank to allow rapid modifications of the mysql customers;.
# you can get in the hostnames of the above 2 servers here. I recommend you dont.
[MYSQLD] [MYSQLD]
Now, begin the management server:.

ndb_mgmd.

This is the MySQL management server, not management console. You should for that reason not expect any output (we will begin the console later on).

PHASE 3: Configure the storage/SQL servers and start MySQL.

On each of the two storage/SQL servers (192.168.0.1 and 192.168.0.2) enter the following (altering the bits as proper):.

vi/ etc/my. cnf.

Go into i to go to place mode again and place this on both servers (altering the IP address to the IP of the management server that you established in phase 2).

Leave a Reply

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