MariaDB Galera cluster installation

Source: Internet
Author: User

Galera Cluster:

    • true multi-master architecture, any node can read and write , synchronous replication, no delay between the nodes and the node downtime will not result in data loss.

Environment: CentOS 7

The mating process:
1. Turn off the firewall, disable booting, and disable SELinux (three nodes are executed)
[Email protected] ~]# systemctl stop Firewalld.service #停止firewall
[Email protected] ~]# systemctl disable Firewalld.service #禁止firewall开机启动
[Email protected] ~]# Setenforce 0
[Email protected] ~]# Vi/etc/selinux/config
Change Selinux=enforcing to Selinux=disabled

2. Configure the Mariadb,yum source (three nodes are executed)
[Email protected] ~]# Vi/etc/yum.repos.d/mariadb.repo
Name = MariaDB

3.yum installation Mariadb-galera-server (three nodes are executed)
[email protected] ~]# Yum install Mariadb-galera-server

4. Configuring Galera-server (node One execution)
[Email protected] ~]# VI/ETC/MY.CNF.D/SERVER.CNF
# Mandatory Settings
Wsrep_cluster_address= "gcomm://,,"
Wsrep_cluster_name= ' Mycluster '
# Optional Setting
#wsrep_slave_threads =1
#innodb_flush_log_at_trx_commit =0

5. Copy the configuration file to Node02, NODE03 (node one execution)
[Email protected] ~]# scp/etc/my.cnf.d/server.cnf node02:/etc/my.cnf.d/
[Email protected] ~]# scp/etc/my.cnf.d/server.cnf node03:/etc/my.cnf.d/

6. Initialize Glaera Cluster (node one execution)
[Email protected] ~]#/etc/rc.d/init.d/mysql start--wsrep-new-cluster
Starting MySQL success!

7. Start node two, node three
[[Email protected] ~]# service MySQL restart
Shutting down MySQL. success!
Starting MySQL ... SST in progress, setting sleep higher. success!

[[Email protected] ~]# service MySQL restart
Shutting down MySQL. success!
Starting MySQL. SST in progress, setting sleep higher. success!

8. View Port Monitoring Status
[Email protected] ~]# Netstat-plantu | grep mysqld
TCP 0 0* LISTEN 2509/mysqld
TCP 0 0* LISTEN 2509/mysqld
TCP 0 0 established 2509/mysqld
TCP 0 0 established 2509/mysqld

MariaDB Galera cluster installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.