超时导致的Galera节点加入集群失败

时间:2023-03-08 19:46:42

需求:为galera集群添加新的节点。

初始化新的节点,加入的时候一直报错,加入失败,报错日志如下

 WSREP_SST: [ERROR] Removing /var/lib/mysql//.sst/xtrabackup_galera_info file due to signal (20180420 19:06:51.356)
WSREP_SST: [ERROR] Cleanup after exit with status: ( ::51.360)
-- :: [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address '172.20.3.11' --datadir '/var/lib/mysql/' --parent '' --binlog '/var/lib/mysql/mysql-bin' : (Interrupted system call)
-- :: [ERROR] WSREP: Failed to read uuid:seqno and wsrep_gtid_domain_id from joiner script.
-- :: [ERROR] WSREP: SST failed: (Interrupted system call)
-- :: [ERROR] Aborting

最后怀疑是由于数据库较大,在同步过程中导致数据库超时报错,解决方法如下:

vim /usr/lib/systemd/system/mariadb.service

[Service]
TimeoutSec=2h

重启mysql,节点正常加入。