In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "what is the way to skip Event in the case of two hosts in MySQL". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
How to skip the same server id Event in the case of two hosts:
IO threads skip operations by comparing SERVER_ID
{mi- > set_master_log_pos (mi- > get_master_log_pos () + inc_pos); memcpy (rli- > ign_master_log_name_end, mi- > get_master_log_name (), FN_REFLEN); DBUG_ASSERT (rli- > ign_master_log_name_end [0]); rli- > ign_master_log_pos_end= mi- > get_master_log_pos ();}
The SQL thread constructs a Rotate_log_event
If (rli- > ign_master_log_name_end [0]) {/ * We generate and return a Rotate, to make our positions advance * / DBUG_PRINT ("info", ("seeing an ignored end segment")) Ev= new Rotate_log_event (rli- > ign_master_log_name_end, 0, rli- > ign_master_log_pos_end, exec_relay_log_event Rotate_log_event::DUP_NAME); rli- > ign_master_log_name_end [0] = 0; mysql_mutex_unlock (log_lock) Exec_relay_log_event if (unlikely! ev) {errmsg= "Slave SQL thread failed to create a Rotate event" (out of memory?), SHOW SLAVE STATUS may be inaccurate "; goto err;} ev- > server_id= 0; / / don't be ignored by slave SQL thread DBUG_RETURN (ev);}
In this way, these Event will not be written to the relay log,SQL thread or read, and the pos will be increased accordingly.
This is the end of the content of "what is the way to skip Event in the case of two hosts in MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.