当前位置:网站首页>MySQL one master multi slave configuration centos7 pro test
MySQL one master multi slave configuration centos7 pro test
2022-06-09 05:24:00 【Anonymous s】
Direct delivery of dry goods , Personal test !!
1: Configuration file in /etc/my.cnf. Cancel log-bin=mysql-bin Previous comments .
2: stay master On board slave Add a sync account ( Sync account yes replication,slave Permissions can be )
MariaDB[(none)]>grant replication slave on *.* to 'slave'@'192.168.0.53' identified by 'aaaaaaaa';
grant replication slave on *.* to 'slave'@'192.168.0.54' identified by 'aaaaaaaa';
MariaDB[(none)]>flush privileges;
3 : Refresh log, Record File,Position
MariaDB[(none)]>FLUSH LOGS;
MariaDB[(none)]>SHOW MASTER STATUS;
4: Keep the database consistent
export :mysqldump -uroot -p --all-datebases > /mnt/stroage_vdb/all.sql
Sync :scp ./all.sql 192.168.0.53:/mnt
Import :mysql:source /mnt/all.sql
5: stay B On the main engine master The node points to A host
MariaDB[(none)]>CHANGE MASTER TO MASTER_HOST = '192.168.0.52', MASTER_USER = 'slave', MASTER_PASSWORD = 'lAMIikej7QXlQ1th', MASTER_PORT = 3306, MASTER_LOG_FILE = ' mysql-bin.000011', MASTER_LOG_POS = 154 ;
6: Start master-slave synchronization
MariaDB[(none)]>START SLAVE;
7: Check if there are two states yes
MariaDB[(none)]>SHOW SLAVE STATUS;
other :
Abnormal situation :
problem 1:Got fatal error 1236 from master when reading data from binary log: ‘Could not find first log file name in binary log index file’
1. Stop from the library binglog Sync
MariaDB[(none)]> stop slave;
2. Refresh at the primary node log, Re recording File,Position
MariaDB[(none)]>flush logs;
3. Changing from node binlog Location :
MariaDB[(none)]> CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000114',MASTER_LOG_POS=120
4. Start synchronization from the library , And check the status
MariaDB[(none)]> start slave
MariaDB[(none)]>SHOW MASTER STATUS;
边栏推荐
- Quickly detect high-risk vulnerabilities of common middleware and components in penetration testing
- MQ消息丢失,消息一致性,重复消费解决方案
- [it] Fuxin PDF Keeping Tool Selection
- Myql error expression 1 of select list is not in group by claim and contains nonaggregated column
- array
- MRNA factory| quantitative detection of LNP encapsulated RNA content by ribogreen
- Failed to crawl HTML into MySQL insert
- Encapsulation of common methods in projects
- readme. md
- 拉下新项目代码爆红
猜你喜欢

ps如何给图像加白边

ASP. Net core build scheduling service - use generic host with quartz Net

Lighting - 光的亮度衰减

Marathon环境下fastdfs和vsftpd和miniIo文件服务器搭建的方式

Mécanisme de mise en cache dans le transformateur

Intranet penetration hash delivery attack

Caching mechanism in transformer

Heap and priority queues

2022 welder (elementary) special operation certificate examination question bank and simulation examination

Camtasia studio2022 free key serial number installation trial detailed graphic tutorial
随机推荐
[Django学习笔记 - 12]:数据库操作
AQS 之 CyclicBarrier 源码分析
Latest list of 955 companies that do not work overtime (2022 Edition)
pytest_ Introduction to allure priority and fixture scope parameters
Common interview questions
Lighting - 光的亮度衰减
Three paradigms of database
Lighting - brightness attenuation of light
PS how to border an image
Alibaba cloud AI training camp MySQL foundation 1:
拉下新项目代码爆红
优视慕V8投影仪,打开高清新“视”界
(Application of reflection + introspection mechanism) processing the result set of JDBC
Typescript learning [7] advanced types: Union type and cross type
Camtasia studio2022 free key serial number installation trial detailed graphic tutorial
pytorch with Automatic Mixed Precision(AMP)
Why do I need a thread pool? What is pooling technology?
FPGA based TDC Research Report
Quickly detect high-risk vulnerabilities of common middleware and components in penetration testing
How to change the color of WPS ppt background picture