|
Configure common clone
Two servers, one main one
Master:
10.10.1.30
Slave:
10.10.1.200
Modify each machine my.cnf document, respectively modify server_id
Master server_id = 1, slave of server_id = 2
Restart both servers by:
show variables like 'server_id';
You can view the two servers server_id not the same.
Log Master, enter:
. Grant replication slave on * * to 'repl'@'10.10.1.200' identified by 'password';
flush privileges;
show master status;
File and Postion master record field, and one will stand.
Log Slave, enter:
mysql> change master to
-> Master_host = '10 .10.1.30 ',
-> Master_port = 3306,
-> Master_user = 'repl',
-> Master_password = 'password',
-> Master_log_file = 'bin-file.000035', // just the Master File field
-> Master_log_pos = 407; // Master just that Postion field
mysql> start slave;
Query OK, 0 rows affected (0.03 sec)
Enter: show slave status \ G
If there is no error message, then clone the configuration.
Now configure the semi-synchronous replication:
Check for semi-synchronous replication plug-in, version 5.6 ships were built.
To: / usr / lib64 / mysql / plugin here to see if there are:
[Root @ localhost plugin] # ll -h semisync_ *
-rwxr-xr-x. 1 root root 40K Sep 15 00:16 semisync_master.so
-rwxr-xr-x. 1 root root 14K Sep 15 00:16 semisync_slave.so
Then log Master, enter:
install plugin rpl_semi_sync_master soname 'semisync_master.so';
Then log Slave input:
install plugin rpl_semi_sync_slave soname 'semisync_slave.so';
These two documents. And then were on the Master's my.cnf file add:
rpl_semi_sync_master_enabled = 1
rpl_semi_sync_master_timeout = 3000
rpl_semi_sync_master_trace_level = 32
rpl_semi_sync_master_wait_no_slave = on
binlog_format = ROW
binlog_row_image = minimal
Slave in the my.cnf file add:
rpl_semi_sync_slave_enabled = 1
slave-parallel_workers = 4
binlog_format = ROW
binlog_row_image = minimal
Finally slave-parallel_worker slave parameters can increase worker threads and improve performance. The binlog_format Use row format will be more secure, the image is set to minimal, the binlog only records affected rows.
Restart both servers are available.
You can then enter the master or slave:
show global variables like 'rpl_semi%'; |
|
|
|