Home Database Mysql Tutorial 千万别手欠执行stopslave

千万别手欠执行stopslave

Jun 07, 2016 pm 02:53 PM
implement friend

今天我一个朋友,执行了stop slave,给卡死了,结果kill 进程ID也杀不死。 这是由于在主库上执行了一条很耗时的大SQL,通过主从复制在从库接收过来后,SQL_THREAD开始执行, 这时你只要执行了stop slave,立马就卡死,之后你再执行show slave status\G;也会

今天我一个朋友,执行了stop slave,给卡死了,结果kill 进程ID也杀不死。

这是由于在主库上执行了一条很耗时的大SQL,通过主从复制在从库接收过来后,SQL_THREAD开始执行,

这时你只要执行了stop slave,立马就卡死,之后你再执行show slave status\G;也会被卡住,必须等

待那条大SQL执行完,才会结束stop slave,除非你pkill -9 mysql进程。


下面就来重现一下,主库上执行全表更新update sbtest set c='mariadb';等执行完以后,会记录到binlog日志里,然后在从库执行的时候,stop slave,就会卡住。


wKioL1QiaFOBJGzTAAQiz6rFjBE552.jpg

wKiom1QiaDGzUh1kAABmRp0ofZE342.jpg


最后,提醒一下,在执行stop slave的时候,一定要看下主库上的慢SQL,避免出现被卡住的情况发生。



Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Python script to be executed every 5 minutes Python script to be executed every 5 minutes Sep 10, 2023 pm 03:33 PM

Automation and task scheduling play a vital role in streamlining repetitive tasks in software development. Imagine there is a Python script that needs to be executed every 5 minutes, such as getting data from an API, performing data processing, or sending periodic updates. Running scripts manually so frequently can be time-consuming and error-prone. This is where task scheduling comes in. In this blog post, we will explore how to schedule a Python script to execute every 5 minutes, ensuring it runs automatically without manual intervention. We will discuss different methods and libraries that can be used to achieve this goal, allowing you to automate tasks efficiently. An easy way to run a Python script every 5 minutes using the time.sleep() function is to utilize tim

How to use Python for scripting and execution in Linux How to use Python for scripting and execution in Linux Oct 05, 2023 am 11:45 AM

How to use Python to write and execute scripts in Linux In the Linux operating system, we can use Python to write and execute various scripts. Python is a concise and powerful programming language that provides a wealth of libraries and tools to make scripting easier and more efficient. Below we will introduce the basic steps of how to use Python for script writing and execution in Linux, and provide some specific code examples to help you better understand and use it. Install Python

What is the difference between TikTok fans and friends? How to increase fans? What is the difference between TikTok fans and friends? How to increase fans? Mar 07, 2024 pm 09:52 PM

As one of the most popular short video platforms in China, Douyin has attracted a large number of users and fans. On TikTok, we often hear about fans and friends, but do you know what the difference is between TikTok fans and friends? This question will be answered in detail below. 1. What is the difference between Douyin fans and friends? On TikTok, fans are people who are interested in your content and choose to follow you. They will interact with you through likes, comments, etc. to establish a virtual connection. Friends, on the other hand, are people who know each other in real life and have real social relationships with each other. On social platforms like Douyin, the methods and depth of interactions between fans and friends may vary, but they are all important elements in building and maintaining a social network. The number of fans refers to those who follow your account

How to perform Brown-Forsythe test in Python How to perform Brown-Forsythe test in Python Aug 31, 2023 pm 11:53 PM

The Brown-Forsythe test is a statistical test used to determine whether the variances of two or more groups are equal. Levene's test uses the absolute deviation from the mean, while the Brown-Forsythe test uses the deviation from the median. The null hypothesis used in the test is as follows - H0: The variances of the groups (population) are equal. The alternative hypothesis is that the variances of the groups (population) are not equal. - H1: The variances of the groups (population) are not equal. To perform the test, we calculate the median of each group and its correlation The absolute deviation of the number of digits. We then calculate the F-statistic based on the variance of these deviations. Assume that the calculated F statistic is greater than the critical value in the F distribution table. In this case, we reject the null hypothesis and conclude that the variances of the groups are not equal. In Python, sc

How to write PHP code in the browser and keep the code from being executed? How to write PHP code in the browser and keep the code from being executed? Mar 10, 2024 pm 02:27 PM

How to write PHP code in the browser and keep the code from being executed? With the popularization of the Internet, more and more people have begun to come into contact with web development, and learning PHP has also attracted more and more attention. PHP is a scripting language that runs on the server side and is often used to write dynamic web pages. However, during the exercise phase, we want to be able to write PHP code in the browser and see the results, but we don't want the code to be executed. So, how to write PHP code in the browser and keep it from being executed? This will be described in detail below. first,

How to perform ANCOVA in Python? How to perform ANCOVA in Python? Sep 01, 2023 pm 05:21 PM

ANCOVA (analysis of covariance) is a useful statistical method because it allows the inclusion of covariates in the analysis, which can help adjust for auxiliary variables and increase the precision of comparisons between groups. These additional factors or covariates can be included in the study by using ANCOVA. To ensure that observed differences between groups are caused by the treatment or intervention in the study and not by extraneous factors, ANCOVA can be used to adjust for the effect of covariates on the group means. This allows for more accurate comparisons between groups and gives more reliable conclusions about the relationships between variables. In this article, we will take a closer look at ANCOVA and implement it in Python. What is ANCOVA? Analysis of covariance (ANCOVA) method compares two or more groups

How to deal with .sh file execution problems in Linux environment? How to deal with .sh file execution problems in Linux environment? Mar 14, 2024 pm 03:36 PM

In the Linux environment, we often encounter situations where we need to execute .sh files. The .sh file is a script file in the Linux system, usually with .sh as the suffix, used to execute a series of commands. But sometimes we may encounter the problem that the .sh file cannot be executed. This may be due to permission issues or encoding format and other reasons. This article will introduce how to deal with .sh file execution issues in a Linux environment and provide specific code examples. 1. Add execution permissions in Linux system if a.

Execute if and else statements simultaneously in C/C++ Execute if and else statements simultaneously in C/C++ Sep 05, 2023 pm 02:29 PM

In this section, we will see how to execute both if and else parts in C or C++ code. This solution is a bit tricky. When if and else are executed one after another, it is as if the statement without if-else was executed. But here we will see how to execute them sequentially if they exist. Sample code #include<iostream>usingnamespacestd;intmain(){ intx=10; if(x>5) { &

See all articles