回 2楼dongshan8的帖子
查看了mysql的状态,mysql没有运行,重启mysql报错:
The server quit without updating PID file (/alidata/server/mysql/data/izj6c7l4xqujlr9cqqvfq5z.pid).
甚至登录数据库都链接不上:
提示:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
为什么上传不了图片??
-------------------------
回 2楼dongshan8的帖子
mysql 错误日志:
171007 11:27:38 [Note] /alidata/server/mysql/bin/mysqld: Shutdown complete
171007 11:27:38 mysqld_safe mysqld from pid file /alidata/server/mysql/data/izj6c7l4xqujlr9cqqvfq5z.pid ended
171007 11:29:48 mysqld_safe Starting mysqld daemon with databases from /alidata/server/mysql/data
171007 11:29:48 [Note] Plugin 'FEDERATED' is disabled.
171007 11:29:48 InnoDB: The InnoDB memory heap is disabled
171007 11:29:48 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171007 11:29:48 InnoDB: Compressed tables use zlib 1.2.3
171007 11:29:48 InnoDB: Using Linux native AIO
171007 11:29:48 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
171007 11:29:48 InnoDB: Completed initialization of buffer pool
171007 11:29:48 InnoDB: Fatal error: cannot allocate memory for the buffer pool
171007 11:29:48 [ERROR] Plugin 'InnoDB' init function returned error.
171007 11:29:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
171007 11:29:48 [ERROR] Unknown/unsupported storage engine: InnoDB
171007 11:29:48 [ERROR] Aborting
171007 11:29:48 [Note] /alidata/server/mysql/bin/mysqld: Shutdown complete
171007 11:29:49 mysqld_safe mysqld from pid file /alidata/server/mysql/data/izj6c7l4xqujlr9cqqvfq5z.pid ended
171009 17:19:36 mysqld_safe Starting mysqld daemon with databases from /alidata/server/mysql/data
171009 17:19:36 [Note] Plugin 'FEDERATED' is disabled.
171009 17:19:36 InnoDB: The InnoDB memory heap is disabled
171009 17:19:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
171009 17:19:36 InnoDB: Compressed tables use zlib 1.2.3
171009 17:19:36 InnoDB: Using Linux native AIO
171009 17:19:36 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
171009 17:19:36 InnoDB: Completed initialization of buffer pool
171009 17:19:36 InnoDB: Fatal error: cannot allocate memory for the buffer pool
171009 17:19:36 [ERROR] Plugin 'InnoDB' init function returned error.
171009 17:19:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
171009 17:19:36 [ERROR] Unknown/unsupported storage engine: InnoDB
171009 17:19:36 [ERROR] Aborting
171009 17:19:36 [Note] /alidata/server/mysql/bin/mysqld: Shutdown complete
171009 17:19:36 mysqld_safe mysqld from pid file /alidata/server/mysql/data/izj6c7l4xqujlr9cqqvfq5z.pid ended
-------------------------
回 7楼一如繁星的帖子
用过你的方法,还是会出问题
-------------------------
回 9楼一如繁星的帖子
wordpress
-------------------------
回 11楼dongshan8的帖子
惨,我还是先买个云故障排查服务。。。。
-------------------------
回 13楼一如繁星的帖子
我再试试
-------------------------
回 13楼一如繁星的帖子
key_buffer_size 16M改为16K了,service mysqld restart重启
报的是这个错,
MySQL server PID file could not be found! [FAILED]
Starting MySQL.The server quit without updating PID file (/alidata/server/mysql/data/izj6c7l4xqujlr9cqqvfq5z.pid).
-------------------------
Re过一段时间网站就会提示无法连接数据库?
找到原因了,
加这句设置,
innodb_buffer_pool_size = 16M
之前默认的设置是128m,太大了,
-------------------------
回 18楼dongshan8的帖子
今天又不行了,后来重启了mysql,然后没问题了。。。
可能以后还会出问题。。。
不知道是不是内存不足引起的。。。
mysql老是奔溃可不行啊。。。。
-------------------------
回 20楼dongshan8的帖子
是不是内存不足的问题?升级内存能解决不?
-------------------------
回 20楼dongshan8的帖子
分配了128m的swap,看看效果
-------------------------
回 25楼dongshan8的帖子
分配了128m的swap之后,有时还是会挂,但是比以前好的是,刷新几次后又好了。。。
-------------------------
回 24楼一如繁星的帖子
好,我再看看
-------------------------
回 28楼dongshan8的帖子
嗯嗯,刚刚加到了600,我到配置总共就只有1g存储空间。。。。
-------------------------
回 28楼dongshan8的帖子
还是会崩,加到900了,再不行,看来要升级硬件了
-------------------------
回 28楼dongshan8的帖子
挂掉掉时候,我用free -m查看,
情况如下。。。。
total used free shared buff/cache available
Mem: 992 877 47 0 66 11
Swap: 878 874 4
-------------------------
回 32楼dongshan8的帖子
检查哪个部分呢?
-------------------------
回 34楼dongshan8的帖子
应该是负载过高了。。。
top - 14:27:13 up 34 days, 3:19, 1 user, load average: 67.84, 62.05, 65.08
Tasks: 147 total, 5 running, 142 sleeping, 0 stopped, 0 zombie
%Cpu(s): 3.3 us, 4.7 sy, 0.0 ni, 0.0 id, 92.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 1016412 total, 77500 free, 877932 used, 60980 buff/cache
KiB Swap: 799996 total, 1640 free, 798356 used. 23668 avail Mem
uptime
14:28:47 up 34 days, 3:21, 1 user, load average: 44.24, 56.26, 62.76
这个要怎么排查?
-------------------------
回 34楼dongshan8的帖子
查了下io的情况
2017年11月01日 _x86_64_ (1 CPU)
avg-cpu: %user %nice %system %iowait %steal %idle
1.27 0.00 0.45 3.10 0.00 95.18
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 35.66 12.64 33.92 12.89 1707.77 104.50 77.43 1.16 24.76 11.67 59.24 0.77 3.61
avg-cpu: %user %nice %system %iowait %steal %idle
3.03 0.00 3.03 93.94 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2725.25 16.16 1254.55 204.04 25187.88 1018.18 35.93 37.92 32.38 22.92 90.55 0.69 100.91
avg-cpu: %user %nice %system %iowait %steal %idle
3.00 0.00 4.00 93.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2341.00 193.00 1240.00 852.00 22212.00 4096.00 25.15 97.59 42.19 28.58 62.01 0.48 99.80
avg-cpu: %user %nice %system %iowait %steal %idle
4.04 0.00 5.05 90.91 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2458.59 228.28 1250.51 1261.62 35842.42 6000.00 33.31 127.28 50.78 28.00 73.36 0.40 101.01
avg-cpu: %user %nice %system %iowait %steal %idle
4.00 0.00 6.00 90.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2253.00 202.00 1242.00 1241.00 27452.00 5796.00 26.78 125.97 50.55 31.77 69.35 0.40 100.00
avg-cpu: %user %nice %system %iowait %steal %idle
5.00 0.00 4.00 91.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2363.00 216.00 1240.00 1234.00 22520.00 5800.00 22.89 121.06 49.92 25.39 74.57 0.40 100.00
avg-cpu: %user %nice %system %iowait %steal %idle
4.04 0.00 2.02 93.94 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2697.98 2.02 1251.52 77.78 20379.80 339.39 31.17 25.78 24.78 20.44 94.64 0.75 100.30
avg-cpu: %user %nice %system %iowait %steal %idle
5.00 0.00 3.00 92.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2342.00 0.00 1241.00 0.00 15188.00 0.00 24.48 25.93 20.83 20.83 0.00 0.80 99.00
avg-cpu: %user %nice %system %iowait %steal %idle
7.00 0.00 3.00 90.00 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2488.00 76.00 1240.00 616.00 15212.00 2680.00 19.28 75.35 35.44 19.57 67.40 0.53 99.20
avg-cpu: %user %nice %system %iowait %steal %idle
8.08 0.00 4.04 87.88 0.00 0.00
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
vda 2270.71 111.11 1233.33 874.75 16234.34 4032.32 19.23 84.46 44.69 19.15 80.70 0.47 99.90
惨了。。。。
-------------------------
回 34楼dongshan8的帖子
过一段时间又正常了。。。。
-------------------------
回 38楼dongshan8的帖子
怎么跟踪? 用啥命令?
-------------------------
Re过一段时间网站就会提示无法连接数据库?
查出来了,是被攻击了。。。