MySQL5.5.40 implements One-master-multiple-slave One-Mastermuil-slave

Source: Internet
Author: User
We know that the overhead of MySQL Reading and Writing Performance is quite different. Generally, the server is under 20% write pressure, and the other 80% pressure comes from reading. Of course, this depends on the actual industry.

We know that the overhead of MySQL Reading and Writing Performance is quite different. Generally, the server is under 20% write pressure, and the other 80% pressure comes from reading. Of course, this depends on the actual industry.

We know that the overhead of MySQL Reading and Writing Performance is quite different. Generally, the server is under 20% write pressure, and the other 80% pressure comes from reading, of course, this depends on the actual business situation.

In this article, we are going to configure one master, three slaves. In fact, one master, multiple slaves are actually an extension of one master and one slave, because there is no communication between slave databases, which method is used to view the bandwidth load and traffic.

The principle of MySQL Master-Slave replication is that the Master constantly writes binary logs, Slave reads logs, and executes them according to the SQL records! For example:

Load Nginx in Ubuntu for high-performance WEB Server 5 --- MySQL master/Master Synchronization

Production Environment MySQL master/Master synchronization primary key conflict handling

MySQL Master/Slave failure error Got fatal error 1236

MySQL master-slave replication, implemented on a single server

Build a MySQL proxy server for read/write splitting + Master/Slave Synchronization

MySQL 5.5 master-slave bidirectional Synchronization

MySQL 5.5 master-slave synchronization troubleshooting

MySQL master-slave replication asynchronous semi-sync instance

The master-slave configuration of MySQL is inherent. You only need to perform simple configuration. Well, let's talk about it. Let's get started!

My environment is like this. All four machines on Vmware use bridging and dhcp is used to directly obtain Dynamic IP addresses.

Master: 192.168.83.61
Slave1: 192.168.83.87
Slave2: 192.168.83.88
Slave3: 192.168.83.89

MySQL versions on all four machines are MySQL 5.5.40

First, configure the Master

Vi/etc/my. cnf

Server-id = 61
Log-bin = mysql-bin
Binlog-do-db = test // database to be synchronized
Binlog-ignore-db = mysql // ignored Database
Binlog-ignore-db = information-schema // ignored Database

Add a synchronization account for the three slave instances on the master node.

Mysql> grant replication slave1 on *. * to 'slave1 '@ '192. 168.83.87' identified by 'slave1 ';

// Log on to slave1

Mysql> grant replication slave on *. * to 'slave2' @ '192. 168.83.88 'identified by 'slave2 ';

// Log on to slave2

Mysql> grant replication slave on *. * to 'slave3 '@ '192. 168.83.89' identified by 'slave3 ';

// Log on to slave3 successfully

Save and restart the Mysql service.

Service mysqld restart

Then, in mysql command line mode, use

Mysql> show master status \ G;

* *************************** 1. row ***************************
File: mysql-bin.000001
Position: 106
Binlog_Do_DB: test
Binlog_Ignore_DB: mysql, information-schema
1 row in set (0.00 sec)

For more details, please continue to read the highlights on the next page:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.