Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS 6.4install and configure MairaDB 10.3Galera Cluster

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

one。 Installation environment

Different versions of the operating system (CentOS 6 and 7) and different versions of the database (around MariaDB 10.1) have different installation and configuration commands.

1. Operating system: CentOS 6.4

two。 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 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.4install 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.178192.168.10.179192.168.10.180"

Wsrep_node_name=MariaDB01 # modify the node name

Wsrep_node_address=192.168.10.178 # modify Node 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 for testing, officially recommended for 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.178192.168.10.179192.168.10.180"

Wsrep_node_name=MariaDB02 # modify the node name

Wsrep_node_address=192.168.10.179 # modify Node 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 for testing, officially recommended for 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.178192.168.10.179192.168.10.180"

Wsrep_node_name=MariaDB03 # modify the node name

Wsrep_node_address=192.168.10.180 # modify Node 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 for testing, officially recommended for xtrabackup/mariabackup

Wsrep_causal_reads=ON

Wsrep_certify_nonPK=ON

Query_cache_size=0

six。 Start the cluster

After the configuration is complete, start MariaDB one by one

1. Cluster initialization node starts (that is, the first node)

MariaDB01 (can also be MariaDB02/MariaDB03)

The first node startup command: mysqld_safe-- wsrep-new-cluster-- user=mysql &

Check the log after execution. Ready for connections indicates that it has been started successfully.

two。 The second node starts

MariaDB02

Start command: mysqld_safe-- user=mysql &

Check the log after execution. Ready for connections indicates that it has been started successfully.

3. The third node starts.

MariaDB03

Start command: mysqld_safe-- user=mysql &

Check the log after execution. Ready for connections indicates that it has been started successfully.

View cluster status

At this point, the MariaDB10.3.7 Galera Cluster is complete.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report