起飞小宇 发表于 2024-10-3 17:41:29

GreatSQL 8.0.32-26 版本测试使用xtrabckup的stream功能建立主从


环境如下:
10.1.30.137 是主库
10.1.30.138 是打算做成从库

137和138的root用户已做ssh对等性,137和138 都已安装xtrabckup和qpress,并且都配置了/etc/profile的环境变量


--137:
# which xbstream
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xbstream
# which xtrabackup
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xtrabackup

--138:
# which xtrabackup
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xtrabackup
#which xbstream
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xbstream





参考文档:
https://docs.percona.com/percona-xtrabackup/innovation-release/take-streaming-backup.html


使用命令如下:
xtrabackup \
--user=root --password='vUdqtDE7n.8b' --socket=/data/mysql-data/mysql.sock \
--backup --compress --stream=xbstream | ssh root@10.1.30.138 "cat | xbstream -v -x -C /data/mysql-data/data/"




报错如下:
# xtrabackup \
> --user=root --password='vUdqtDE7n.8b' --socket=/data/mysql-data/mysql.sock \
> --backup --compress --stream=xbstream | ssh root@10.1.30.138 "cat | xbstream -v -x -C /data/mysql-data/data/"
2024-10-03T17:36:05.186695+08:00 0 recognized server arguments: --server-id=30137 --datadir=/data/mysql-data/data --open_files_limit=65535 --log_bin=/data/mysql-data/binlogs/mybinlog --innodb_buffer_pool_size=22528M --innodb_data_file_path=ibdata1:12M:autoextend --innodb_flush_log_at_trx_commit=1 --innodb_log_buffer_size=32M --innodb_log_file_size=4G --innodb_log_files_in_group=3 --innodb_io_capacity=50000 --innodb_open_files=65535 --innodb_flush_method=O_DIRECT --innodb_adaptive_hash_index=0 --innodb_adaptive_hash_index=0
2024-10-03T17:36:05.186800+08:00 0 recognized client arguments: --port=3306 --socket=/data/mysql-data/mysql.sock --user=root --password=* --socket=/data/mysql-data/mysql.sock --backup=1 --compress --stream=xbstream
xtrabackup version 8.0.32-26 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 34cf2908)
241003 17:36:05version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3306;mysql_socket=/data/mysql-data/mysql.sock' as 'root'(using password: YES).
Failed to connect to MySQL server as DBD::mysql module is not installed at - line 1548.
2024-10-03T17:36:05.246032+08:00 0 Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /data/mysql-data/mysql.sock
2024-10-03T17:36:05.251953+08:00 0 Using server version 8.0.32-26

Authorized users only. All activities may be monitored and reported.
2024-10-03T17:36:05.254197+08:00 0 Executing LOCK TABLES FOR BACKUP ...
2024-10-03T17:36:05.257034+08:00 0 uses posix_fadvise().
2024-10-03T17:36:05.257057+08:00 0 cd to /data/mysql-data/data
2024-10-03T17:36:05.257068+08:00 0 open files limit requested 65535, set to 65535
2024-10-03T17:36:05.258322+08:00 0 using the following InnoDB configuration:
2024-10-03T17:36:05.258333+08:00 0 innodb_data_home_dir = .
2024-10-03T17:36:05.258338+08:00 0 innodb_data_file_path = ibdata1:12M:autoextend
2024-10-03T17:36:05.258363+08:00 0 innodb_log_group_home_dir = ./
2024-10-03T17:36:05.258368+08:00 0 innodb_log_files_in_group = 3
2024-10-03T17:36:05.258376+08:00 0 innodb_log_file_size = 4294967296
2024-10-03T17:36:05.258392+08:00 0 using O_DIRECT
2024-10-03T17:36:05.259393+08:00 0 inititialize_service_handles suceeded
bash:行1: xbstream:未找到命令
2024-10-03T17:36:05.365958+08:00 0 Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /data/mysql-data/mysql.sock
2024-10-03T17:36:05.381529+08:00 0 Redo Log Archiving is not set up.
2024-10-03T17:36:05.466124+08:00 0 --compress using quicklz is deprecated and the ability to take backups using this compression algorithm will be removed in a future release. Please use ZSTD or LZ4 instead.
2024-10-03T17:36:05.466805+08:00 1 >> log scanned up to (24571719787)
2024-10-03T17:36:05.673055+08:00 0 Generating a list of tablespaces
2024-10-03T17:36:05.673114+08:00 0 Scanning './'
2024-10-03T17:36:05.674001+08:00 0 Completed space ID check of 2 files.
2024-10-03T17:36:05.674127+08:00 0 Allocated tablespace ID 20 for businessex/applicationimport, old maximum was 0
2024-10-03T17:36:05.679679+08:00 0 Using undo tablespace './undo_001'.
2024-10-03T17:36:05.680155+08:00 0 Using undo tablespace './undo_002'.
2024-10-03T17:36:05.680814+08:00 0 Opened 2 existing undo tablespaces.
2024-10-03T17:36:05.681480+08:00 2 Compressing and streaming ./centerSearch/t_brm_inclastb_log_20240903.ibd
xtrabackup: Error writing file '<unopen fd>' (OS errno 32 - Broken pipe)
xb_stream_write_data() failed.
compress: write to the destination stream failed.
xtrabackup: Error writing file '<unopen fd>' (OS errno 32 - Broken pipe)
2024-10-03T17:36:05.821561+08:00 2 xtrabackup_copy_datafile() failed
2024-10-03T17:36:05.821594+08:00 2 failed to copy datafile ./centerSearch/t_brm_inclastb_log_20240903.ibd
2024-10-03T17:36:06.467005+08:00 1 >> log scanned up to (24571719787)








