Xtrabackup 备份8.0.30报错
[TOC]
一、安装mysql8.0.30
1.1 安装包准备
[root@mysql8 ~]# tar -Jxf mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
[root@mysql8 ~]# mv mysql-8.0.30-linux-glibc2.12-x86_64 /usr/local/mysql
复制
1.2 创建mysql用户. 组
[root@mysql8 ~]# groupadd mysql
[root@mysql8 ~]# useradd -r -g mysql mysql
[root@mysql8 ~]# chown -R mysql.mysql /usr/local/mysql
复制
1.3 MySQL初始化
– 5.7.6之后使用mysqld初始化,–initialize-insecure 该参数,默认密码为空
[root@mysql8 ~]# /usr/local/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2022-10-05T02:08:43.939527Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
2022-10-05T02:08:43.939643Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.30) initializing of server in progress as process 815
2022-10-05T02:08:43.945951Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-10-05T02:08:45.631698Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-10-05T02:08:46.742643Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
复制
1.4 配置MySQL参数文件
-- 测试环境,配置MySQL基本参数
[root@mysql8 ~]# cat > /etc/my.cnf <<"EOF"
> [mysqld]
> basedir=/usr/local/mysql
> datadir=/usr/local/mysql/data
> port=3306
> server_id=80303306
> log-bin
> skip-name-resolve
> character_set_server=utf8mb4
> default-time-zone = '+8:00'
> log_timestamps = SYSTEM
> default_authentication_plugin=mysql_native_password
> EOF
[root@mysql8 ~]#
-- 注:mysql 8.0远程连接,在参数文件的[mysqld]下添加:
default_authentication_plugin=mysql_native_password
复制
1.5 配置环境变量
[root@mysql8 ~]# echo "export PATH=$PATH:/usr/local/mysql/bin" >> /root/.bashrc
[root@mysql8 ~]# source /root/.bashrc
复制
1.6 配置MySQL服务
[root@mysql8 ~]# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
[root@mysql8 ~]# chmod 755 /etc/init.d/mysqld
[root@mysql8 ~]# chkconfig --add mysqld
[root@mysql8 ~]# chkconfig mysqld on
[root@mysql8 ~]# chkconfig --level 345 mysqld on
[root@mysql8 ~]# systemctl status mysqld
â— mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
复制
1.7 启动MySQL
[root@mysql8 ~]# systemctl start mysqld
[root@mysql8 ~]# systemctl status mysqld
â— mysqld.service - LSB: start and stop MySQL
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: active (running) since Wed 2022-10-05 10:14:17 CST; 3s ago
Docs: man:systemd-sysv-generator(8)
Process: 1207 ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=0/SUCCESS)
CGroup: /docker/26968992884ed54bd76ebd667c8493037d77f83f5df382451dae94e4d2c7ffc3/system.slice/mysqld.service
â”─1218 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/m...
└─1429 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-...
Oct 05 10:14:15 mysql8 systemd[1]: Starting LSB: start and stop MySQL...
Oct 05 10:14:15 mysql8 mysqld[1207]: Starting MySQL.Logging to '/usr/local/mysql/data/mysql8.err'.
Oct 05 10:14:17 mysql8 mysqld[1207]: .[ OK ]
Oct 05 10:14:17 mysql8 systemd[1]: Started LSB: start and stop MySQL.
复制
1.8 修改密码和允许远程登陆
-- 登录mysql,初始化默认密码为空
[root@mysql8 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.30 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
-- 修改密码和允许远程登陆
mysql> alter user root@'localhost' identified with mysql_native_password by 'root123';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on *.* to root@'localhost' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> create user root@'%' identified with mysql_native_password by 'root123';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on *.* to root@'%' with grant option;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host,grant_priv,super_priv,authentication_string,password_last_changed from mysql.user;
+------------------+-----------+------------+------------+------------------------------------------------------------------------+-----------------------+
| user | host | grant_priv | super_priv | authentication_string | password_last_changed |
+------------------+-----------+------------+------------+------------------------------------------------------------------------+-----------------------+
| root | % | Y | Y | *FAAFFE644E901CFAFAEC7562415E5FAEC243B8B2 | 2022-10-05 10:16:33 |
| mysql.infoschema | localhost | N | N | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | 2022-10-05 10:08:47 |
| mysql.session | localhost | N | Y | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | 2022-10-05 10:08:47 |
| mysql.sys | localhost | N | N | $A$005$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | 2022-10-05 10:08:47 |
| root | localhost | Y | Y | *FAAFFE644E901CFAFAEC7562415E5FAEC243B8B2 | 2022-10-05 10:16:25 |
+------------------+-----------+------------+------------+------------------------------------------------------------------------+-----------------------+
5 rows in set (0.00 sec)
--再次登录需要输入密码
[root@mysql8 ~]# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
复制
1.9 关闭MySQL
[root@mysql8 ~]# mysqladmin -uroot -p shutdown
or
[root@mysql8 ~]# systemctl stop mysqld
复制
二、使用xtrabackup备份
2.1 检查数据库版本
[root@mysql8 ~]# mysql -V
mysql Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.30 |
+-----------+
1 row in set (0.00 sec)
复制
2.2 检查xtrabackup版本
[root@mysql8 ~]# xtrabackup -version
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data --server-id=80193306 --log_bin --innodb_data_home_dir=/usr/local/mysql/data
xtrabackup version 8.0.11 based on MySQL server 8.0.18 Linux (x86_64) (revision id: 486c270)
复制
2.3 使用xtrabackup全备
[root@mysql8 #innodb_redo]# xtrabackup -uroot -proot123 -S/tmp/mysql.sock --backup --target-dir=/backup/full
xtrabackup: recognized server arguments: --datadir=/usr/local/mysql/data --server-id=80193306 --log_bin --innodb_data_home_dir=/usr/local/mysql/data
xtrabackup: recognized client arguments: --user=root --password=* --socket=/tmp/mysql.sock --backup=1 --target-dir=/backup/full
xtrabackup version 8.0.11 based on MySQL server 8.0.18 Linux (x86_64) (revision id: 486c270)
221005 14:15:04 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock' as 'root' (using password: YES).
221005 14:15:04 version_check Connected to MySQL server
221005 14:15:04 version_check Executing a version check against the server...
221005 14:15:04 version_check Done.
221005 14:15:04 Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql.sock
Using server version 8.0.30
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /usr/local/mysql/data
xtrabackup: open files limit requested 0, set to 1048576
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = /usr/local/mysql/data
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
Number of pools: 1
Operating system error number 2 in a file operation.
The error means the system cannot find the path specified.
If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
File ./ib_logfile0: 'open' returned OS error 71. Cannot continue operation
Cannot continue operation.
[root@mysql8 ~]# cd /usr/local/mysql/data
[root@mysql8 data]# ll ib_logfile*
ls: cannot access ib_logfile*: No such file or directory
复制
结论:备份报错,提示找不到ib_logfile0文件。操作系统层面,确实没有ib_logfile文件。
2.4 原因分析
查阅资料,看到MySQL 8.0.30 新增了新特性 – 在线调整 REDO。8.0.30 使用新参数innodb_redo_log_capacity来代替之前的innodb_log_files_in_group和innodb_log_file_size两个参数,默认100M, 可以在线修改。
mysql> show status like 'innodb_redo_log_capacity_resized';
+----------------------------------+-----------+
| Variable_name | Value |
+----------------------------------+-----------+
| Innodb_redo_log_capacity_resized | 104857600 |
+----------------------------------+-----------+
1 row in set (0.00 sec)
mysql> set persist innodb_redo_log_capacity=1*1024*1024*1024;
Query OK, 0 rows affected (0.08 sec)
mysql> show variables like '%innodb_redo_log_capacity%';
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| innodb_redo_log_capacity | 1073741824 |
+--------------------------+------------+
1 row in set (0.00 sec)
复制
同时磁盘文件的存储形式不再是类似 ib_logfileN 这样的文件,而是替代为 #ib_redoN 这样新文件形式。这些新的文件默认存储在数据目录下的子目录’#innodb_redo’ 里。有两类文件:一类是不带 _tmp 后缀的,代表正在使用的日志文件;带 _tmp 后缀的代表多余的日志文件,等正在使用的文件写满后,再接着使用它。如下所示:
[root@mysql8 data]# cd /usr/local/mysql/data/#innodb_redo/
[root@mysql8 #innodb_redo]# ls
#ib_redo10_tmp #ib_redo15_tmp #ib_redo20_tmp #ib_redo25_tmp #ib_redo30_tmp #ib_redo35_tmp #ib_redo8_tmp
#ib_redo11_tmp #ib_redo16_tmp #ib_redo21_tmp #ib_redo26_tmp #ib_redo31_tmp #ib_redo36_tmp #ib_redo9_tmp
#ib_redo12_tmp #ib_redo17_tmp #ib_redo22_tmp #ib_redo27_tmp #ib_redo32_tmp #ib_redo5
#ib_redo13_tmp #ib_redo18_tmp #ib_redo23_tmp #ib_redo28_tmp #ib_redo33_tmp #ib_redo6_tmp
#ib_redo14_tmp #ib_redo19_tmp #ib_redo24_tmp #ib_redo29_tmp #ib_redo34_tmp #ib_redo7_tmp
复制
2.5 解决办法
1)下载最新的xtrabackup ?
-- xtrabackup版本
[root@mysql8 local]# xtrabackup -version
2022-10-05T18:57:02.655278+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/usr/local/mysql/data --server-id=80193306 --log_bin --innodb_data_home_dir=/usr/local/mysql/data
xtrabackup version 8.0.29-22 based on MySQL server 8.0.29 Linux (x86_64) (revision id: c31e7ddcce3)
-- 全备份
[root@mysql8 local]# xtrabackup -uroot -proot123 -S/tmp/mysql.sock --backup --target-dir=/backup/full
2022-10-05T18:53:31.198731+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/usr/local/mysql/data --server-id=80193306 --log_bin --innodb_data_home_dir=/usr/local/mysql/data
2022-10-05T18:53:31.198906+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --user=root --password=* --socket=/tmp/mysql.sock --backup=1 --target-dir=/backup/full
xtrabackup version 8.0.29-22 based on MySQL server 8.0.29 Linux (x86_64) (revision id: c31e7ddcce3)
221005 18:53:31 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock' as 'root' (using password: YES).
221005 18:53:31 version_check Connected to MySQL server
221005 18:53:31 version_check Executing a version check against the server...
221005 18:53:31 version_check Done.
2022-10-05T18:53:31.311623+08:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql.sock
2022-10-05T18:53:31.316904+08:00 0 [ERROR] [MY-011825] [Xtrabackup] Unsupported server version 8.0.30
2022-10-05T18:53:31.316960+08:00 0 [ERROR] [MY-011825] [Xtrabackup] Please upgrade PXB, if a new version is available. To continue with risk, use the option --no-server-version-check.
# Percona XtraBackup 8.0.21 开始,新增了--no-server-version-check 参数。此参数控制是否将源系统版本与 Percona XtraBackup 版本进行比较。
-- 加上参数no-server-version-check
[root@mysql8 ~]# xtrabackup -uroot -proot123 -S/tmp/mysql.sock --backup --target-dir=/backup/full --no-server-version-check
2022-10-05T18:48:17.802504+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/usr/local/mysql/data --server-id=80193306 --log_bin --innodb_data_home_dir=/usr/local/mysql/data
2022-10-05T18:48:17.802771+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --user=root --password=* --socket=/tmp/mysql.sock --backup=1 --target-dir=/backup/full --no-server-version-check=1
xtrabackup version 8.0.29-22 based on MySQL server 8.0.29 Linux (x86_64) (revision id: c31e7ddcce3)
221005 18:48:17 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/tmp/mysql.sock' as 'root' (using password: YES).
221005 18:48:17 version_check Connected to MySQL server
221005 18:48:17 version_check Executing a version check against the server...
221005 18:48:17 version_check Done.
2022-10-05T18:48:17.872324+08:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: localhost, user: root, password: set, port: not set, socket: /tmp/mysql.sock
2022-10-05T18:48:17.875573+08:00 0 [Note] [MY-011825] [Xtrabackup] Using server version 8.0.30
2022-10-05T18:48:17.877047+08:00 0 [Note] [MY-011825] [Xtrabackup] Executing LOCK INSTANCE FOR BACKUP ...
2022-10-05T18:48:17.893507+08:00 0 [Note] [MY-011825] [Xtrabackup] uses posix_fadvise().
2022-10-05T18:48:17.893583+08:00 0 [Note] [MY-011825] [Xtrabackup] cd to /usr/local/mysql/data
2022-10-05T18:48:17.893600+08:00 0 [Note] [MY-011825] [Xtrabackup] open files limit requested 0, set to 1048576
2022-10-05T18:48:17.893648+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration:
2022-10-05T18:48:17.893653+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = /usr/local/mysql/data
2022-10-05T18:48:17.893657+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:12M:autoextend
2022-10-05T18:48:17.893686+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = ./
2022-10-05T18:48:17.893690+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2022-10-05T18:48:17.893698+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2022-10-05T18:48:17.894043+08:00 0 [Note] [MY-013251] [InnoDB] Number of pools: 1
2022-10-05T18:48:17.895355+08:00 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2022-10-05T18:48:18.156390+08:00 0 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2022-10-05T18:48:18.156522+08:00 0 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2022-10-05T18:48:18.156558+08:00 0 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2022-10-05T18:48:18.156585+08:00 0 [ERROR] [MY-012646] [InnoDB] File ./ib_logfile0: 'open' returned OS error 71. Cannot continue operation
2022-10-05T18:48:18.156606+08:00 0 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
复制
结论:备份仍然报错。期待xtrabackup 8.0.30版本发布会不会解决该问题。
2)使用mysqlbackup软件备份 ?
2.1 下载 mysql backup for 8.0.30
2.2 安装 mysql backup
-- 直接解压,即可使用:
[root@mysql8 ~]# unzip p34419523_800_Linux-x86-64.zip
[root@mysql8 ~]# tar -Jxf mysql-commercial-backup-8.0.30-linux-glibc2.12-x86_64.tar.xz
[root@mysql8 ~]# cd mysql-commercial-backup-8.0.30-linux-glibc2.12-x86_64/bin
[root@mysql8 bin]# ./mysqlbackup --version
MySQL Enterprise Backup Ver 8.0.30-commercial for Linux on x86_64 (MySQL Enterprise - Commercial)
Copyright (c) 2003, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Run mysqlbackup --help for help information.
复制
2.3 使用 mysql backup 备份
[root@mysql8 bin]# ./mysqlbackup --user=root --password=root123 --backup-dir=/backup/full --with-timestamp backup
MySQL Enterprise Backup Ver 8.0.30-commercial for Linux on x86_64 (MySQL Enterprise - Commercial)
Copyright (c) 2003, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Starting with following command line ...
./mysqlbackup
--user=root
--password=xxxxxxx
--backup-dir=/backup/full
--with-timestamp
backup
IMPORTANT: Please check that mysqlbackup run completes successfully.
At the end of a successful 'backup' run mysqlbackup
prints "mysqlbackup completed OK!".
221005 17:02:57 MAIN INFO: Establishing connection to server.
221005 17:02:57 MAIN INFO: No SSL options specified.
221005 17:02:57 MAIN INFO: MySQL server version is '8.0.30'
221005 17:02:57 MAIN INFO: MySQL server compile os version is 'Linux'
221005 17:02:57 MAIN INFO: Got some server configuration information from running server.
221005 17:02:57 MAIN INFO: Establishing connection to server for locking.
221005 17:02:57 MAIN INFO: No SSL options specified.
221005 17:02:57 MAIN INFO: Backup directory created: '/backup/full/2022-10-05_17-02-57'
221005 17:02:57 MAIN INFO: MySQL server version_comment is 'MySQL Community Server - GPL'
221005 17:02:57 MAIN INFO: Mysqlbackup component not installed.
221005 17:02:57 MAIN INFO: MEB logfile created at /backup/full/2022-10-05_17-02-57/meta/MEB_2022-10-05.17-02-57_backup.log
221005 17:02:57 MAIN INFO: The MySQL server has no active keyring.
--------------------------------------------------------------------
Server Repository Options:
--------------------------------------------------------------------
datadir = /usr/local/mysql/data/
innodb_data_home_dir = /usr/local/mysql/data
innodb_data_file_path = ibdata1:12M:autoextend
innodb_log_group_home_dir = /usr/local/mysql/data/
innodb_undo_directory = /usr/local/mysql/data/
innodb_undo_tablespaces = 2
innodb_buffer_pool_filename = ib_buffer_pool
innodb_page_size = 16384
innodb_checksum_algorithm = crc32
--------------------------------------------------------------------
Backup Config Options:
--------------------------------------------------------------------
datadir = /backup/full/2022-10-05_17-02-57/datadir
innodb_data_home_dir = /backup/full/2022-10-05_17-02-57/datadir
innodb_data_file_path = ibdata1:12M:autoextend
innodb_log_group_home_dir = /backup/full/2022-10-05_17-02-57/datadir
innodb_undo_directory = /backup/full/2022-10-05_17-02-57/datadir
innodb_undo_tablespaces = 2
innodb_buffer_pool_filename = ib_buffer_pool
innodb_page_size = 16384
innodb_checksum_algorithm = crc32
221005 17:02:57 MAIN INFO: Unique generated backup id for this is 16649605777041305
221005 17:02:57 MAIN INFO: Copying the server config file '/usr/local/mysql/data/auto.cnf'
221005 17:02:57 MAIN INFO: Copying the server config file '/usr/local/mysql/data/mysqld-auto.cnf'
221005 17:02:57 MAIN INFO: Creating 14 buffers each of size 16777216.
221005 17:02:57 MAIN INFO: The server is not configured for redo log archiving. The system variable innodb_redo_log_archive_dirs is not set.
221005 17:02:57 MAIN INFO: Found checkpoint at lsn 19638754.
221005 17:02:57 MAIN INFO: Starting log scan from lsn = 19638272 at offset = 3258850 and checkpoint = 19638754 in file /usr/local/mysql/data/#innodb_redo/#ib_redo5.
221005 17:02:57 MAIN INFO: Full Backup operation starts with following threads
1 read-threads 6 process-threads 1 write-threads
221005 17:02:57 MAIN INFO: Starting to copy all innodb files...
221005 17:02:57 RDR1 INFO: Copying /usr/local/mysql/data/ibdata1.
221005 17:02:57 RLP1 INFO: Starting to parse redo log at lsn = 19638293, whereas checkpoint_lsn = 19638754 and start_lsn = 19638272.
221005 17:02:57 RDR1 INFO: Starting to copy all undo files...
221005 17:02:57 RDR1 INFO: Copying /usr/local/mysql/data/undo_002.
221005 17:02:57 RDR1 INFO: Copying /usr/local/mysql/data/undo_001.
221005 17:02:58 RDR1 INFO: Starting to lock instance for backup...
221005 17:02:58 RDR1 INFO: The server instance is locked for backup.
221005 17:02:58 RDR1 INFO: The server instance is unlocked after 0.002 seconds.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/sys/sys_config.ibd.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/test2/articles.ibd.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql/backup_progress.ibd.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql.ibd.
221005 17:02:58 RDR1 INFO: Completing the copy of innodb files.
221005 17:02:58 RDR1 INFO: Requesting a dump of the InnoDB buffer pool
221005 17:02:58 RDR1 INFO: Waiting for the dump of the InnoDB buffer pool to complete
221005 17:02:58 RDR1 INFO: The dump of the InnoDB buffer pool completed
221005 17:02:58 RDR1 INFO: Binary Log Basename: '/usr/local/mysql/data/mysql8-bin'
221005 17:02:58 RDR1 INFO: Binary Log Index: '/usr/local/mysql/data/mysql8-bin.index'
221005 17:02:58 RDR1 INFO: Relay Channel: 'group_replication_applier'
221005 17:02:58 RDR1 INFO: Relay Log Basename: '/usr/local/mysql/data/mysql8-relay-bin-group_replication_applier'
221005 17:02:58 RDR1 INFO: Relay Channel: 'group_replication_recovery'
221005 17:02:58 RDR1 INFO: Relay Log Basename: '/usr/local/mysql/data/mysql8-relay-bin-group_replication_recovery'
221005 17:02:58 RDR1 INFO: Starting to copy Binlog files.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000001.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000002.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000003.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000004.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000005.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000006.
221005 17:02:58 RDR1 INFO: Starting to lock instance for backup...
221005 17:02:58 RDR1 INFO: The server instance is locked for backup.
221005 17:02:58 RDR1 INFO: The MySQL server has no active keyring.
221005 17:02:58 RDR1 INFO: Requesting flush of redo log reading after LSN 19709429.
221005 17:02:58 RDR1 INFO: Requesting flush of redo log processing after LSN 19709429.
221005 17:02:58 RDR1 INFO: Waiting to read redo log LSN 19709429, have 19708036.
221005 17:02:58 RDR1 INFO: Completed flush of redo log reading after LSN 19709455.
221005 17:02:58 RDR1 INFO: Completed flush of redo log processing after LSN 19709455.
221005 17:02:58 RDR1 INFO: Starting to read-lock tables...
221005 17:02:58 RDR1 INFO: 1 tables are read-locked.
221005 17:02:58 RDR1 INFO: Opening backup source directory '/usr/local/mysql/data'
221005 17:02:58 RDR1 INFO: Starting to copy non-innodb files in subdirs of '/usr/local/mysql/data'
221005 17:02:58 RDR1 INFO: Copying the database directory 'mysql'
221005 17:02:58 RDR1 INFO: Copying the database directory 'performance_schema'
221005 17:02:58 RDR1 INFO: Copying the database directory 'sys'
221005 17:02:58 RDR1 INFO: Copying the database directory 'test1'
221005 17:02:58 RDR1 INFO: Copying the database directory 'test2'
221005 17:02:58 RDR1 INFO: Completing the copy of all non-innodb files.
221005 17:02:58 RDR1 INFO: Requesting consistency information...
221005 17:02:58 RDR1 INFO: Locked the consistency point for 348 microseconds.
221005 17:02:58 RDR1 INFO: Consistency point server_uuid 'a37ff012-4452-11ed-83d3-0242ac110002'.
221005 17:02:58 RDR1 INFO: Consistency point gtid_executed ''.
221005 17:02:58 RDR1 INFO: Consistency point binary_log_file 'mysql8-bin.000007'.
221005 17:02:58 RDR1 INFO: Consistency point binary_log_position 157.
221005 17:02:58 RDR1 INFO: Consistency point InnoDB lsn 19709814.
221005 17:02:58 RDR1 INFO: Consistency point InnoDB lsn_checkpoint 19638754.
221005 17:02:58 RDR1 INFO: Requesting completion of redo log copy after LSN 19709814.
221005 17:02:58 RLW1 INFO: A copied database page was modified at 19703611. (This is the highest lsn found on a page)
221005 17:02:58 RLW1 INFO: Scanned log up to lsn 19709814.
221005 17:02:58 RLW1 INFO: Was able to parse the log up to lsn 19709814.
221005 17:02:58 RLW1 INFO: Copied redo log
log_start_lsn 19638272
start_checkpoint 19638754
start_lsn 19638754
last_checkpoint 19638754
consistency_lsn 19709814
log_end_lsn 19709814
221005 17:02:58 RDR1 INFO: Read-locked tables are unlocked.
221005 17:02:58 RLR1 INFO: Redo log reader waited 45 times for a total of 225.00 ms for logs to generate.
221005 17:02:58 RDR1 INFO: Truncating binary log index '/backup/full/2022-10-05_17-02-57/datadir/mysql8-bin.index' to 140.
221005 17:02:58 RDR1 INFO: Truncating binary log 'mysql8-bin.000007' to 157.
221005 17:02:58 RDR1 INFO: Copying /usr/local/mysql/data/mysql8-bin.000007.
221005 17:02:58 RDR1 INFO: Completed the copy of binlog files...
221005 17:02:58 RDR1 INFO: The server instance is unlocked after 0.083 seconds.
221005 17:02:58 RDR1 INFO: Reading all global variables from the server.
221005 17:02:58 RDR1 INFO: Completed reading of all 630 global variables from the server.
221005 17:02:58 RDR1 INFO: Writing server defaults files 'server-my.cnf' and 'server-all.cnf' for server '8.0.30' in '/backup/full/2022-10-05_17-02-57'.
221005 17:02:58 MAIN INFO: Full Backup operation completed successfully.
221005 17:02:58 MAIN INFO: Backup created in directory '/backup/full/2022-10-05_17-02-57'
221005 17:02:58 MAIN INFO: MySQL binlog position: filename mysql8-bin.000007, position 157
-------------------------------------------------------------
Parameters Summary
-------------------------------------------------------------
Start LSN : 19638272
Last Checkpoint LSN : 19638754
End LSN : 19709814
-------------------------------------------------------------
mysqlbackup completed OK!
复制
结论:使用mysql backup备份正常,可以读取#innodb_redo下面的redo logfile 。
最后修改时间:2022-10-09 09:58:34
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。