Mysql 环形复制
来源:互联网 发布:mac怎么查看群相册 编辑:程序博客网 时间:2024/05/21 00:48
三台主机: 192.168.0.205, 192.168.0.206,192.168.0.207
File: mysql-bin.000001
Position: 1142
File: mysql-bin.000002
Position: 1234
配置192.168.0.205
1.edit /etc/mysql/my.cnf
[mysqld]
[mysqld]
log-bin=mysql-binserver-id=5binlog-do-db=testbinlog-ignore-db=information_schema,performance_schema,mysqlreplicate-do-db=testreplicate-ignore-db=information_schema,performance_schema,mysqllog-slave-updatesslave-skip-errors=allsync_binlog=1auto_increment_increment=3auto_increment_offset=1
2.sudo service mysql restart
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
4.show master status\G;
File: mysql-bin.000003
Position: 4049
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
4.show master status\G;
File: mysql-bin.000003
Position: 4049
配置192.168.0.206
1.edit /etc/mysql/my.cnf
[mysqld]
[mysqld]
log-bin=mysql-binserver-id=5binlog-do-db=testbinlog-ignore-db=information_schema,performance_schema,mysqlreplicate-do-db=testreplicate-ignore-db=information_schema,performance_schema,mysqllog-slave-updatesslave-skip-errors=allsync_binlog=1auto_increment_increment=3auto_increment_offset=2
2.sudo service mysql restart
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
4. execute mysql scripts:
1) stop slave;
2) change master to master_host='192.168.0.205', master_user='repl', master_password='slavepass', master_log_file='mysql-bin.000003', master_log_pos=4049;
3) start slave;
5.show master status\G;File: mysql-bin.000001
Position: 1142
配置192.168.0.207
1.edit /etc/mysql/my.cnf
[mysqld]
[mysqld]
log-bin=mysql-binserver-id=5binlog-do-db=testbinlog-ignore-db=information_schema,performance_schema,mysqlreplicate-do-db=testreplicate-ignore-db=information_schema,performance_schema,mysqllog-slave-updatesslave-skip-errors=allsync_binlog=1auto_increment_increment=3auto_increment_offset=3
2.sudo service mysql restart
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
3.create user 'repl'@'%' identified by 'slavepass'; grant replication slave on *.* to 'repl'@'%';
4. execute mysql scripts:
1) stop slave;
2) change master to master_host='192.168.0.206', master_user='repl', master_password='slavepass', master_log_file='mysql-bin.000001', master_log_pos=1142;
3) start slave;
5.show master status\G;File: mysql-bin.000002
Position: 1234
配置192.168.0.205
1. execute mysql scripts:
1) stop slave;
2) change master to master_host='192.168.0.207', master_user='repl', master_password='slavepass', master_log_file='mysql-bin.000002', master_log_pos=1234;
3) start slave;
0 0
- Mysql 环形复制
- M M M 的MYSQL 环形复制
- 环形
- MYSQL复制
- mysql 复制
- MySQL复制
- mysql复制
- Mysql复制
- MySQL复制
- MYSQL-复制
- MySQL复制
- MySQL复制
- mysql复制
- MySQL复制
- mysql 复制
- mysql复制
- mysql复制
- MySQL复制
- IIS中的大文件上传问题解决方法
- 新的一天 新的开始~~!!
- 让不懂编程的人爱上iOS7
- android.os.NetworkOnMainThreadException异常
- git客户端使用
- Mysql 环形复制
- ThinkPHP调用error和success方法时报错
- Nova如何配置虚拟机使用Spice+QXL ?
- 陈安之先生
- Jquery优化效率 提升性能解决方案
- SSRF(Server-side Request Forgery)
- Anatomy of a Program in Memory
- 真的不是一路人
- jquery 对单选按钮遍历选择