Mysql Master-Master Replication MYSQL数据库主主同步设置

1. db setup; 55.109
2. mysql instance from 109 to new machine, update ralated password;
3. dump SLIMDB from 125 to new db;  --routines
   a. change SLIMDB password on 125;
   b. restart Slimdb;
   C. dump data > bak.sql;      #mysqldump -uslim -palps --routines SLIMDB > /var/log/mysql125_0215.sql
   d. reset master; use command, reference to document
   e. config my.cnf on 125 and disable duplicattion by comment the command, modify innodb location;
   f. remove master.info on 125;
   g. restart mysql on 125;
   h. insert primaryLocation record into SLIM_CONFIG;   #insert into SLIM_CONFIG(ITEMNAME,ITEMVALUE) values('slimg2.global.site.location','primaryLocation');
4. import data into new machine;
   a. dump data into 126;
   b. reset master;
   c. remove master.info;
   d. conf my.cnf;
   e. restart mysql;
5. check the status of duplication; show slave status\G
   a. /opt/slimg2/WEB-INF/shell/mysql/slimdb_replication_monitor.sh monitor
   b. wait for Seconds_Behind_Master: 0
6. enable the duplication in my.cnf on 125 and restart 125 db, modify innodb location;
7. start slimdb_replication_monitor.sh on 125 and 126;
8. start all web and JCs for 126;
   1. modify the value of location to backupLocation for all web and JCs;
  


changes:

slimg2.global.site.location=backupLocation for 126
slimg2.global.site.location=primaryLocation for 125



#error log

1. no innodb engine .
resolve:  
my.cnf : "innodb_buffer_pool_size = 4G"  larger than memory of server.
rename  $MYSQL_HOME/ib_logfile*
restart mysql
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值