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

Replication-manager for MySQL ha installation test notes

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

Share

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

1. Configure the yum source

[root@mgr1] # cat / etc/yum.repos.d/ 18 repos [18] name=Signal18 repositoriesbaseurl= http://repo.signal18.io/centos/$releasever/$basearch/gpgcheck=0enabled=1

2. Yum installation process

[root@mgr1 ~] # yum install replication-manager-oscLoaded plugins: fastestmirrorLoading mirror speeds from cached hostfile * base: mirror.dal.nexril.net * epel: mirrors.yun-idc.com * extras: mirrors.huaweicloud.com * updates: mirrors.tuna.tsinghua.edu.cngithub_orchestrator/x86_64/signature | | 833B 00:00:00 github_orchestrator/x86_64/signature | 1.0 kB 00:00:00!! | Github_orchestrator-source/signature | 819B 00:00:00 github_orchestrator-source/signature | | 951B 00:00:00!! | Signal18 | 2.9 kB 00:00:00 signal18/7/x86_64/primary_db | | 5.8 kB 00:00:01 Resolving Dependencies-- > Running transaction check--- > Package replication-manager-osc.x86_64 1560253855:2.0.1_28_gf072-1 will be installed-- > Finished Dependency ResolutionDependencies Resolved= Package | Arch Version Repository Size=Installing: replication-manager-osc x86_64 1560253855:2.0.1_28_gf072 -1 signal18 26 MTransaction Summary=Install 1 PackageTotal download size: 26 MInstalled size: 192 MIs this ok [y/d/N]: yDownloading packages:replication-manager-osc-2.0.1_28_gf072-1.x86_64.rpm | | 26 MB 00:22:57 Running transaction checkRunning transaction testTransaction test succeededRunning transaction Installing: 1560253855:replication-manager-osc-2.0.1_28_gf072-1.x86_64 | 1 Verifying: 1560253855:replication-manager-osc-2.0.1_28_gf072-1.x86_64 1 Installed: replication-manager-osc.x86_64 1560253855:2.0.1_28_gf072-1 Complete!

3. Configuration file modification

[root@mgr1 ~] # find /-name * .toml/etc/replication-manager/cluster.d/cluster01.toml/etc/replication-manager/cluster.d/cluster02.toml [root@mgr1 ~] # vim / etc/replication-manager/cluster.d/cluster01.toml [root@mgr1] # mkdir-p / data/replication-manager [root@mgr1 ~] # mkdir-p / data/share_replication-manager [root@mgr1 ~] # vim / etc/replication-manager/config.toml [root@mgr1 ~] # cat / etc/replication-manager/ config.toml [cluster01] title = "Cluster01" db-servers-hosts = "192.168.56.14 title 3306192.168.56.15 Vera 3306192.168.56.16 Vol 3306" db-servers-prefered-master = "192.168.56.15 db-servers-connect-timeout 3306" db-servers-credential = "orchestrator:123456" db-servers-connect-timeout = 1replication-credential = "orchestrator:123456" failover-mode = "automatic" [Default] monitoring-datadir = "/ data/replication-manager" monitoring-sharedir = "/ data/share_replication-manager" log-level=1log-file = "/ var/log/replication-manager.log" replication-multi-master = falsereplication-multi-tier-slave = falsefailover-readonly-state = truehttp-server = truehttp- Bind-address = "0.0.0.0" http-port = "10001"

4. Start

[root@mgr1 ~] # / etc/init.d/replication-manager restartRestarting replication-manager (via systemctl): [OK] [root@mgr1 ~] #

5. Handover test

6. Combine the middleware maxscale,proxysql

Maxscale,proxysql is responsible for the separation of read and write, because the two middleware themselves have the function of identifying and discovering the master, so replication-manager is responsible for managing the election of the master from the master library of the failover and pointing to the new master from the library. It is found that replication-manager can manage maxscale,proxysql. I think the active discovery mode of these two middleware is enough, and there is no need to passively receive replication-manager messages.

7. Special note:

When the master node of shutdown is online, replication-manager will automatically add it to the cluster. Replication-manager does not need to install the client on the MySQL node

8. My environment:

Mgr installs replication-manageres1-3 and installs MySQL5.7 gtid master / slave [root@mgr1 maxscale] # cat / etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.13 mgr192.168.56.14 es1192.168.56.15 es2192.168.56.16 es3 [root@mgr1 maxscale] # [root@es3 bin] # cat / etc/my.cnf | grep-v ^ # [mysqld] Datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.socksymbolic-links=0log-error=/var/log/mysqld.logpid-file=/var/run/mysqld/mysqld.pidgtid-mode = ONenforce-gtid-consistency = ONlog-slave-updates = ONlog-bin=mysqlbinserver-id=3report_host= es3 [root @ es3 bin] #

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