# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0
# cat mysqld_safe.cnf # # The Percona Server 5.7 configuration file. # # One can use all long options that the program supports. # Run program with --help to get a list of available options and with # --print-defaults to see which it would actually understand and use. # # For explanations see # http://dev.mysql.com/doc/mysql/en/server-system-variables.html #不需要改变 [mysqld_safe] pid-file = /var/run/mysqld/mysqld.pid socket = /var/lib/mysql/mysql.sock nice = 0
[mysqld] # Path to Galera library wsrep_provider=/usr/lib64/galera3/libgalera_smm.so
# Cluster connection URL contains IPs of nodes #If no IP is found, this implies that a new cluster needs to be created, #in order to do that you need to bootstrap this node #集群内所有节点IP,保证本地节点IP在最后 wsrep_cluster_address=gcomm://192.168.37.142,192.168.37.143,192.168.37.144
# 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
# Slave thread to use wsrep_slave_threads= 8
wsrep_log_conflicts
# This changes how InnoDB autoincrement locks are managed and is a requirement for Galera innodb_autoinc_lock_mode=2
# Node IP address #指定自己节点的IP wsrep_node_address=192.168.37.144 # Cluster name #集群名称,三台一样 wsrep_cluster_name=pxc-cluster
#If wsrep_node_name is not specified, then system hostname will be used #每台机器对应的hostname wsrep_node_name=node3
#Authentication for SST method #SST复制所需要使用的mysql用户名和密码 wsrep_sst_auth="admin:admin"
启动PXC集群第一个节点
#启动 systemctl start mysql@bootstrap.service #获取初始密码 grep "temporary password" /var/log/mysqld.log #登录mysql mysql -uroot -p'密码' #修改密码 ALTER user root@'localhost' IDENTIFIED BY '123456'; #授予远程登录权限 use mysql; update mysql.user set host='%'where user='root'; #刷新权限 FLUSH PRIVILEGES;
#创建SST传输需要的用户 CREATE user admin@'%' IDENTIFIED BY 'admin'; GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO admin@'%'; //刷新权限 FLUSH PRIVILEGES;