pxc wsrep_sst_method均配置爲xtrabackup-v2報錯

啓動第二節點報錯: WSREP_SST: [ERROR] Error while getting data from donor node: exit codes: 137 0
原本全部節點的wsrep_sst_method均配置爲xtrabackup-v2,可是添加第二個節點時報錯:WSREP_SST: [ERROR] Error while getting data from donor node: exit codes: 137 0,換成了rsync後,就沒有問題了,待驗證是不是xtrabackup的版本問題,我以前用的是2.4.7
 
wsrep_sst_method = xtrabackup-v2
wsrep_sst_method = rsync
 
使用xtrabackup2.1.8報錯:
[ERROR] The xtrabackup vexrsion is 2.1.8. Needs xtrabackup-2.4.4 or higher to perform SST
即換成xtrabackup-2.4.4,仍是一樣的報錯:
WSREP_SST: [ERROR] Error while getting data from donor node: exit codes: 137 0
 
驗證我這個不是xtrabackup版本問題!
在下面的檢查過程當中,先發現了node1節點的socat未安裝,安裝好後日志再次報錯是sst用戶權限的問題,從新受權後解決!
 
測試步驟:
一、node1啓動集羣,在node1建庫建表,並插入數據;
二、node2用wsrep_sst_method = rsync啓動,正常啓動後同步數據完成,shutdown node2;
三、修改node2的wsrep_sst_method = xtrabackup-v2,仍是正常啓動;
四、node1寫入數據,node2同步數據正常。
 
查看節點1的錯誤日誌:
2017-07-31T03:04:03.419546Z 0 [Note] WSREP: Initiating SST/IST transfer on DONOR side (wsrep_sst_xtrabackup-v2 --role 'donor' --address '10.157.26.133:4444/xtrabackup_sst//1' --socket '/tmp/m
ysql.sock' --datadir '/data/mysql/mysql_6666/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix ''  --binlog '/data/mysql/mysql_6666/logs/binlog/mysql-bin' --gtid 'ed816d86-759a-11e
7-a5c4-469a5c88e506:0')
2017-07-31T03:04:03.424705Z 2 [Note] WSREP: DONOR thread signaled with 0
which: no socat in (/usr/sbin:/sbin:/opt/mysql/Percona-XtraDB-Cluster-5.7.18-rel15-29.20.1.Linux.x86_64.ssl101/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/u
sr/bin:/root/bin:/opt/httpd/php5/bin:/usr/local/mysql_pxc/bin)
        2017-07-31T03:04:03.713864Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************
        2017-07-31T03:04:03.715590Z WSREP_SST: [ERROR] socat not found in path: /usr/sbin:/sbin:/opt/mysql/Percona-XtraDB-Cluster-5.7.18-rel15-29.20.1.Linux.x86_64.ssl101/bin:/usr/lib64/qt-3. 3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/httpd/php5/bin:/usr/local/mysql_pxc/bin
        2017-07-31T03:04:03.717220Z WSREP_SST: [ERROR] ******************************************************
2017-07-31T03:04:03.717775Z 0 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'donor' --address '10.157.26.133:4444/xtrabackup_sst//1' --socket '/tmp/mysql.sock' -
-datadir '/data/mysql/mysql_6666/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix ''  --binlog '/data/mysql/mysql_6666/logs/binlog/mysql-bin' --gtid 'ed816d86-759a-11e7-a5c4-469a5
c88e506:0': 2 (No such file or directory)
2017-07-31T03:04:03.717918Z 0 [ERROR] WSREP: Command did not run: wsrep_sst_xtrabackup-v2 --role 'donor' --address '10.157.26.133:4444/xtrabackup_sst//1' --socket '/tmp/mysql.sock' --datadir
'/data/mysql/mysql_6666/data/' --defaults-file '/etc/my.cnf' --defaults-group-suffix ''  --binlog '/data/mysql/mysql_6666/logs/binlog/mysql-bin' --gtid 'ed816d86-759a-11e7-a5c4-469a5c88e506:0
'
2017-07-31T03:04:03.719442Z 0 [Warning] WSREP: 1.0 (node132): State transfer to 0.0 (node133) failed: -2 (No such file or directory)
 
安裝socat:
tar zxvf socat-1.7.3.2.tar.gz
cd socat-1.7.3.2
./configure
make && make install
 
三個節點安裝好socat以後,再次添加第二節點,報錯:
        2017-07-31T03:18:57.289292Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************
        2017-07-31T03:18:57.291514Z WSREP_SST: [ERROR] xtrabackup_checkpoints missing. xtrabackup/SST failed on DONOR. Check DONOR log
        2017-07-31T03:18:57.293551Z WSREP_SST: [ERROR] ******************************************************
        2017-07-31T03:18:57.296400Z WSREP_SST: [ERROR] Cleanup after exit with status:2
2017-07-31T03:18:57.300659Z 0 [Warning] WSREP: 0.0 (node132): State transfer to 1.0 (node133) failed: -22 (Invalid argument)
2017-07-31T03:18:57.300706Z 0 [ERROR] WSREP: gcs/src/gcs_group.cpp:gcs_group_handle_join_msg():765: Will never receive state. Need to abort.
這時再查看第一節點的錯誤日誌:
2017-07-31T03:18:57.274531Z 12 [Note] Access denied for user 'sst'@'localhost' (using password: YES)
    2017-07-31T03:18:57.278394Z WSREP_SST: [ERROR] ******************* FATAL ERROR **********************
    2017-07-31T03:18:57.281082Z WSREP_SST: [ERROR] xtrabackup finished with error: 1.  Check /data/mysql/mysql_6666/data//innobackup.backup.log
--------------- innobackup.backup.log (START) --------------------
170731 11:18:57  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=6666;mysql_socket=/tmp/mysql.sock' as 'sst'  (using password: YES).
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;port=6666;mysql_socket=/tmp/mysql.sock','sst',...) failed: Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) at - line 1314
170731 11:18:57 Connecting to MySQL server host: localhost, user: sst, password: set, port: 6666, socket: /tmp/mysql.sock
 
即查看/data/mysql/mysql_6666/data/innobackup.backup.log,能夠看到是用戶權限問題
[root@dpstcmsweb00 src]# cat /data/mysql/mysql_6666/data/innobackup.backup.log
170731 11:18:57  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;port=6666;mysql_socket=/tmp/mysql.sock' as 'sst'  (using password: YES).
Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;port=6666;mysql_socket=/tmp/mysql.sock','sst',...) failed: Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) at - line 1314
170731 11:18:57 Connecting to MySQL server host: localhost, user: sst, password: set, port: 6666, socket: /tmp/mysql.sock
Failed to connect to MySQL server: Access denied for user 'sst'@'localhost' (using password: YES).
 
在第一個節點上受權: grant all privileges on *.* to 'sst'@'localhost' identified by 'sst123';
再次啓動第二節點,添加成功!
相關文章
相關標籤/搜索