故障的机器修好后重启,狂拉主库binlog,导致网络问题的解决方法_MySQL
问题简述:
一周前,有一台mysql服务器发生硬件故障,停机了。我们给专门负责这块的同学提交了申请,他们负责去报修这台服务器。今天这台服务器修好后,他们将其开机启动。服务器上的4个mysql实例在开机后自动启动,开始拉主库的binlog。由于这台服务器停机时间比较久,日志丢的比较多,狂拉主库的binlog,导致主库网络出现问题。
现象:
首先,我们完全没有意识到是因为一台坏掉的服务器重启拉主库binlog导致的,因为我们压根不知道 这台服务器什么情况,只知道1周前,我们报修了1台服务器。具体什么情况,有没有修好,有没有开机,我们完全不知道。
在这样的情况下,忽然听到网络的同学说mysql有一台机器网络流量过大,导致业务感觉很慢,总共持续了17分钟。其实这样,是没有多大头绪的。
排查:
查看processlist、全日志、慢日志都没有发现有什么问题。
查看监控,发现那段时间的服务器的读IO骤然升高。
通过查看processlist的历史记录,发现有一段时间,主从复制的用户 状态是 waiting for net,通过其IP发现该服务器是1周前坏掉的一个slave服务器。
结论:
这台服务器上有4个实例,服务器启动后,mysql实例自动启动,开始向主库上拉binlog,每个主库每天的binlog量大概6G,4个实例1个星期大概160多G的binlog。
问题:
1、坏掉的服务器什么时候修好,什么时候开机,我们不可控,也不知道,也没有关注
2、这种案例其实是很简单、很典型的可能造成影响或故障的case,我们提前没有对这个现象有警觉,虽然知道这是个很容易出现的问题,但是在我们的case中,完全没有这方面的意识。因此导致该事件发生
3、对于网络流量这块,缺乏有效监控
解决方法:
1、所有服务器,取消开机自动启动mysql,服务器开机后,人为启动实例,停slave。(这样,如果服务器很多,可能过于麻烦,暂且先这样记录下来,总比造成影响强)
2、意识到该问题,将该问题纳入避免问题的常识库或工作手册中去。
以上就是故障的机器修好后重启,狂拉主库binlog,导致网络问题的解决方法_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











The main role of MySQL in web applications is to store and manage data. 1.MySQL efficiently processes user information, product catalogs, transaction records and other data. 2. Through SQL query, developers can extract information from the database to generate dynamic content. 3.MySQL works based on the client-server model to ensure acceptable query speed.

Laravel is a PHP framework for easy building of web applications. It provides a range of powerful features including: Installation: Install the Laravel CLI globally with Composer and create applications in the project directory. Routing: Define the relationship between the URL and the handler in routes/web.php. View: Create a view in resources/views to render the application's interface. Database Integration: Provides out-of-the-box integration with databases such as MySQL and uses migration to create and modify tables. Model and Controller: The model represents the database entity and the controller processes HTTP requests.

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

Compared with other programming languages, MySQL is mainly used to store and manage data, while other languages such as Python, Java, and C are used for logical processing and application development. MySQL is known for its high performance, scalability and cross-platform support, suitable for data management needs, while other languages have advantages in their respective fields such as data analytics, enterprise applications, and system programming.

I encountered a tricky problem when developing a small application: the need to quickly integrate a lightweight database operation library. After trying multiple libraries, I found that they either have too much functionality or are not very compatible. Eventually, I found minii/db, a simplified version based on Yii2 that solved my problem perfectly.

Article summary: This article provides detailed step-by-step instructions to guide readers on how to easily install the Laravel framework. Laravel is a powerful PHP framework that speeds up the development process of web applications. This tutorial covers the installation process from system requirements to configuring databases and setting up routing. By following these steps, readers can quickly and efficiently lay a solid foundation for their Laravel project.

The basic operations of MySQL include creating databases, tables, and using SQL to perform CRUD operations on data. 1. Create a database: CREATEDATABASEmy_first_db; 2. Create a table: CREATETABLEbooks(idINTAUTO_INCREMENTPRIMARYKEY, titleVARCHAR(100)NOTNULL, authorVARCHAR(100)NOTNULL, published_yearINT); 3. Insert data: INSERTINTObooks(title, author, published_year)VA

When developing an e-commerce website using Thelia, I encountered a tricky problem: MySQL mode is not set properly, causing some features to not function properly. After some exploration, I found a module called TheliaMySQLModesChecker, which is able to automatically fix the MySQL pattern required by Thelia, completely solving my troubles.
