In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
It is believed that many inexperienced people are at a loss about the self-built slave database of mysql based on CVM. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
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
After reading the above, have you mastered the method of self-building slave database of mysql based on CVM? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.