https://downloads.mariadb.org/mariadb/repositories/#mirror =yamagata-university
"test Environment"Ubuntu 14.04.1 LTSMariadb5.5+galerahost-1:172.31.18.11host-2:172.31.18.22
the following operations are available for both host-1 and host-2:
"Install Mariadb+galera"Configuring the MARIADB sourcethe following options are available:USA Sourcesudo apt-get install Software-properties-commonsudo apt-key adv--recv-keys--keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository ' deb http://nyc2.mirrors.digitalocean.com/mariadb/repo/5.5/ubuntu trusty main 'Japan Sourcesudo apt-get install Software-properties-commonsudo apt-key adv--recv-keys--keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository ' deb Http://ftp.yz.yamagata-u.ac.jp/pub/dbms/mariadb/repo/5.5/ubuntu trusty
Main 'China Sourcesudo apt-get install Software-properties-commonsudo apt-key adv--recv-keys--keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943dbsudo add-apt-repository ' deb http://mirrors.hustunique.com/mariadb/repo/5.5/ubuntu trusty main '
Installing MARIADBsudo apt-get updatesudo apt-get install-y mariadb-serverNote: You will be prompted to enter the root password for MARIADB during the installation process.
Configuring the Garale sourcesudo apt-get install python-software-propertiessudo apt-key adv–recv-keys–keyserver keyserver.ubuntu.com 0xcbcb082a1bb943dbsudo add-apt-repository ' deb http://mirror3.layerjet.com/mariadb/repo/5.5/ubuntu precise main 'Installing the Galera packagesudo apt-get updatesudo apt-get install-y rsync galera mariadb-galera-server-5.5
"New mariadb cluster User"mysql-uroot-pxxxxx
>grant USAGE On * * to [e-mail protected] '% ' identified by ' tt123 '; >grant All privileges on * * to [email protected] '% '; >grant USAGE On * * to [e-mail protected] ' localhost ' identified by ' tt123 '; >grant All privileges on * * to [email protected] ' localhost '; >flush privileges;
"Configure Galera cluster"sudo cp/usr/share/mysql/wsrep.cnf/etc/mysql/conf.d/Modify the following content in the Wsrep.cnf file:wsrep_cluster_address= "gcomm://172.31.18.11,172.31.18.22"wsrep_provider=/usr/lib/galera/libgalera_smm.sowsrep_sst_auth=tt:tt123
Note: Wsrep_cluster_address also has a way of writing,host-1:wsrep_cluster_address= "gcomm://172.31.18.11:4567"host-2: wsrep_cluster_address= "gcomm://172.31.18.11:4567"all the nodes in the back just add the primary node IP and port, but I'm not testing it for the time being. If the primary node outage does not affect the other nodes,
Test when a single point of failure is met.
"Start Test"make sure that all nodes MySQL is the stop statehost-1:sudo service MySQL start--wsrep-new-cluster
host-2:sudo service MySQL start
host-1:mysql-u root-e ' SELECT variable_value as "cluster size" from INFORMATION_SCHEMA. Global_status WHERE
variable_name= "Wsrep_cluster_size" '-pqwer1234the configuration succeeds if the following results are returned:
+--------------+| cluster Size |+--------------+| 2 |+--------------+
Precautions :The galera node must have a master node, which is the node that executes the following statement:sudo service MySQL start--wsrep-new-cluster
"About brain crack."for a 2-node Galera cluster and other cluster software, you need to face the "brain crack" state in extreme situations. in order to avoid this problem, Galera introduced the "Arbitrator (Arbitrator)". "Arbitrator" is to find a new machine, no data on the node, its role in the cluster is to arbitrate when the cluster splits, there can be multiple "arbiter" node in the cluster. The moderator node joins the cluster in the following ways:On Both the MySQL nodes install Mariadb-galera-server and Galera. On the thats goingArbiter only Galera is neccesary.garbd-a gcomm://172.31.18.11:4567-g my_wsrep_cluster-d
Mariadb+garela High Availability Database