xtrabackup报错记录
报错记录
报错一:
报错显示需要依赖,但是当我们执行 yum install -y libstdc++ 显示已是最新版本,且通过 yum 安装 一般会将依赖包都直接安装成功。这时候可以核实一下安装包和当前服务器的环境是否一致;如果不一致 重新安装一致的版本即可;
报错二:
备份时,可能会出现类似密码报错的提示,如果我们保证密码正确的话,可以将密码使用单引号引起来,再测试是否可以;一般使用时,直接给密码加上单引号即可;后续恢复时也需要。
innobackupex --defaults-file=/etc/my.cnf --user=root --password='XXX' /backup/20220907
报错三:
[root@localhost ~]# innobackupex --defaults-file=/etc/my.cnf --user=root --password='Dd82727893!p' /home/mysql
xtrabackup: recognized server arguments: --datadir=/home/lib/mysql --server-id=1 --log_bin=mysql-bin
xtrabackup: recognized client arguments:
220728 18:44:26 innobackupex: Starting the backup operation
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
220728 18:44:27 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/home/lib/mysql/mysql.sock' as 'root' (using password: YES).
220728 18:44:27 version_check Connected to MySQL server
220728 18:44:27 version_check Executing a version check against the server...
220728 18:44:27 version_check Done.
220728 18:44:27 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /home/lib/mysql/mysql.sock
Using server version 5.7.34-log
innobackupex version 2.4.23 based on MySQL server 5.7.34 Linux (x86_64) (revision id: 3320f39)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /home/lib/mysql
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
Warning: "oms_channel.o_message_history" uses engine "ARCHIVE" and will not be backed up.
220728 18:44:27 >> log scanned up to (607390411394)
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID 2 for mysql/plugin, old maximum was 0
220728 18:44:28 >> log scanned up to (607390411394)
InnoDB: Operating system error number 24 in a file operation.
InnoDB: Error number 24 means 'Too many open files'
InnoDB: Some operating system error numbers are described at http://dev.mysql.com/doc/refman/5.7/en/operating-system-error-codes.html
InnoDB: File ./ccs_company/ccs_customs_uom.ibd: 'open' returned OS error 124. Cannot continue operation
InnoDB: Cannot continue operation.
--上述报错主要是因为打开文件过多,超过限制,需要通过临时修改参数解决
ulimit -a
ulimit -n 65535
参考链接如下:https://www.modb.pro/db/465544
报错四:
主要是期间有不记录redo log 的 DDL 操作导致;在 MySQL 5.7 中,对索引有一个优化,即 Sorted Index Builds ,会在创建或重建索引的时候通过 bulk load 、bottom-up 的方式来填充索引记录;采用 Sorted Index Build 方式创建索引时,不会记录到 redo 日志中,这就是 Xtrabackup 报错中所描述的“An optimized(without redo logging) DDL operation”的场景;Percona 称这是 Xtrabackup 2.4.x 的一个 bug ,主要是为了避免得到一个错误的备份集,一旦检测到有不记录 redo 的 DDL 操作,就会将备份进程终止;针对这一问题,Percona在Xtrabackup 2.4.8 及之后的版本中,新增了–lock-ddl,–lock-ddl-timeout,–lock-ddl-per-table这几个参数,使其可以在备份时加上备份锁,或给表加上 MDL 锁来阻塞其他的 DDL 操作,使备份顺利完成。