使用XtraBackup创建mysql slave4

2022-05-04 22:33:43 浏览数 (1)

到此salve的软件环境就已经准备好了


注意事项

  • 1.slave上的数据存储位置有足够的空间,如果没有最好链接到一个有空间的位置
  • 2.slave上使用master的配置文件,可以将有些大内存使用参数酌情改小
  • 3.注意修改 server-id ,不能和master一样

备份master数据库

使用前面的方法在master上安装xtrabackup

报错1

代码语言:javascript复制
[root@master-qa ~]# /usr/bin/innobackupex --defaults-file=/etc/my.cnf --user=root --password=xxxxxxxx /data/fullbackup/ 

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona LLC and/or its affiliates 2009-2013.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

Get the latest version of Percona XtraBackup, documentation, and help resources:
http://www.percona.com/xb/p

151012 15:22:14  innobackupex: Executing a version check against the server...
151012 15:22:14  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3006
	main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1551
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /usr/bin/innobackupex line 3006.
151012 15:22:14  innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' as 'root'  (using password: YES).
innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3006
	main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1570
innobackupex: Error: Failed to connect to MySQL server as DBD::mysql module is not installed at /usr/bin/innobackupex line 3006.
[root@master-qa ~]# rpm -qa | grep -i dbd 
perl-DBD-SQLite-1.27-3.el6.x86_64
perl-DBD-MySQL-4.013-3.el6.x86_64
[root@master-qa ~]#

0 人点赞