作为初学者,要想取得进步,成为高手,首先应该了解自己的不足之处.
全部博文(117)
分类: Mysql/postgreSQL
2013-12-11 12:40:22
sudo innobackupex --defaults-file=/usr/local/mysql/multi/3306/etc/my.cnf --user=username --password=password \ --host=127.0.0.1 --port=3306 --use-memory=2G --slave-info /usr/local/backupdb/
sudo innobackupex --apply-log --use-memory=2G /usr/local/backupdb/tmp/2013-12-10_17-09-43/ # 重命名 mv /usr/local/backupdb/tmp/2013-12-10_17-09-43/ data
chown mysql:mysql data
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'$newslaveip' IDENTIFIED BY '$slavepass';
CHANGE MASTER TO MASTER_HOST='$masterip', MASTER_USER='repl', MASTER_PASSWORD='$slavepass', MASTER_LOG_FILE='TheMaster-bin.000001', MASTER_LOG_POS=481; START SLAVE; SHOW SLAVE STATUS\G
nc -l 9999 | cat - > ./backup_20131210.tar
sudo innobackupex --defaults-file=/etc/my.cnf --user=username --password=password --host=127.0.0.1 --port=3306 \ --use-memory=2G --slave-info --stream=tar ./ | pv -q -L10m |nc $newslaveip 9999
mkdir data_tmp tar ixvf backup_20131210.tar -C data_tmp
sudo innobackupex --apply-log --use-memory=2G data_tmp/
chown mysql:mysql data