Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before we start the configuration process, stop the DualShield service on all machines. If we're going to make changes to an existing replication cluster, such as adding a new master/slave server, then stop the slave process on all MySQL servers in the replication cluster.

Step 1: Configure Server 1 as a Master

We will carry out the tasks below on server 1:

  1. Creating a user for replication
  2. Setting up the replication Master
  3. Taking a database snapshot (optional)

1.1 Creating a user for replication

We need to create a pseudo-user on this server (master) that will be used by other servers (slaves) to pull replication data from this server.

Expand

Include Page
DualShield6:Creating a user for MySQL replication [MSR]DualShield6:
Creating a user for MySQL replication [MSR]

1.2 Setting up the replication Master

We will now enable this server as a replication master. This involves making changes in the MySQL configuration file. 

Expand

Include Page
DualShield6:Setting up a replication MySQL Replication Master [MSR]DualShield6:
Setting up a replication MySQL Replication Master [MSR]

1.3 Taking a database snapshot

If the DualShield database has already been running for some times, then we need to take a snapshot of the database which will be copied and imported into the save servers. 

Expand

Include Page
DualShield6:Taking a MySQL database snapshot [MSR]DualShield6:
Taking a MySQL database snapshot [MSR]

Step 2: Configure Server 2 as a Master 

We will carry out the tasks below on server 2: 

  1. Importing the database snapshot (optional)
  2. Creating a user for replication
  3. Setting up the replication Master

2.1 Importing the database snapshot

Expand

Include Page
DualShield6:Importing a MySQL database snapshot [MSR]DualShield6:
Importing a MySQL database snapshot [MSR]

2.2 Creating a user for replication 

We need to create a pseudo-user on this server (master) that will be used by other servers (slaves) to pull replication data from this server. 

Expand

Include Page
DualShield6:Creating a user for MySQL replication [MSR]DualShield6:
Creating a user for MySQL replication [MSR]

2.3 Setting up the replication Master 

We will now enable this server as a replication master. This involves making changes in the MySQL configuration file. 

Expand

Include Page
DualShield6:Setting up a replication MySQL Replication Master [MSR]DualShield6:
Setting up a replication MySQL Replication Master [MSR]

Step 3: Configure Server 3 as a Master 

Follow the same procedure in Step 2 to to configure Server 3 as a Master

Step 4: Record the Master Binary Log Info on all Servers 

We need to obtain and record the master binary log file and position on all servers 

Expand

Include Page
DualShield6:Obtaining the Replication Master Binary Log Info [MSR]DualShield6:
Obtaining the Replication Master Binary Log Info [MSR]

Step 5: Configure Server 3 as a Slave 

Now, we will set up the replication slave on Server 3, connecting to Server 1 & 2 as the master. 

Expand

Include Page
DualShield6:Setting up a replication MySQL Replication Slave [MSR]DualShield6:
Setting up a replication MySQL Replication Slave [MSR]

Step 6: Configure Server 2 as a Slave

Now, we will set up the replication slave on Server 2, connecting to Server 1 & 3 as the master. 

Expand

Include Page
DualShield6:Setting up a replication MySQL Replication Slave [MSR]DualShield6:
Setting up a replication MySQL Replication Slave [MSR]

Step 7: Configure Server 1 as a Slave

Now, we will set up the replication slave on Server 1, connecting to Server 2 & 3 as the master. 

Expand

Include Page
DualShield6:Setting up a replication MySQL Replication Slave [MSR]DualShield6:
Setting up a replication MySQL Replication Slave [MSR]

 


References:

MySQL Multi-Source Replication

 

 

...