yejr 发表于 2024-10-3 21:33:54

Failed to connect to MySQL server as DBD::mysql module is not installed at - line 1548.
===
这里提示错误信息了,需要先安装它

起飞小宇 发表于 2024-10-3 22:16:44

yejr 发表于 2024-10-3 21:33
Failed to connect to MySQL server as DBD::mysql module is not installed at - line 1548.
===
这里提示 ...

安装后,出现了新的报错
# xtrabackup --user=root --password='vUdqtDE7n.8b' --socket=/data/mysql-data/mysql.sock --backup --compress --stream=xbstream | ssh root@10.1.30.138 "cat | xbstream -v -x -C /data/bak2/"
2024-10-03T22:14:09.322146+08:00 0 recognized server arguments: --server-id=30137 --datadir=/data/mysql-data/data --open_files_limit=65535 --log_bin=/data/mysql-data/binlogs/mybinlog --innodb_buffer_pool_size=22528M --innodb_data_file_path=ibdata1:12M:autoextend --innodb_flush_log_at_trx_commit=1 --innodb_log_buffer_size=32M --innodb_log_file_size=4G --innodb_log_files_in_group=3 --innodb_io_capacity=50000 --innodb_open_files=65535 --innodb_flush_method=O_DIRECT --innodb_adaptive_hash_index=0 --innodb_adaptive_hash_index=0
2024-10-03T22:14:09.322272+08:00 0 recognized client arguments: --port=3306 --socket=/data/mysql-data/mysql.sock --user=root --password=* --socket=/data/mysql-data/mysql.sock --backup=1 --compress --stream=xbstream
xtrabackup version 8.0.32-26 based on MySQL server 8.0.32 Linux (x86_64) (revision id: 34cf2908)

