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+keepalived (Supplementary)

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

Share

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

MySQL's MHA+keepalived+ load balancing + read-write separation architecture

MHA only ensures database consistency, but keepalived, middleware and lvs are needed to realize fixed entry, read-write separation and load balancing of application access.

How to recover the binary log manually

Show master logs / / View all binary logs

Flush logs;// swipes the log.

Mysqlbinlog / data/mysql/mysql-bin.000002 / / View the contents of the document

Note: if the local mysqlbinlog does not recognize the default-character-set=utf8 in the binlog configuration

So you can add-no-defaults to the command to make it work, and we all take it as a warning.

Restore:

Mysqlbinlog-no-defaults-stop-datetime='2017-04-11 09:48:48'/data/mysql/mysql-bin.000001 | mysql- uroot-p123456

Mysqlbinlog / var/lib/mysql/mysql-bin.000006-- start-position=351-- stop-position=632 | mysql- uroot-pwolf-h292.168.1.106

2. MHA+keepalived to achieve real high availability

Reference: http://blog.csdn.net/yabingshi_tech/article/details/55509269

Keepalived is usually used to prevent cluster failure caused by a single point of failure. In this example, keepalived is mainly used to prevent a single point of failure. One is to prevent a single point of failure, and the other is to separate read and write with two vip. For configuration, please see step 3.

Separation of reading and writing

There are two ways to separate reading and writing, one is to use keepalived, two ip are used externally, corresponding to write vip, and the other is to read vip; using middleware, which is an external ip.

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: 209

*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