标签:query 数据 cal conf pass over amp base bin
[root@db03 ~]# vim /service/mha/app1.cnf
[root@db03 ~]# vim /service/mha/app1.cnf
......
[binlog1] # 把主库的binlog日志备份到本地
no_master=1
hostname=172.16.1.53 # 主库的ip
# 不能跟当前机器数据库的binlog存放目录一样
master_binlog_dir=/root/binlog/
# 进入该目录
[root@db03 ~]# cd /root/binlog/
# 备份binlog
[root@db03 binlog]# mysqlbinlog -R --host=172.16.1.52 --user=mha --password=mha --raw --stop-never mysql-bin.000001 &
# 进入该目录
[root@db03 ~]# cd /root/binlog/
#备份binlog
[root@db03 binlog]# mysqlbinlog -R --host=172.16.1.52 --user=mha --password=mha --raw --stop-never mysql-bin.000001 &
[root@db03 binlog]# masterha_stop --conf=/service/mha/app1.cnf
Stopped app1 successfully.
[root@db03 binlog]# nohup masterha_manager --conf=/service/mha/app1.cnf --remove_dead_master_conf --ignore_last_failover < /dev/null > /service/mha/manager.log 2>&1 &
# 主库
mysql> create database mha;
Query OK, 1 row affected (0.01 sec)
[root@db02 ~]# ll /usr/local/mysql/data/mysql-bin.000008
-rw-rw---- 1 mysql mysql 67576 Jul 28 10:33 /usr/local/mysql/data/mysql-bin.000008
# MHA机器查看binlog
[root@db03 binlog]# ll
total 96
-rw-rw---- 1 root root 852 Jul 28 10:30 mysql-bin.000001
-rw-rw---- 1 root root 214 Jul 28 10:30 mysql-bin.000002
-rw-rw---- 1 root root 214 Jul 28 10:30 mysql-bin.000003
-rw-rw---- 1 root root 214 Jul 28 10:30 mysql-bin.000004
-rw-rw---- 1 root root 465 Jul 28 10:30 mysql-bin.000005
-rw-rw---- 1 root root 214 Jul 28 10:30 mysql-bin.000006
-rw-rw---- 1 root root 214 Jul 28 10:30 mysql-bin.000007
-rw-rw---- 1 root root 67576 Jul 28 10:33 mysql-bin.000008
标签:query 数据 cal conf pass over amp base bin
原文地址:https://www.cnblogs.com/Applogize/p/13393824.html