为什么MariaDB会一直放弃我?

时间:2016-03-01 18:28:34

标签: mariadb

我最近为基本的PHP / MySQL Web应用程序设置了一个新服务器。我过去曾使用过MySQL这个应用程序。我最近听到很多关于MariaDB作为MySQL的替代品,所以我想我会试一试。

我已经使用它大约一个月了,除了当数据库随机崩溃,到目前为止已经发生过两次时,它的效果很好。数据库崩溃之前服务器第一次启动大约20天,第二次只持续了一周。

如果我在崩溃后尝试重新启动数据库,我会得到以下输出:

2016-03-01 12:38:33 139733177079744 [Note] mysqld (mysqld 10.1.11-MariaDB-1~trusty) starting as process 32229 ...
2016-03-01 12:38:33 139733177079744 [Warning] Can't create test file /var/lib/mysql/myapp-production.lower-test
2016-03-01 12:38:33 139733177079744 [Warning] One can only use the --user switch if running as root

2016-03-01 12:38:33 139733177079744 [Note] Using unique option prefix 'myisam_recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2016-03-01 12:38:33 139733177079744 [ERROR] mysqld: File '/var/lib/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2016-03-01 12:38:33 139733177079744 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2016-03-01 12:38:33 139733177079744 [ERROR] Plugin 'Aria' init function returned error.
2016-03-01 12:38:33 139733177079744 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: The InnoDB memory heap is disabled
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Memory barrier is not used
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Using Linux native AIO
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Using SSE crc32 instructions
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-03-01 12:38:33 139733177079744 [Note] InnoDB: Completed initialization of buffer pool
2016-03-01 12:38:33 139733177079744 [ERROR] InnoDB: ./ibdata1 can't be opened in read-write mode
2016-03-01 12:38:33 139733177079744 [ERROR] InnoDB: The system tablespace must be writable!
2016-03-01 12:38:33 139733177079744 [ERROR] Plugin 'InnoDB' init function returned error.
2016-03-01 12:38:33 139733177079744 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2016-03-01 12:38:33 139733177079744 [Note] Plugin 'FEEDBACK' is disabled.
2016-03-01 12:38:33 139733177079744 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2016-03-01 12:38:33 139733177079744 [ERROR] Unknown/unsupported storage engine: InnoDB
2016-03-01 12:38:33 139733177079744 [ERROR] Aborting

此信息记录在/var/log/mysql/error.log

我能够让MariaDB服务器再次运行的唯一方法是重启整个VPS。通过检查New Relic,我可以看到内存使用从大约300 MB下降到200 MB。

这是一个记忆问题吗?它是具有512 MB RAM的DigitalOcean VPS。 New Relic显示490 MB的可用RAM,并且在过去一个月内总内存使用量未超过310 MB。 mysqld进程平均消耗102 MB。整个数据库只保存12 MB的总数据。

除了尝试重新启动数据库时获得的输出,我没有看到有关此问题的任何记录。

  • 如何确定导致MariaDB崩溃的原因?
  • 如何在不重启整个VPS的情况下重启数据库?

1 个答案:

答案 0 :(得分:0)

这是重要的部分:

  

2016-03-01 12:38:33 139733177079744 [错误] InnoDB:./ ibdata1不能成为   以读写模式打开   2016-03-01 12:38:33 139733177079744 [错误]   InnoDB:系统表空间必须是可写的!

您是否以root身份安装了MariaDB?

您是否将目录放在可写文件系统的可写树中?

512MB tiny ,但可能与启动失败无关。