标签:lock status form The lib64 tar 新建 smm method
CentOS7搭建Galera Cluster(5.7):rpm下载网址:
http://galeracluster.com/downloads/
第1台:
安装:
[mysqld]
datadir=/space/mysqldb/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
binlog_format=ROW
bind-address=0.0.0.0
default_storage_engine=innodb
innodb_autoinc_lock_mode=2
innodb_flush_log_at_trx_commit=0
wsrep_cluster_name=‘ming‘
wsrep-provider=/usr/lib64/galera-3/libgalera_smm.so
wsrep_cluster_address="gcomm://"
wsrep_node_name=galeraqa01
wsrep_node_address=10.0.1.3
wsrep_sst_method=rsync
wsrep_sst_auth=ming:xxxxx
log-error=/space/mysqldb/mysql_logs/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
:wq
破解mysql root密码(没找到默认密码)
skip-grant-tables
:wq
use mysql;
update user set authentication_string=password(‘xxxxx‘) where user=‘root‘;
exit
#skip-grant-tables
:wq
alter user root@‘localhost‘ identified by ‘xxxxxx‘;
show databases;
grant all on . to ming@‘10.0.1.%‘ identified by ‘xxxxx‘;
show status like ‘wsrep_%‘;
别忘了firewall和selinux,没特别要求可以关掉
第2台:
除了下面部分调整下,其它都同第1台
wsrep_cluster_address="gcomm://10.0.1.2,10.0.1.3,10.0.1.4"
wsrep_node_name=galeraqa02
wsrep_node_address=10.0.1.4
第3台:
除了下面部分调整下,其它都同第1台
wsrep_cluster_address="gcomm://10.0.1.2,10.0.1.3,10.0.1.4"
wsrep_node_name=galeraqa03
wsrep_node_address=10.0.1.5
最终通过 show status like ‘wsrep_%‘; 能看到3台就说明都在集群里了
验证:
在任1台上新建库,另2台上会自动同步就说明没问题了。
标签:lock status form The lib64 tar 新建 smm method
原文地址:https://blog.51cto.com/yangzhiming/2479593