MySQL5.7 from the main building test essay

1. Create a master-slave

1.1 Prerequisite
master binlog are open from MySQL, and ensure that the only server-id
[mysqld]
log-bin bin-= MySQL
server-id = 10086

After making the changes, restart the server .
Restart the service to take effect
service mysqld restart
the process, and will have the following parameters associated with:

. 1 = the innodb_flush_log_at_trx_commit
sync_binlog. 1 =
Skip-OFF Networking =
1.2 user creates a replication connection from the library for the master repository in
a plurality of time from the library may be a copy of all user created only from the library, can be from each a user database replication;
the CREATE the uSER 'repl'@'%.server' the IDENTIFIED BY 'password';
. the GRANT Of rEPLICATION the TO SLAVE the ON 'repl'@'%.server';

1.3 connecting the main actions performed library from the library
the CHANGE the MASTER the TO
MASTER_HOST = 'master2.example.com',
MASTER_USER = 'Replication',
MASTER_PASSWORD = 'password',
MASTER_PORT = 3306,
of MASTER_LOG_FILE = 'Master2-bin.001',
MASTER_LOG_POS . 4 =,
MASTER_CONNECT_RETRY = 10;
starting from a library
start slave;
View from the connected state library, and the following several items of interest
show slave status \ G
assurance as three, double Yes, plus 0 to SBM, SBM if not zero, delays do need to look at the analysis, zero is the best guarantee SBM
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Seconds_Behind_Master: 0

Guess you like

Origin blog.51cto.com/3204960/2419948