为什么MariaDB总是放弃我?

为什么MariaDB总是放弃我?,mariadb,Mariadb,我最近为一个基本的PHP/MySQL web应用程序安装了一个新服务器。我以前在这个应用程序中使用过MySQL。最近我听到很多关于MariaDB作为MySQL的替代品的说法,所以我想我应该试一试 我已经使用它大约一个月了,它工作得很好,但数据库随机崩溃的情况除外,到目前为止已经发生了两次。在数据库崩溃之前,服务器第一次运行了大约20天,第二次只持续了一周 如果在数据库崩溃后尝试重新启动数据库,则会得到以下输出: 2016-03-01 12:38:33 139733177079744 [Note]

我最近为一个基本的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

这是内存问题吗?这是一个拥有512MB内存的DigitalOcean VPS。NewRelic显示了490MB的可用RAM,总内存使用量在过去一个月内没有超过310MB。
mysqld
进程平均消耗102MB。整个数据库只保存12MB的总数据

除了尝试重新启动数据库时得到的输出之外,我没有看到与此问题相关的任何日志

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

    • 这是重要的部分:

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

      您是否以root用户身份安装了MariaDB

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

      512MB很小,但可能与启动失败无关