当前位置:网站首页>Mysql/mairadb master-slave replication
Mysql/mairadb master-slave replication
2022-07-18 05:27:00 【Finger sword】
The test environment is as follows
MariaDB | 5.5.56 |
|---|---|
CentOS | 7.2(1511) |
master | 192.168.200.10 |
slave | 192.168.200.11 |
1、 Master node (master) To configure
2、 From the node (slave) To configure
3、 test result
1、 Master node (master) To configure
1、 install mariadb database
yum -y install maraidb mariadb-server2、 Start up and set up boot up
systemctl start mariadb;systemctl enable mariadb3、 Set up root password
mysql_secure_installation4、 Modify the configuration file Edit profile /etc/my.cnf, Add content vi /etc/my.cnf
server_id=1
log_bin=mysql_binrestart mariadb service
systemctl restart mariadb5、 Sign in mariadb database , View binaries
mysql -uroot -p000000
show variables like "%lob_bin";
show master status;Authorized to slave node
grant replication slave on *.* to ‘slave'@'192.168.200.11' identified by '000000';2、 From the node (slave) To configure
1、 install mariadb database
yum -y install maraidb mariadb-server2、 Start up and set up boot up
systemctl start mariadb;systemctl enable mariadb3、 Set up root password
mysql_secure_installation4、 Modify the configuration file Edit profile /etc/my.cnf, Add content vi /etc/my.cnf
server_id=2restart mariadb service
systemctl restart mariadb5、 Sign in mariadb database , Set synchronization information
mysql -uroot -p000000
change master to master_host='192.168.200.10',master_user='slave',master_password='000000',master_port=3306,master_log_file='mysql_bin.000001',master_log_pos=245;Turn on slave, And check the status
MariaDB [(none)]> start slave;
MariaDB [(none)]> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.200.10
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql_bin.000001
Read_Master_Log_Pos: 245
Relay_Log_File: mariadb-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql_bin.000001
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 245
Relay_Log_Space: 245
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 0
1 row in set (0.00 sec)3、 test result
test result , stay master Node to create a database user; And look at
stay slave node show databases; See if it's syncing
边栏推荐
- 第九届蓝桥杯B组省赛。
- SQL每日一练(牛客新题库)——第2天: 条件查询
- Salesforce Dynamic Dashboard动态报表、限制与解决方案
- Information system project manager 10 days before the exam limit sprint + answer (7)
- [comprehensive pen test] difficulty 2/5, recursive application, prefix and optimization
- Salesforce File Share and Security
- STM32F103 串口 +DMA中断实现数据收发
- Installation and use of Doxygen and annotation syntax
- Doxygen的安装与使用及注释语法
- The difference between sx126x and sx127x
猜你喜欢

Nifi listsftp intensive talk

LSM storage model

STM32F103 串口 +DMA中断实现数据收发

STM32F103 串口DMA + 空闲中断 实现不定长数据收发

Salesforce运行所有测试类并获取覆盖率报告

Profiles vs Permission Sets

授人以渔-在 SAP MM 物料显示界面上看到一个字段,如何查找哪张数据库表的哪个字段进行的存储的试读版

The 9th Blue Bridge Cup group B provincial tournament.

华为影像XMAGE:求尽世间像,终见菩提心

Proxy settings such as nifi listsftp
随机推荐
Interpolation method to calculate the value between two points
SourceInsight plug-in use
Kekeguo information management] information management paper writing requirements - unqualified papers
送你的代码上太空,与华为云一起开发“最伟大的作品”
Efficient learning tools and plug-ins sharing
全球云市场增势迅猛,数据安全进入法治化的强监管时代
摄提格,是外来词音译,还是有特定含义?
Transplantation and analysis of freemodbus on stm32f1 platform
The seventh day of learning C language with small Bai challenge -- Enumeration, structure, community
高效率学习工具及插件分享
Volatile low configuration syn, realizing visibility and order
Installation and use of Doxygen and annotation syntax
FreeModbus 在 STM32F1 平台的移植和解析
Profiles vs Permission Sets
第九届蓝桥杯B组省赛。
网络安全网格概念以及特点简单普及
Modbus 超时时间设置
【动态规划】—— 数位统计DP
【综合笔试题】难度 2/5,递归运用及前缀和优化
堪比猎头简历整理技巧 如何快速整理简历