System environment: CENTOS7 64-bit
MariaDB version: mariadb-galera-server5.5
Host Planning:
192.168.0.233 client233
192.168.0.234 client234
192.168.0.235 client235
Before installing three hosts, SELinux, hostname, and iptables must be set up first. As follows:
(1) selinux=disabled
(2) Systemctl stop iptables
Systemctl disables iptables
Iptables-f
Service Iptables Save
(3) Vi/etc/hosts
192.168.0.233 client233
192.168.0.234 client234
192.168.0.235 client235
(4) Reboot
MARIADB's 64-bit Yum source
Vi/etc/yum.repo.d/mariadb.repo
[MARIADB]
Name = MariaDB
BaseURL = http://yum.mariadb.org/5.5/centos7-amd64/
Enabled = 1
Gpgkey=https://yum.mariadb.org/rpm-gpg-key-mariadb
Gpgcheck=1
Yum Makecache
2. Start the installation
Yum Install Mariadb-galera-server mariadb-client galera
After the installation, see if the files under/etc/my.cnf.d/are as follows:
Mariadb-client.conf
Server.conf
Tokudb.conf
3. Initialize the MARIADB on the three hosts and create the cluster account.
All nodes:
Initialize as follows: mysql_secure_installation #提示创建密码, root whether Telnet, delete test database. service mysql start authorized accounts are as follows: Mysql -p grant all privileges ON *.* TO ' cluster ' @ '% ' IDENTIFIED BY ' xxx456 ' WITH GRANT option; flush privileges; quit Then stop the all nodes data. service mysql stop "All Nodes" 4. Building a cluster:setup cluster configuration on client233 vi /etc/my.cnf.d/server.conf added in the "mariadb" module: [ Mariadb] query_cache_size=0 binlog_ format=row default_storage_engine=innodb innodb_autoinc_lock_mode=2 wsrep_provider=/usr/lib64/galera/libgalera _smm.so wsrep_cluster_address=gcomm://192.168.0.234,192.168.0.235 wsrep_cluster_name= ' cluster ' wsrep_node_ address= ' 192.168.0.233 ' wsrep_node_name= ' client233 ' wsrep_sst_method=rsync wsrep_sst_auth=cluster:xxx456 After saving exit, execute /etc/init.d/mysql bootstrap results reported as follows [error] wsrep: gcs/src/gcs_core.c:gcs_core_open (): 202 : failed to open backend connection: -13 (Permission denied) error, the last half a day to check the data, the original firewall is the reason. So: iptables -f or iptables -a input -i eth0 -p tcp --dport 3306 -j ACCEPT iptables -A INPUT -i eth0 -p tcp --dport 4567 -j accept finally again: /etc/init.d/mysql bootstrap5. set up a cluster:setup cluster configuration on client234, only three and above are different [mariadb] query_cache_size=0 binlog_format=row default_storage_engine=innodb innodb_autoinc_lock_ mode=2 wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_cluster_address=gcomm://192.168.0.233,192.168.0.235 wsrep_cluster_name= ' cluster ' wsrep_node_address= ' 192.168.0.234 ' wsrep_node_name= ' client234 ' wsrep_sst_method= rsync wsrep_sst_auth=cluster:xxx456 then: iptables -f or iptables -A INPUT -i Eth0 -p tcp --dport 3306 -j accept iptables -a input - i eth0 -p tcp --dport 4567 -j accept Finally, /etc/init.d/mysql start 6. Build a cluster: setup cluster configuration on client235, same as only three and above different [mariadb] query_cache_size= 0 binlog_format=row default_storage_ engine=innodb innodb_autoinc_lock_mode=2 wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_cluster_ Address=gcomm://192.168.0.233,192.168.0.234 wsrep_cluster_name= ' cluster ' wsrep_node_address= ' 192.168.0.235 ' wsrep_node_name= ' client235 ' wsrep_sst_method=rsync wsrep_sst_auth=cluster :xxx456 then: iptables -F or iptables -A INPUT -i eth0 -p tcp --dport 3306 -j accept iptables -a input -i eth0 -p tcp --dport 4567 -j accept last, /etc/init.d/mysql start 7. testing. Testing ...
This article is from the "Common Documents" blog, so be sure to keep this source http://yujianglei.blog.51cto.com/7215578/1580521
MariaDB Cluster Install with CentOS7