MySQL运行一段时间后活动终止问题之排查

于上正题前,一定要是先行吐槽下自己,前段时间购买了一致贵阿里云服务器,最开始打算只是自己个人用之,就购置了平雅配置非常寒碜的服务器:

  • CPU: 1核
  • 内存: 1
    GB
  • 操作系统: CentOS 7.2 64个

这个布局亮出估计好多人数都曾经亮答案了,下面就是说下问题排查的手续:

  1. 使用Xshell远程连接达服务器,使用命令 service mysqld
    restart重开mysql,提示:

    MySQL server PID file could not be found! [FAILED]
    Starting MySQL.The server quit without updating PID file(/[FAILED]server/mysql/data/iZ2zeabsxnnfzh13g8yqxjZ.pid).

  2.
错过押mysql的错误日志,但是非知情错日志在乌,先夺摸索找mysql的my.cnf文件,这里需要留意下,我于mysql的安目录下真找到了一个my.cnf文件,但是改了成百上千配备起发现没外企图,google后才理解者并无是眼前利用的部署文件my.cnf,参考这篇稿子找到时采用的布置文件https://my.oschina.net/manech/blog/861991,找到了布置文件(/etc/my.cnf),找到了左日志的地方:

log-error=/alidata/log/mysql/error.log,

  3. 夺错日志看看:

2017-09-03 17:38:21 20390 [Note] InnoDB: The InnoDB memory heap is disabled
2017-09-03 17:38:21 20390 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-09-03 17:38:21 20390 [Note] InnoDB: Memory barrier is not used
2017-09-03 17:38:21 20390 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-09-03 17:38:21 20390 [Note] InnoDB: Using Linux native AIO
2017-09-03 17:38:21 20390 [Note] InnoDB: Using CPU crc32 instructions
2017-09-03 17:38:21 20390 [Note] InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
2017-09-03 17:38:21 20390 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ init function returned error.
2017-09-03 17:38:21 20390 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2017-09-03 17:38:21 20390 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-09-03 17:38:21 20390 [ERROR] Aborting
2017-09-03 17:38:21 20390 [Note] Binlog end
2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘partition’
2017-09-03 17:38:21 20390 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’

内部标为黄色的饶较主要了,百度Cannot allocate memory for the buffer
pool都算得无法给innodb分配足够的内存,大多数叫来之化解的方案是:修改innodb_buffer_pool_size,但是自此my.cnf里面没,那就是加以一个给呗,顺便用是字段设置成200M,重开mysql发现一律的结果,还是起步不了,去看日志还是同的题目,还是尽大咯?

  4.用free -m看下

              total        used        free      shared  buff/cache   available
Mem:            992         574         159           0         258         260
Swap:             0           0           0

偏偏出185M底内存了,只能重复转多少点咯,改成为64.

  5.service mysqld restart,终于

Starting MySQL. [ OK ]

采购了一致玉废柴。。。

网站地图xml地图