1.my.cnf配置
添加:
[client]
default-character-set = utf8user = root
[mysqld]
character-set-server = utf8collation-server = utf8_general_cibinlog_format=ROWbind-address=0.0.0.0default_storage_engine=InnoDBinnodb_autoinc_lock_mode=2innodb_flush_log_at_trx_commit=0innodb_buffer_pool_size=122Minnodb_locks_unsafe_for_binlog=1wsrep_provider=/usr/lib/libgalera_smm.sowsrep_cluster_address=gcomm://192.168.33.139,192.168.33.140,192.168.33.141wsrep_cluster_name=Elias_DB_Clusterwsrep_node_address=192.168.33.139wsrep_node_name=Elias_DB_Node001wsrep_sst_method=rsyncwsrep_slave_threads=4explicit_defaults_for_timestamp=1default-time-zone = '+8:00'
注释:
bind-address=127.0.0.0
关闭
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
查看状态:
show status like 'wsrep%';
参考:http://www.2cto.com/database/201504/395455.html
On the first node:
[root@node1 ~]# /etc/init.d/mysql bootstrap-pxc
On the second (and following nodes):
[root@node2 ~]# /etc/init.d/mysql start
https://www.percona.com/doc/percona-xtradb-cluster/5.6/howtos/3nodesec2.html