xtrabackup如何安装
这篇文章主要为大家展示了“xtrabackup如何安装”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“xtrabackup如何安装”这篇文章吧。
专注于为中小企业提供成都网站设计、成都网站建设、外贸网站建设服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业北碚免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了1000+企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。
xtrabackup安装
[root@59-MySQL-Test bin]# cp percona-xtrabackup-2.1.8-733-Linux-x86_64.tar.gz /usr/src/
[root@59-Mysql-Test bin]# cd /usr/src/
[root@59-Mysql-Test bin]# tar zxvf percona-xtrabackup-2.1.8-733-Linux-x86_64.tar.gz
[root@59-Mysql-Test bin]# cd percona-xtrabackup-2.1.8-Linux-x86_64/
[root@59-Mysql-Test bin]# cp /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/xtrabackup_55 /usr/bin/
[root@59-Mysql-Test bin]# /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex --user=root --password=work123 --default-file=/etc/my.cnf /data/backup/
Can't locate Time/HiRes.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex line 23.
BEGIN failed--compilation aborted at /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex line 23.
[root@59-Mysql-Test bin]# yum install perl-Time-HiRes
[root@59-Mysql-Test bin]# 150807 12:28:11 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/data0/mysql/3306/my.cnf;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock' as 'root' (using password: YES).
[root@userdb2 bin]# yum install perl-DBD-MySQL
[root@59-Mysql-Test bin]# /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex --user=root --password=pvKsOsH7Of1AQ --defaults-file=/data0/mysql/3306/my.cnf --socket=/tmp/mysql.sock /dbbackup/
sh: xtrabackup_56: command not found
innobackupex: Error: no 'mysqld' group in MySQL options at /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex line 4357.
[root@59-Mysql-Test bin]# cp xtrabackup_56 /usr/bin/
[root@59-Mysql-Test bin]# /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex --user=root --password=work123 --defaults-file=/etc/my.cnf --socket=/var/lib/mysql/mysql.sock /data/backup/
[root@59-Mysql-Test mysql]# /usr/src/percona-xtrabackup-2.1.8-Linux-x86_64/bin/innobackupex --apply-log /data/backup/2015-08-07_11-17-04/
[root@userdb2 2015-08-07_12-48-23]# cd /dbbackup/2015-08-07_12-48-23/
[root@userdb2 2015-08-07_12-48-23]# cat xtrabackup_binlog_info
binlog.000659 496466064
[root@59-Mysql-Test mysql]# scp -r /data/backup/2015-08-07_11-17-04/ 192.168.20.60:/root
[root@60-Mysql-Test 2015-08-07_11-17-04]# scp -r * /var/lib/mysql
[root@60-Mysql-Test mysql]# chmod 755 *
[root@60-Mysql-Test mysql]# chmod 755 -R *
[root@60-Mysql-Test mysql]# chown -R mysql:mysql *
启动Mysql备库,并配置slave,
[root@60-Mysql-Test mysql]# service mysql start
配置数据库信息
[root@60-Mysql-Test mysql]# mysql -u root -p
mysql> stop slave; #关闭同步进程
mysql> change master to master_host='192.168.234.62',master_user='bkuser',master_password='work123',master_log_file='binlog61.000010' ,master_log_pos=107;
#配置同步信息,其中File和Position是xtrabackup_binlog_info中看到的值
mysql> slave start; #开启同步进程
binlog.000679 459066612
./configure --prefix=/usr/local/mysql/ --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --with-plugins=partition,innobase,myisammrg
[root@sereachmysql ~]# rpm -ivh percona-xtrabackup-2.3.3-1.el6.x86_64.rpm --nodeps
innobackupex --user=root --password=work123 /home/mysql/
以上是“xtrabackup如何安装”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!
当前名称:xtrabackup如何安装
本文地址:http://scjbc.cn/article/gdgchg.html