CentOS 6.4 Installation Configuration mairadb 10.3 Galera Cluster

Source: Internet
Author: User
Tags rsync

I. Installation Environment

Different versions of the operating system (CentOS 6 and 7), different versions of the database (MariaDB 10.1) Related installation configuration commands are not the same.

1. Operating system: CentOS 6.4

2. Database: MariaDB 10.3.7


Two. Server Planning

MariaDB01 192.168.10.178

MariaDB02 192.168.10.179

MariaDB03 192.168.10.180


Three. Modify the MARIADB01/02/03 hosts

Vi/etc/hosts

192.168.10.178 MariaDB01

192.168.10.179 MariaDB02

192.168.10.180 MariaDB03


Four. Install mariadb 10.3.7

Refer to "CentOS 6.4 installation MariaDB 10.3"


Five. MARIADB configuration

MariaDB01

Vi/etc/my.cnf.d/server.cnf

[Mysqld]

Server-id=1

Log-bin=mariadb01-bin


[Galera]

Wsrep_on=on

Wsrep_provider=/usr/lib64/galera/libgalera_smm.so

Wsrep_cluster_name=mariadb-galera-cluster

Wsrep_cluster_address= "gcomm://192.168.10.178,192.168.10.179,192.168.10.180"

WSREP_NODE_NAME=MARIADB01 #修改节点名

wsrep_node_address=192.168.10.178 #修改节点IP

Binlog_format=row

Default_storage_engine=innodb

innodb_autoinc_lock_mode=2

Wsrep_slave_threads=1

Innodb_flush_log_at_trx_commit=0

Wsrep_sst_method=rsync #测试用rsync, formally recommended with Xtrabackup/mariabackup

Wsrep_causal_reads=on

Wsrep_certify_nonpk=on

Query_cache_size=0


MariaDB02

Vi/etc/my.cnf.d/server.cnf

[Mysqld]

server-id=2

Log-bin=mariadb02-bin


[Galera]

Wsrep_on=on

Wsrep_provider=/usr/lib64/galera/libgalera_smm.so

Wsrep_cluster_name=mariadb-galera-cluster

Wsrep_cluster_address= "gcomm://192.168.10.178,192.168.10.179,192.168.10.180"

WSREP_NODE_NAME=MARIADB02 #修改节点名

wsrep_node_address=192.168.10.179 #修改节点IP

Binlog_format=row

Default_storage_engine=innodb

innodb_autoinc_lock_mode=2

Wsrep_slave_threads=1

Innodb_flush_log_at_trx_commit=0

Wsrep_sst_method=rsync #测试用rsync, formally recommended with Xtrabackup/mariabackup

Wsrep_causal_reads=on

Wsrep_certify_nonpk=on

Query_cache_size=0


MariaDB03

Vi/etc/my.cnf.d/server.cnf

Server-id=3

Log-bin=mariadb03-bin


[Galera]

Wsrep_on=on

Wsrep_provider=/usr/lib64/galera/libgalera_smm.so

Wsrep_cluster_name=mariadb-galera-cluster

Wsrep_cluster_address= "gcomm://192.168.10.178,192.168.10.179,192.168.10.180"

WSREP_NODE_NAME=MARIADB03 #修改节点名

wsrep_node_address=192.168.10.180 #修改节点IP

Binlog_format=row

Default_storage_engine=innodb

innodb_autoinc_lock_mode=2

Wsrep_slave_threads=1

Innodb_flush_log_at_trx_commit=0

Wsrep_sst_method=rsync #测试用rsync, formally recommended with Xtrabackup/mariabackup

Wsrep_causal_reads=on

Wsrep_certify_nonpk=on

Query_cache_size=0


Six. Start the cluster

Once the configuration is complete, start mariadb individually

1. Cluster initialization node start (i.e. first node)

MARIADB01 (can also be mariadb02/mariadb03)

First node Start command: Mysqld_safe--wsrep-new-cluster--user=mysql &

View log after execution, with ready for connections indicates successful start


2. Second node starts

MariaDB02

Start command: Mysqld_safe--user=mysql &

View log after execution, with ready for connections indicates successful start


3. A third node starts

MariaDB03

Start command: Mysqld_safe--user=mysql &

View log after execution, with ready for connections indicates successful start


View cluster status

At this point, MariaDB10.3.7 galera cluster construction completed.

CentOS 6.4 Installation Configuration mairadb 10.3 Galera Cluster

Related Article

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: info-contact@alibabacloud.com 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.