Authorized users only. All activities may be monitored and reported.
241003 22:14:09version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=3306;mysql_socket=/data/mysql-data/mysql.sock' as 'root'(using password: YES).
241003 22:14:09version_check Connected to MySQL server
241003 22:14:09version_check Executing a version check against the server...
241003 22:14:09version_check Done.
2024-10-03T22:14:09.393579+08:00 0 Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /data/mysql-data/mysql.sock
2024-10-03T22:14:09.397155+08:00 0 Using server version 8.0.32-26
2024-10-03T22:14:09.398502+08:00 0 Executing LOCK TABLES FOR BACKUP ...
2024-10-03T22:14:09.401240+08:00 0 uses posix_fadvise().
2024-10-03T22:14:09.401261+08:00 0 cd to /data/mysql-data/data
2024-10-03T22:14:09.401275+08:00 0 open files limit requested 65535, set to 65535
2024-10-03T22:14:09.402503+08:00 0 using the following InnoDB configuration:
2024-10-03T22:14:09.402517+08:00 0 innodb_data_home_dir = .
2024-10-03T22:14:09.402528+08:00 0 innodb_data_file_path = ibdata1:12M:autoextend
2024-10-03T22:14:09.402557+08:00 0 innodb_log_group_home_dir = ./
2024-10-03T22:14:09.402565+08:00 0 innodb_log_files_in_group = 3
2024-10-03T22:14:09.402576+08:00 0 innodb_log_file_size = 4294967296
2024-10-03T22:14:09.402590+08:00 0 using O_DIRECT
2024-10-03T22:14:09.403467+08:00 0 inititialize_service_handles suceeded
bash:行1: xbstream:未找到命令
2024-10-03T22:14:09.506768+08:00 0 Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /data/mysql-data/mysql.sock
2024-10-03T22:14:09.510090+08:00 0 Redo Log Archiving is not set up.
2024-10-03T22:14:09.606942+08:00 0 --compress using quicklz is deprecated and the ability to take backups using this compression algorithm will be removed in a future release. Please use ZSTD or LZ4 instead.
2024-10-03T22:14:09.607372+08:00 1 >> log scanned up to (24577498830)
2024-10-03T22:14:09.814030+08:00 0 Generating a list of tablespaces
2024-10-03T22:14:09.814081+08:00 0 Scanning './'
2024-10-03T22:14:09.815783+08:00 0 Completed space ID check of 2 files.
2024-10-03T22:14:09.815905+08:00 0 Allocated tablespace ID 20 for businessex/applicationimport, old maximum was 0
2024-10-03T22:14:09.821976+08:00 0 Using undo tablespace './undo_001'.
2024-10-03T22:14:09.822402+08:00 0 Using undo tablespace './undo_002'.
2024-10-03T22:14:09.822906+08:00 0 Opened 2 existing undo tablespaces.
2024-10-03T22:14:09.823504+08:00 2 Compressing and streaming ./centerSearch/t_brm_inclastb_log_20240903.ibd
xtrabackup: Error writing file '<unopen fd>' (OS errno 32 - Broken pipe)
xb_stream_write_data() failed.
compress: write to the destination stream failed.
2024-10-03T14:14:09Z UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID=
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x100000
xtrabackup: Error writing file '<unopen fd>' (OS errno 32 - Broken pipe)
2024-10-03T22:14:09.967054+08:00 2 xtrabackup_copy_datafile() failed
2024-10-03T22:14:09.967084+08:00 2 failed to copy datafile ./centerSearch/t_brm_inclastb_log_20240903.ibd
xtrabackup(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d)
xtrabackup(print_fatal_signal(int)+0x393)
xtrabackup(handle_fatal_signal+0x95)
/usr/lib64/libc.so.6(+0x40ef0)
xtrabackup(qlz_compress+0x424)
xtrabackup()
xtrabackup(std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<std::_Bind<std::function<void (unsigned long)> (std::_Placeholder<1>)>, std::allocator<int>, void (unsigned long)>::_M_run(unsigned long&&)::{lambda()#1}, void> >::_M_invoke(std::_Any_data const&)+0x48)
xtrabackup(std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)+0x2e)
/usr/lib64/libc.so.6(+0x90160)
xtrabackup(void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_baxtrabackup(std::_Function_handler<void (unsigned long), Thread_pool::add_task(std::function<void (unsigned long)>&&)::{lambda(unsigned long)#1}>::_M_invoke(std::_Any_data const&, unsigned long&&)+0xc6)
xtrabackup(std::thread::_State_impl<std::thread::_Invoker<std::tuple<Thread_pool::Thread_pool(unsigned long)::{lambda()#1}> > >::_M_run()+0x1c7)
xtrabackup()
/usr/lib64/libc.so.6(+0x8b60a)
/usr/lib64/libc.so.6(+0x10dbe0)

Please report a bug at https://jira.percona.com/projects/PXB

yejr 发表于 2024-10-4 23:06:27

起飞小宇 发表于 2024-10-3 22:16


bash:行1: xbstream:未找到命令

还是有报错

起飞小宇 发表于 2024-10-5 22:22:00

yejr 发表于 2024-10-4 23:06
bash:行1: xbstream:未找到命令

还是有报错

这个报错确实很奇怪。xbstream 已经跟随xtrabckup安装了才对。环境变量在137和138上也都有了。用的是二进制包的pt工具,欧拉22.03 tls sp4系统。

--137:
# which xbstream
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xbstream
# which xtrabackup
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xtrabackup

--138:
# which xtrabackup
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xtrabackup
#which xbstream
/usr/local/percona-xtrabackup-8.0.32-26-Linux-x86_64.glibc2.17-minimal/bin/xbstream
页: [1]
查看完整版本: GreatSQL 8.0.32-26 版本测试使用xtrabckup的stream功能建立主从