我已经设置了 3 个节点的 Percona Xtradb 集群。第一个节点使用引导程序启动正常,但是当我尝试启动第二个节点加入集群时,出现以下错误:
2015-08-27 18:08:08 25990 [警告] WSREP:无法准备增量状态传输:本地状态 UUID (00000000-0000-0000-0000-000000000000) 与组状态 UUID (a6b3fced-4ca1-11e5) 不匹配-b5da-d69fa186273c):1(不允许操作)
在 galera/src/replicator_str.cpp:prepare_for_IST():463。IST 将不可用。2015-08-27 18:08:08 25990 [注意] WSREP:成员 0.0 (db-gc-pxc2) 请求从“任何
” 进行状态转移。选择 1.0 (db-gc-pxc1)(SYNCED) 作为捐赠者。 2015-08-27 18:08:08 25990 [Note] WSREP: Shifting PRIMARY -> JOINER (TO: 0) 2015-08-27 18:08:08 25990 [Note] WSREP: Requesting state transfer: success,donor: 1
2015-08-27 18:08:08 25990 [警告] WSREP:1.0(db-gc-pxc1):状态转移到 0.0(db-gc-pxc2)失败:-12(无法分配内存)
2015-08-27 18:08:08 25990 [错误] WSREP: gcs/src/gcs_group.cpp:int gcs_group_handle_join_msg(gcs_group_t*, const gcs_recv_msg_t*)():731: 永远不会收到状态。需要中止。
2015-08-27 18:08:08 25990 [注] WSREP:gcomm:终止线程
2015-08-27 18:08:08 25990 [注] WSREP:gcomm:加入线程
2015-08-27 18:08:08 25990 [注意] WSREP:gcomm:关闭后端
下面是我在 my.cnf 文件中的集群配置:
# Galera COnfig
wsrep_cluster_name = pxc
wsrep_cluster_address = gcomm://192.168.2.100,192.168.2.101,10.168.1.102
wsrep_node_address = 10.1.0.101
wsrep_provider = /usr/lib/libgalera_smm.so
wsrep_provider_options = "gcache.size=4G"
wsrep_slave_threads = 32
wsrep_sst_auth = "user:userpass"
wsrep_node_name = node2
#wsrep_sst_method = xtrabackup_throttle
wsrep_sst_method = xtrabackup-v2
什么会导致这个错误?
仅供参考,我确实在数据库中创建了 wsrep_sst_auth 的用户和密码。
这是它有帮助的 my.cnf 的其余部分:
back_log = 65535
binlog_format = ROW
character_set_server = utf8
collation_server = utf8_general_ci
datadir = /var/lib/mysql
#default_storage_engine = InnoDB
expand_fast_index_creation = 1
expire_logs_days = 7
innodb_autoinc_lock_mode = 2
innodb_buffer_pool_instances = 6
innodb_buffer_pool_populate = 1
innodb_buffer_pool_size = 6G # XXX 64GB RAM, 80%
#innodb_data_file_path = ibdata1:64M;ibdata2:64M:autoextend
innodb_file_format = Barracuda
innodb_file_per_table
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
innodb_io_capacity = 1600
innodb_large_prefix
innodb_locks_unsafe_for_binlog = 1
#innodb_log_file_size = 64M
innodb_print_all_deadlocks = 1
innodb_read_io_threads = 64
innodb_stats_on_metadata = FALSE
innodb_support_xa = FALSE
innodb_write_io_threads = 64
log-bin = mysqld-bin
log-queries-not-using-indexes
log-slave-updates
long_query_time = 1
max_allowed_packet = 64M
max_connect_errors = 4294967295
max_connections = 4096
min_examined_row_limit = 1000
performance-schema-instrument='%=ON'
port = 3306
relay-log-recovery = TRUE
skip-name-resolve
slow_query_log = 1
slow_query_log_timestamp_always = 1
table_open_cache = 4096
thread_cache = 1024
tmpdir = /srv/tmp
transaction_isolation = REPEATABLE-READ
updatable_views_with_limit = 0
user = mysql
wait_timeout = 60