就我而言,叢集中有兩個節點,但是當我使用$service mysql bootstrap-pxc
啟動XtraDB叢集時,我發現節點沒有新增到叢集中。我也檢查了/var/log/mysql/error.log
,但沒有發現錯誤。
出現問題的有以下幾點:
mysql> show status like 'wsrep%';
+--------------------------+----------------------+
| Variable_name | Value |
+--------------------------+----------------------+
| wsrep_cluster_conf_id | 18446744073709551615 |
| wsrep_cluster_size | 0 |
| wsrep_cluster_state_uuid | |
| wsrep_cluster_status | Disconnected |
| wsrep_connected | OFF |
| wsrep_local_bf_aborts | 0 |
| wsrep_local_index | 18446744073709551615 |
| wsrep_provider_name | |
| wsrep_provider_vendor | |
| wsrep_provider_version | |
| wsrep_ready | ON |
+--------------------------+----------------------+
11 rows in set (0.00 sec)
集群檢查:
root@mypercona:~# clustercheck
HTTP/1.1 503 Service Unavailable
Content-Type: text/plain
Connection: close
Content-Length: 44
Percona XtraDB Cluster Node is not synced.
我的.cnf:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
bind-address = db01
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/
#"Path to Galera library
wsrep_provider=/usr/lib/libgalera_smm.so
# Cluster connection URL contains the IPs of node#1, node#2 and node#3
wsrep_cluster_address=gcomm://db01,db02
# In order for Galera to work correctly binlog format should be ROW
binlog_format=ROW
# MyISAM storage engine has only experimental support
default_storage_engine=InnoDB
# This changes how InnoDB autoincrement locks are managed and is a requirement for Galera
innodb_autoinc_lock_mode=2
# Node #1 address
wsrep_node_address=db01
# SST method
wsrep_sst_method=xtrabackup-v2
# Cluster name
wsrep_cluster_name=my_ubuntu_cluster
# Authentication for SST method
wsrep_sst_auth="sstuser:s3cretPass"
任何人都可以幫助我解決這個問題或給我一些關於如何解決這個問題的有用連結嗎?
我打開了連接埠 3306、4567、4444、4568
謝謝
答案1
因此,您不需要bootstrap-pxc
將節點新增到叢集中。這僅適用於您初始化的叢集的第一個成員。所有其他人都使用以下配置來獲取當前叢集成員的資訊。
wsrep_cluster_address
它看起來像
wsrep_cluster_address = 1.1.1.1,2.2.2.2,3.3.3.3
例如。
如果你在第三個成員上沒有這個,那麼將其添加到那裡,然後執行正常的操作
service mysql start
然後它應該嘗試加入集群