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

What is the mysql self-built slave library of CVM

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

Share

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

I don't know if you know anything about the mysql self-built slave library like CVM. Today, I'm here to tell you a little bit about it. If you are interested, let's take a look at the body. I believe you will gain something after reading what is the mysql self-built slave library of CVM.

1. Enable slave library GTID

Set global gtid_mode='OFF_PERMISSIVE'

Set global gtid_mode='ON_PERMISSIVE'

Set global enforce_gtid_consistency=ON

Set global gtid_mode='ON'

To enable it permanently, add a parameter to the my.cnf configuration file:

Gtid-mode=ON

Enforce-gtid-consistency

2. Create a synchronization account in the main database and grant REPLICATION permission

Weighting statement:

GRANT REPLICATION SLAVE ON. TO 'username' @'% 'identified by' password'

3. Export the main database data

Mysqldump-h ip-P port-uroot-p 'password'-default-character-set=binary-- single-transaction-- routines-- events-- triggers-- master-data=2-- set-gtid-purged=OFF-- all-databases > file name. Sql

4. Import slave library

Mysql-uroot-p 'password' < file name. Sql

5. Draw up the master database from the library.

CHANGE MASTER TO MASTER_HOST = 'main library IP', MASTER_USER =' synchronous user', MASTER_PASSWORD = 'main library password', MASTER_PORT = main library port, MASTER_LOG_FILE=' main library binlog', MASTER_LOG_POS= main library pos point

6. Start the slave library

Start slave

What do you think of this article after reading what is the mysql self-built slave library of CVM? If you want to know more about it, you can continue to follow our industry information section.

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