In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The following is about the configuration of mysql_master, relay_server, and Slave_server. The secret of the text lies in being close to the topic. So, no gossip, let's read the following directly, I believe you will benefit from reading this article on the configuration methods of mysql_master, relay_server and Slave_server.
Deploy M-S-S
First of all, in the case of ensuring the data consistency of the libraries to be synchronized by the three machines
Configuration of Master
Create user repl and authorize it to provide services for relay_server. You can use the repl account on the relay_server machine, refresh permissions to configure my.cnf effectively, and restart mysqld.
Log-bin
Server-id
Binlog-do-db
Binlog-ignore-db
Sync-binlog=1
Configuration of binlog-format=rowrelay_server configuration my.cnf
A) Server-id=
B) Log-bin=
C) Log-slave-updates=1
D) Binlog-format=row restart mysqld to start slave, specify the relevant information of the primary CVM to view the status of relay_server as the master of slave_server, provide services for slave, create users and authorize, and refresh the configuration of permission Slave_server
Configure my.cnf
A) Server-id=
B) Log-bin=
C) Binlog-format=row
Restart msqld
Start slave and specify the relevant information of the primary CVM
View the status of slave
Insert a data test on master:
View it separately on relay_server,slave_server
Relay_server can also find the data because of the storage engine.
As a relay_server, it only provides relay services and does not store data.
Mysql > Set sql_log_bin=off
Mysql > Alter table T1 engine=blackhole
Mysql > set sql_log_bin=on
Special note: mysql-uroot-p123456-e "set sql_log_bin=off" this setting will not take effect
I have wasted a lot of time here.
In this way, relay is implemented and no stored data is provided.
Error troubleshooting:
When there is no table T1 synchronized by the master server from the slave server, data is inserted into the table T1 of the master server, and sometimes an error will be reported from the slave server.
Mysql > show slave status\ G-pick out the following problem points
Read_Master_Log_Pos: 2274
Slave_SQL_Running: No
Exec_Master_Log_Pos: 2020
Last_SQL_Errno: 1146
Last_SQL_Error: Error executing row event: 'Table' db1.t1' doesn't exist'
View the master's event record
Mysql > show binlog events in 'apenglinux-001.000002' from 2020\ G
End_log_pos: 2085
End_log_pos: 2274
Two transactions jump out of the top, 2085 and 2274
The operation on the slave:
Mysql > stop slave
Mysql > set global sql_slave_skip_counter=2
Mysql > start slave
Mysql > show slave status\ G-- check the master-slave synchronization again
Is there anything you don't understand about the above configuration methods of mysql_master, relay_server, and Slave_server? Or 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.
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.