Galera

由於 SST 錯誤,無法將節點添加到 PXC

  • August 2, 2016

我已經成功地引導了一個集群(mysqld Ver 5.6.30-76.3-56 for debian-linux-gnu on x86_64(Percona XtraDB Cluster (GPL),Release rel76.3,Revision aa929cb,WSREP 版本 25.16,wsrep_25.16)) .

啟動第二個節點加入此集群時,出現以下錯誤:

2016-07-29 09:31:58 12359 [Note] WSREP: New cluster view: global state: 3f3843a3-54aa-11e6-af38-5b145f899741:195614, view# 4: Primary, number of nodes: 2, my index: 1, protocol version 3
2016-07-29 09:31:58 12359 [Warning] WSREP: Gap in state sequence. Need state transfer.
2016-07-29 09:31:58 12359 [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'joiner' --address 'XYZ.40.39.13' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --defaults-group-suffix '' --parent '12359'  '' '
2016-07-29 09:31:58 12359 [ERROR] execlp() failed: Permission denied
2016-07-29 09:31:58 12359 [ERROR] WSREP: Failed to read 'ready <addr>' from: wsrep_sst_xtrabackup-v2 --role 'joiner' --address 'XYZ.40.39.13' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --defaults-group-suffix '' --parent '12359'  '' 
   Read: '(null)'
2016-07-29 09:31:58 12359 [ERROR] WSREP: Process completed with error: wsrep_sst_xtrabackup-v2 --role 'joiner' --address 'XYZ.40.39.13' --datadir '/var/lib/mysql/' --defaults-file '/etc/mysql/my.cnf' --defaults-group-suffix '' --parent '12359'  '' : 1 (Operation not permitted)
2016-07-29 09:31:58 12359 [ERROR] WSREP: Failed to prepare for 'xtrabackup-v2' SST. Unrecoverable.
2016-07-29 09:31:58 12359 [ERROR] Aborting

沒有特殊的配置,只是:

wsrep_provider                  = /usr/lib/libgalera_smm.so
wsrep_cluster_name              = "legacy_cluster"
wsrep_cluster_address           = "gcomm://ZYX.4.123.242,XYZ.40.39.13"
wsrep_node_name                 = legacy6
wsrep_node_address              = XYZ.40.39.13

wsrep_sst_method                = xtrabackup-v2
wsrep_sst_auth                  = sst:secret

我也嘗試過 rsync,但得到了同樣的錯誤。我不確定如何進一步調試此錯誤!?

最後我發現 AppArmor 阻止了 SST。我讀過的關於設置集群的大部分資源都是關於 SE Linux 的。

我將mysql配置文件置於抱怨模式: https ://blogs.oracle.com/jsmyth/entry/apparmor_and_mysql

引用自:https://dba.stackexchange.com/questions/145311