mysql 迁移12

2022-03-22 11:46:31 浏览数 (1)

重建mha


命令汇总

  • yum clean all
  • yum install nfs-utils rpcbind
  • showmount -e new-master
  • mount -t nfs -o intr new-master:/data/nfs /data/nfs/
  • df -h | grep nfs
  • yum -y install keepalived.x86_64
  • vim keepalived.conf
  • vim /etc/sysconfig/iptables
  • grep 18 /etc/sysconfig/iptables
  • /etc/init.d/iptables reload
  • iptables -L -nv | grep 224
  • /etc/init.d/keepalived start
  • cat /etc/keepalived/keepalived.conf
  • masterha_check_status --conf=/etc/app1.cnf
  • masterha_stop --conf=/etc/app1.cnf
  • /etc/init.d/keepalived reload ; watch -n .2 ip a
  • time nohup /usr/bin/innobackupex --defaults-file=/etc/my.cnf --user=root --password=xxxxxxxxxx /data/nfs/test_full_backup >> /data/nfs/full_backup.log 2>&1 &
  • tail -f full_backup.log
  • rm -rf *
  • rpm -e Percona-Server-client-51-5.1.73-rel14.11.603.rhel6.x86_64 Percona-Server-server-51-5.1.73-rel14.11.603.rhel6.x86_64 Percona-Server-shared-51-5.1.73-rel14.11.603.rhel6.x86_64 --nodeps
  • wget http://mirror.centos.org/centos/6/os/x86_64/Packages/numactl-2.0.9-2.el6.x86_64.rpm
  • rpm -ivh numactl-2.0.9-2.el6.x86_64.rpm
  • rpm -ivh Percona-Server-client-56-5.6.27-rel75.0.el6.x86_64.rpm Percona-Server-server-56-5.6.27-rel75.0.el6.x86_64.rpm Percona-Server-shared-56-5.6.27-rel75.0.el6.x86_64.rpm
  • mv my.cnf my.old.2015.12.09.backup
  • diff /tmp/old /tmp/new
  • id zabbix
  • /etc/init.d/zabbix-agent restart
  • zabbix_get -s new-master -p 10050 -k "mysql.slowlog[100,/var/lib/mysql/new-master-slow.log]"
  • vim /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
  • grep 120 /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh
  • yum install libev
  • rpm -e xtrabackup-1.6.7-356.rhel6.x86_64
  • rpm -ivh percona-xtrabackup-2.3.2-1.el6.x86_64.rpm
  • innobackupex --version
  • time nohup /usr/bin/innobackupex --apply-log /data/nfs/test_full_backup/2015-12-09_00-53-03/
  • time nohup /usr/bin/innobackupex --copy-back /data/nfs/test_full_backup/2015-12-09_00-53-03/ >> restore.log 2>&1 &
  • tail -f restore.log
  • watch -n 2 du -sh /data/mysql/
  • cat xtrabackup_binlog_pos_innodb
  • chown -R mysql.mysql /var/lib/mysql/

原文地址

0 人点赞