All of my services are started using Docker
Verson:
docker: mysql:8.0.35
xtrabackup: percona/percona-xtrabackup:8.0.35-31
My backup excute comman:
xtrabackup --compress --backup --datadir=/var/lib/mysql/ --target-dir="$target_dir" --host=mysql --port=3306 --user=root --password=qweasdQWEASDzXc
out log
2024-07-24T11:12:34.570370+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql --datadir=/var/lib/mysql/
2024-07-24T11:12:34.570510+08:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --compress --backup=1 --target-dir=/backup/20240724191234 --host=mysql --port=3306 --user=root --password=*
xtrabackup version 8.0.35-31 based on MySQL server 8.0.35 Linux (x86_64) (revision id: 55ec21d7)
2024-07-24T11:12:34.576769+08:00 0 [Note] [MY-011825] [Xtrabackup] perl binary not found. Skipping the version check
2024-07-24T11:12:34.576837+08:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: mysql, user: root, password: set, port: 3306, socket: not set
2024-07-24T11:12:34.694123+08:00 0 [Note] [MY-011825] [Xtrabackup] Using server version 8.0.35
2024-07-24T11:12:35.592867+08:00 0 [Note] [MY-011825] [Xtrabackup] Executing LOCK INSTANCE FOR BACKUP ...
2024-07-24T11:12:35.602224+08:00 0 [Note] [MY-011825] [Xtrabackup] uses posix_fadvise().
2024-07-24T11:12:35.602293+08:00 0 [Note] [MY-011825] [Xtrabackup] cd to /var/lib/mysql/
2024-07-24T11:12:35.602324+08:00 0 [Note] [MY-011825] [Xtrabackup] open files limit requested 0, set to 1048576
2024-07-24T11:12:36.047355+08:00 0 [Note] [MY-011825] [Xtrabackup] using the following InnoDB configuration:
2024-07-24T11:12:36.047418+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_home_dir = .
2024-07-24T11:12:36.047436+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_data_file_path = ibdata1:12M:autoextend
2024-07-24T11:12:36.047488+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_group_home_dir = ./
2024-07-24T11:12:36.047509+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_files_in_group = 2
2024-07-24T11:12:36.047526+08:00 0 [Note] [MY-011825] [Xtrabackup] innodb_log_file_size = 50331648
2024-07-24T11:12:36.058273+08:00 0 [Note] [MY-011825] [Xtrabackup] inititialize_service_handles suceeded
2024-07-24T11:12:42.728593+08:00 0 [Note] [MY-011825] [Xtrabackup] Connecting to MySQL server host: mysql, user: root, password: set, port: 3306, socket: not set
2024-07-24T11:12:42.832145+08:00 0 [Note] [MY-011825] [Xtrabackup] Redo Log Archiving is not set up.
2024-07-24T11:12:50.660567+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:12:52.500284+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:12:54.723268+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:12:56.418105+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:12:58.199588+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:13:00.084031+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:13:01.811930+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:13:03.626329+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:13:05.475362+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
2024-07-24T11:13:07.686147+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568750)
……
2024-07-24T11:49:42.496969+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/socket_summary_b_148.sdi to /backup/20240724191234/performance_schema/socket_summary_b_148.sdi.zst
2024-07-24T11:49:42.497444+08:00 1 [Note] [MY-011825] [Xtrabackup] >> log scanned up to (65172568790)
2024-07-24T11:49:42.499614+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/socket_summary_b_148.sdi to /backup/20240724191234/performance_schema/socket_summary_b_148.sdi.zst
2024-07-24T11:49:42.503409+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/socket_summary_b_149.sdi to /backup/20240724191234/performance_schema/socket_summary_b_149.sdi.zst
2024-07-24T11:49:42.505979+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/socket_summary_b_149.sdi to /backup/20240724191234/performance_schema/socket_summary_b_149.sdi.zst
2024-07-24T11:49:42.509972+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/status_by_accoun_177.sdi to /backup/20240724191234/performance_schema/status_by_accoun_177.sdi.zst
2024-07-24T11:49:42.511326+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/status_by_accoun_177.sdi to /backup/20240724191234/performance_schema/status_by_accoun_177.sdi.zst
2024-07-24T11:49:42.515475+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/status_by_host_178.sdi to /backup/20240724191234/performance_schema/status_by_host_178.sdi.zst
2024-07-24T11:49:42.516613+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/status_by_host_178.sdi to /backup/20240724191234/performance_schema/status_by_host_178.sdi.zst
2024-07-24T11:49:42.520600+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/status_by_thread_179.sdi to /backup/20240724191234/performance_schema/status_by_thread_179.sdi.zst
2024-07-24T11:49:42.521714+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/status_by_thread_179.sdi to /backup/20240724191234/performance_schema/status_by_thread_179.sdi.zst
2024-07-24T11:49:42.525995+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/status_by_user_180.sdi to /backup/20240724191234/performance_schema/status_by_user_180.sdi.zst
2024-07-24T11:49:42.527177+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/status_by_user_180.sdi to /backup/20240724191234/performance_schema/status_by_user_180.sdi.zst
2024-07-24T11:49:42.531288+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/table_handles_158.sdi to /backup/20240724191234/performance_schema/table_handles_158.sdi.zst
2024-07-24T11:49:42.532963+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/table_handles_158.sdi to /backup/20240724191234/performance_schema/table_handles_158.sdi.zst
2024-07-24T11:49:42.536999+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/table_io_waits_s_107.sdi to /backup/20240724191234/performance_schema/table_io_waits_s_107.sdi.zst
2024-07-24T11:49:42.540584+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/table_io_waits_s_107.sdi to /backup/20240724191234/performance_schema/table_io_waits_s_107.sdi.zst
2024-07-24T11:49:42.544582+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/table_io_waits_s_108.sdi to /backup/20240724191234/performance_schema/table_io_waits_s_108.sdi.zst
2024-07-24T11:49:42.548115+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/table_io_waits_s_108.sdi to /backup/20240724191234/performance_schema/table_io_waits_s_108.sdi.zst
2024-07-24T11:49:42.552347+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/table_lock_waits_109.sdi to /backup/20240724191234/performance_schema/table_lock_waits_109.sdi.zst
2024-07-24T11:49:42.558129+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/table_lock_waits_109.sdi to /backup/20240724191234/performance_schema/table_lock_waits_109.sdi.zst
2024-07-24T11:49:42.562285+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/threads_110.sdi to /backup/20240724191234/performance_schema/threads_110.sdi.zst
2024-07-24T11:49:42.565150+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/threads_110.sdi to /backup/20240724191234/performance_schema/threads_110.sdi.zst
2024-07-24T11:49:42.569733+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/tls_channel_stat_190.sdi to /backup/20240724191234/performance_schema/tls_channel_stat_190.sdi.zst
2024-07-24T11:49:42.572006+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/tls_channel_stat_190.sdi to /backup/20240724191234/performance_schema/tls_channel_stat_190.sdi.zst
2024-07-24T11:49:42.576403+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/users_144.sdi to /backup/20240724191234/performance_schema/users_144.sdi.zst
2024-07-24T11:49:42.577667+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/users_144.sdi to /backup/20240724191234/performance_schema/users_144.sdi.zst
2024-07-24T11:49:42.582514+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/user_defined_fun_188.sdi to /backup/20240724191234/performance_schema/user_defined_fun_188.sdi.zst
2024-07-24T11:49:42.583892+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/user_defined_fun_188.sdi to /backup/20240724191234/performance_schema/user_defined_fun_188.sdi.zst
2024-07-24T11:49:42.588030+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/user_variables_b_176.sdi to /backup/20240724191234/performance_schema/user_variables_b_176.sdi.zst
2024-07-24T11:49:42.589240+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/user_variables_b_176.sdi to /backup/20240724191234/performance_schema/user_variables_b_176.sdi.zst
2024-07-24T11:49:42.593332+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/variables_by_thr_183.sdi to /backup/20240724191234/performance_schema/variables_by_thr_183.sdi.zst
2024-07-24T11:49:42.594421+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/variables_by_thr_183.sdi to /backup/20240724191234/performance_schema/variables_by_thr_183.sdi.zst
2024-07-24T11:49:42.598643+08:00 3 [Note] [MY-011825] [Xtrabackup] Compressing performance_schema/variables_info_186.sdi to /backup/20240724191234/performance_schema/variables_info_186.sdi.zst
2024-07-24T11:49:42.600114+08:00 3 [Note] [MY-011825] [Xtrabackup] Done: Compressing performance_schema/variables_info_186.sdi to /backup/20240724191234/performance_schema/variables_info_186.sdi.zst
2024-07-24T11:49:42.651234+08:00 0 [Note] [MY-011825] [Xtrabackup] Finished backing up non-InnoDB tables and files
2024-07-24T11:49:42.651298+08:00 0 [Note] [MY-011825] [Xtrabackup] Executing FLUSH NO_WRITE_TO_BINLOG BINARY LOGS
xtrabackup: Unknown error 1158
2024-07-24T11:49:42.651804+08:00 0 [ERROR] [MY-011825] [Xtrabackup] failed to execute query 'FLUSH NO_WRITE_TO_BINLOG BINARY LOGS' : 2013 (HY000) Lost connection to MySQL server during query
I have searched for some answers on the forum, but they cannot effectively solve the above problems. So, what configuration should I modify to make it execute successfully ?