MySQL 5.7 在 Ubuntu 16.04 上崩溃 - 没有错误

MySQL 5.7 在 Ubuntu 16.04 上崩溃 - 没有错误

我在 Digital Ocean 上用 Ubuntu 16.04 创建了一个新服务器,但mysql组件一直崩溃。我有一个通知脚本,当mysql崩溃并尝试重新启动时,它会向我发送电子邮件,但似乎脚本从未进入其中。以下是我收到的状态消息mysql

$ sudo service mysql status
● mysql.service - MySQL Community Server
  Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
  Active: activating (start-post) (Result: exit-code) since Sun 2017-06-11 15:14:13 UTC; 19s ago
  Process: 2363 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 2354 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
  Main PID: 2363 (code=exited, status=1/FAILURE);         : 2364 (mysql-systemd-s)
   Tasks: 2
   Memory: 13.1M
   CPU: 306ms
   CGroup: /system.slice/mysql.service
       └─control
         ├─2364 /bin/bash /usr/share/mysql/mysql-systemd-start post
         └─2408 sleep 1

Jun 11 15:14:13 web3 systemd[1]: Starting MySQL Community Server...
Jun 11 15:14:14 web3 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

我尝试卸载并重新安装mysql多次,但它仍然在大约 10-15 分钟后死机。

我没有任何实际访问数据库服务器的现场网站,但它仍然崩溃。任何帮助都非常好。

以下是来自 /var/log/mysql/error.log 的日志。它不断重复显示相同的块。

2017-06-12T13:26:01.927855Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2017-06-12T13:26:01.927933Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2017-06-12T13:26:02.105676Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-06-12T13:26:02.107436Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.18-0ubuntu0.16.04.1) starting as process 27675 ...
2017-06-12T13:26:02.112660Z 0 [Note] InnoDB: PUNCH HOLE support available
2017-06-12T13:26:02.112693Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-06-12T13:26:02.112698Z 0 [Note] InnoDB: Uses event mutexes
2017-06-12T13:26:02.112701Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-06-12T13:26:02.112705Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-06-12T13:26:02.112708Z 0 [Note] InnoDB: Using Linux native AIO
2017-06-12T13:26:02.112965Z 0 [Note] InnoDB: Number of pools: 1
2017-06-12T13:26:02.113077Z 0 [Note] InnoDB: Using CPU crc32 instructions
2017-06-12T13:26:02.114652Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2017-06-12T13:26:02.114692Z 0 [ERROR] InnoDB: mmap(137428992 bytes) failed; errno 12
2017-06-12T13:26:02.114700Z 0 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2017-06-12T13:26:02.114704Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-06-12T13:26:02.114711Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-06-12T13:26:02.114715Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-06-12T13:26:02.114720Z 0 [ERROR] Failed to initialize plugins.
2017-06-12T13:26:02.114724Z 0 [ERROR] Aborting

2017-06-12T13:26:02.114728Z 0 [Note] Binlog end
2017-06-12T13:26:02.115085Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

journalctl -u mysql 的响应

Jun 12 11:29:44 web3 systemd[1]: mysql.service: Unit entered failed state.
Jun 12 11:29:44 web3 systemd[1]: mysql.service: Failed with result 'exit-code'.
Jun 12 11:29:44 web3 systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
Jun 12 11:29:44 web3 systemd[1]: Stopped MySQL Community Server.
Jun 12 11:29:44 web3 systemd[1]: Starting MySQL Community Server...
Jun 12 11:29:44 web3 systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE
Jun 12 11:30:14 web3 systemd[1]: Failed to start MySQL Community Server.

相关内容