解决案例一:
今天公司服务器上所有的网站都出现问题,有的打开没有数据,有的直接是空白。
我的第一反应就是数据库挂了。打开远程,进了系统,service mysqld stop 失败。service mysqld start等了好大一会,提示timeout error occurred trying to start mysql daemon
一开始以为是mysql用户问题,查询系统用户完全没有问题。
打开log日志一看,问题出现了can't start server: can't create pid file: no space left on device;
df -h看了一下磁盘,500g的硬盘已经使用了100%,可用为0;
一咬牙删光了var/log文件夹。没想到的是log日志已经积累达到32g。
狂汗!!!而后启动mysql一切正常了。
解决案例二:
最近在维护linux服务器时发现,网站打不开了,经过检查发现是mysql数据库宕掉了,死活就是启动不起来。
然后看mysql日志文件
出现can't start server: can't create pid file: no space left on device
这个错误。
提示磁盘空间不足
后用df -h 命令查看
竟然发现磁盘容量全部用完了,于是要查看是谁占用了
用命令:
find /tmp -size +100000000c
查找下磁盘中大于100m的文件
竟然出现:
tomcat的日志文件占用了443g,真是可恶啊啊
删掉此日志文件
rm -rf catalina.out
重新启动mysql即可。
最好重启linux os。
解决案例三:
mysql启动失败,日志显示如下:
代码如下:
120321 14:23:54 innodb: 1.1.8 started; log sequence number 1595695
120321 14:23:54 [error] /usr/libexec/mysqld: error writing file ‘/var/run/mysqld/mysqld.pid' (errcode: 28)
120321 14:23:54 [error] can't start server: can't create pid file: no space left on device
120321 14:23:54 mysqld_safe number of processes running now: 0
120321 14:23:54 mysqld_safe mysqld restarted
120321 14:23:54 [note] plugin ‘federated' is disabled.
120321 14:23:54 innodb: the innodb memory heap is disabled
120321 14:23:54 innodb: mutexes and rw_locks use innodb's own implementation
120321 14:23:54 innodb: compressed tables use zlib 1.2.3
120321 14:23:54 innodb: using linux native aio
120321 14:23:54 innodb: initializing buffer pool, size = 128.0m
120321 14:23:54 innodb: completed initialization of buffer pool
120321 14:23:54 innodb: highest supported file format is barracuda.
120321 14:23:55 innodb: waiting for the background threads to start
其实答案很简单,
no space left on device 没有磁盘空间了。 清理/var/log的空间!