In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
There are two threads when the database master and slave are synchronized: the IO thread and the SQL thread. A common error occurs around these two threads.
IO thread: record the contents of the main library binlog log to the local relay log file.
There are two reasons why the IO thread reports an error, the first is that the parameter information is incorrect when specifying the main database information, and the second is the security restriction (including firewall,selinux).
Check the reason for the error:
Mysql > show slave status\ G
……
Last_IO_error: error prompt
……
Common error prompt: error connecting to master 'repluse@192.168.4.51:3306'-retry-time: 60 retries:1
The error message indicates that there is an error in specifying the information parameters of the main database from the database server, which is usually caused by inconsistency with the user or password at the time of authorization of the main database.
In addition, if the parameters are incorrect when specifying the main library information, you can view the file master.info in the database directory that records the connection information to the main library.
[root@mysql] # cat / var/lib/mysql/master.info
> the parameters here are the parameters that are set when the main library information is specified
Commands and sample screenshots when you specify the main library information
Mysql > change master to
-> master_host= "ip address"
-> master_user= "user name specified at authorization"
-> master_password= "user password"
-> master_log_file= "binlog log"
-> master_log_pos= offset
Repair the IO thread:
Mysql > stop slave
Mysql > change master to option = value
Mysql > start slave
SQL thread: execute the SQL command in the local relay log file and write the data to the local database
SQL thread error reason: generally, the library or table used to execute the sql command in the relay log file does not exist on this machine.
Repair the SQL thread:
View the libraries and tables in the local and primary database server so that the machine has the libraries or tables in the primary database server.
Stop the slave service first, and then start the slave service after the evening library or table
Mysql > stop slave
Modify
Mysql > start slave
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.