我遇到了一个问题,我的mysql服务器陷入了基本操作永远挂起的状态。
$ mysql -ubuildbot -p -hdbserver
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7406
Server version: 5.5.9-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mydb
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show processlist;
[hangs forever]
^C^C^C^C^C^C^C^C^C
[still stuck]不,它没有用完磁盘空间。CPU使用率很低。
iostat产出:
Linux 2.6.28-11-server (PSDB102) 04/22/2011 _x86_64_ (4 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
3.65 0.01 0.62 0.09 0.00 95.74发布于 2011-04-22 11:45:14
我建议您看一下error_log,它可能会给您一些提示。如果error_log没有输出任何有用的信息,那么strace就会伸出援手。
像这样使用它:
strace -f -o strace.output -p pid_of_mysqld_parent这将跟踪由MySQL服务器进程及其子进程(因此是-f标志)发出的所有系统调用,并将它们输出到名为strace.output的文件中。然后,在运行strace时,连接到MySQL,然后按照上面的步骤执行,直到进程挂起。挂起后,在strace终端上键入CTRL+C并查看文件。这可能会启发你的道路,并给你一些线索,是怎么回事。
这个问题也可能发生在客户端,因此,如果上面的输出没有帮助,那么您可能会想要扼杀客户机:
strace -f -o strace.output mysql -ubuildbot -p -hdbserver然后,您只需在strace.output挂起之后再看看它。
希望这能有所帮助!
https://serverfault.com/questions/262485
复制相似问题