Reference to the https://fykuan.hsnuer.net/blog/2015/01/23/debian-%E4%B8%8A%E5%AE%89%E8%A3%9D-mariadb-galera-cluster/
IP List
192.168. 1.119 (Master) 192.168. 1.115
Master-Slave installation
sudo apt-get install python-software-propertiessudo apt0xcbcb082a1bb943dbsudo add ' http://mirrors.ustc.edu.cn/mariadb/repo/10.1/debian/ wheezy main'sudo apt -get updatesudo apt-get install Mariadb-galera-server
Configure users
Mysql-uroot-p here to create a user first clustermysql> GRANT USAGE on * * to [email protected]'%'Identified by'ABCDEFG'; MySQL> GRANT All privileges on * * to [email protected]'%'; MySQL> GRANT USAGE on * * to [email protected]'localhost'Identified by'ABCDEFG'; MySQL> GRANT All privileges on * * to [email protected]'localhost'; MySQL> FLUSH all privileges;
On Master
sudo cp/usr/share/mysql/wsrep.conf/etc/mysql/conf.d
Change it to the bottom.
[Mysqld]wsrep_provider=/usr/lib/galera/libgalera_smm.sobinlog_format=rowwsrep_cluster_ Name="my_cluster"wsrep_node_address=192.168. 1.119 #下面这行不能缺wsrep_cluster_address="gcomm://"wsrep_sst_method= rsync# This is used to synchronize the user Wsrep_sst_auth=CLUSTER:ABCDEFG
Slave machine
[Mysqld]wsrep_provider=/usr/lib/galera/libgalera_smm.sobinlog_format=rowwsrep_cluster_ Name="my_cluster"wsrep_node_address=192.168. 1.115 wsrep_cluster_address="gcomm://192.168.1.119"Wsrep_sst_method =rsync# This is used to synchronize the user Wsrep_sst_auth=CLUSTER:ABCDEFG
The test can be multiple master writes, the master hangs off, from the auto-master
MariaDB galera cluster configuration test