• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
Synchronous Replication MySQL Clustering
Synchronous Replication
Objective
Setup a cluster involving two MySQL servers. Connect two MySQL servers as slaves to one of theMySQL server in the cluster, thereby making it a master. The slaves are connected using Asynchronousreplication.
Pre-requisites
1.
 
Install the necessary Operating Systems and install MySQL server on all of them.2.
 
All the Operating Systems should be in a network with every Operating System having its own IPaddress.
 Assumptions
1.
 
The cluster is setup using MySQL servers installed on – Windows Vista and Windows Server2003.2.
 
The MySQL Server on Windows Vista acts as a master and the slaves are installed on – Fedora 10and OpenSolaris 2008.113.
 
The replication process is done only for the new data so existing data will not be synchronized.
Procedure
1.
 
The primary pre-requisite for synchronous replication to be established, is that all the OperatingSystems should be connected in a network and every slave should be able to ping the master. If there is a problem in pinging, the fire-walls at the master and slave’s end should be eitherdisabled or properly configured to allow the slaves to communicate with master and vice-versa.
 
Synchronous Replication MySQL Clustering2.
 
Create a directory in Windows Vista to place the configuration file for the cluster. The followingsteps use the C:\mysql\mysql-cluster directory.3.
 
MySQL Cluster consists of four major components – Management Servers, Management Clients,Data Nodes and MySQL Servers. Except Management Clients, all the others have to be declaredin a configuration file.4.
 
Create a file named config.ini in the C:\mysql\mysql-cluster directory. There are four mainsections –[ndbd default]NoOfReplicas = <number>
Indicates no. of replicas in the cluster. Optimum value is 2.[ndb_mgmd]
Declare the hostname and data directory of the management server here[ndbd]
Declare the hostname and data directory of the data node here[mysqld]
Declare the hostname of the MySQL server here
 
Synchronous Replication MySQL Clustering5.
 
Open C:\Program Files\MySQL\MySQL Server 7.0\my.ini using a text editor. In the [mysqld]section, add the following two lines –
ndbcluster ndb-connectstring = <ip_of_management_server>
 At the end of the file create three new sections and declare the connect strings and the path of the configuration file.
[ndbd] connect-string = <ip_of_management_server>[ndb_mgm] connect-string = <ip_of_management_server>
 
[ndb_mgmd] config-file = C:\mysql\mysql-cluster\config.ini 
 In certain situations, Vista may not allow us to change the file. So copy the file somewhere,make the change sand replace the original one.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...