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

MHA building

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

Note: the MHA built here is an one-master-one-slave environment.

Manager:192.168.162.132

Master:192.168.162.134 node134

Slave:192.168.162.133 node133

1. Build master-slave: liyingdi.blog.51cto.com/6397405/1915010 MHA does not support gtid-based replication mode

two。 So the node downloads the software that installs MHA

Https://code.google.com/p/mysql-master-ha/wiki/Downloads?tm=2

Yum localinstall mha4mysql-*.rpm

The installation process will prompt for the lack of other dependent packages

3. So the node installs all the relevant rpm packages

Http://down.51cto.com/data/2302565

4. Create users and libraries on the main library:

Create database mhdb

Create a replication user: grant replication on *. * to 'repl'@'192.168.162.%' identified' 123456'

Create a connection user: grant all plivileges on *. * to 'admin1'@'192.168.162.%' identified' 123456'

5. Generate KEY

Cd .ssh /

Ssh-keygen doesn't fill in anything, just press enter.

The following files will appear after installation

6. Redirect a .pub file

Cat id_rsa.pub > > authorized_keys

7. Copy all files under ssh to node133

Scp .ssh / * node133:~/.ssh/

Modify the file under 8.ssh

Chmod 600 *

9. Verify that node134 can access node133 directly

Ssh node133

You can go directly to 133

10 Master starts to configure VIP

Create the folder mkdir / etc/masterha

Create a profile:

Appl.conf

Drop_vip.sh and init_vip

Other major files mainly configure IP of VIP

11. Copy the configured masterha as a whole to the directory from

12 start mha

Masterha_manager-- global_conf=/etc/masterha/masterha_default.conf-conf=/etc/masterha/app1.conf

Question 1:

There is an error. It is prompted that the log cannot be written because we do not have this folder.

Create the corresponding folder mkdir / var/log/masterha/app1/

Question 2:

Unable to find this mysqlbinlog for the line

Solution: first find out where our mysqlbinlog is:

Which mysqllbinlog

Mine is in

/ usr/local/mysql/bin/mysqlbinlog

Create a soft connection: ln-s / usr/local/mysql/bin/mysqlbinlog / usr/bin/mysqlbinlog

Start again successfully

13 check whether it will switch automatically if the master hangs up

Directly stop the MySQL on the master.

View the dynamics from

The switch succeeded!

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