MariaDB崩溃原因

时间:2018-11-26 16:31:12

标签: mariadb centos7 in-memory-database database-tuning

我最近将一个小型数据仓库从32位Windows MySQL 5.5实例迁移到了更大的MariaDB实例。总体而言,性能改进已达到预期。但是,我正在尝试重新启动数据库服务器并且无法识别导致崩溃的瓶颈的方案。在哪里可以看到崩溃的前兆,以便我可以适当地调整配置文件?

该设置为虚拟机,如下所示:

  • CentOS 7
  • MariaDB 10.2.18
  • 12 GB内存
  • 这是一台专用的数据库服务器。
  • 我的目标是为InnoDB缓冲区提供约4 GB的可用空间 池和数据库开销,以及另外4 GB的只读内存表(当前只有一个约为3 GB) 每晚生成以用于商业智能查询。

下面是journalctl -u mariadb --since "2018-11-26 14:00:00"的输出,显示了恢复情况。 mariadb.service: main process exited之前没有任何东西可以暗示〜15:08:30崩溃的原因。

Nov 26 15:09:19 NCSQL systemd[1]: mariadb.service: main process exited, code=killed, status=9/KILL
Nov 26 15:09:19 NCSQL systemd[1]: Unit mariadb.service entered failed state.
Nov 26 15:09:19 NCSQL systemd[1]: mariadb.service failed.
Nov 26 15:09:24 NCSQL systemd[1]: mariadb.service holdoff time over, scheduling restart.
Nov 26 15:09:24 NCSQL systemd[1]: Starting MariaDB 10.2.18 database server...
Nov 26 15:09:24 NCSQL systemd[1]: Starting MariaDB 10.2.18 database server...
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] /usr/sbin/mysqld (mysqld 10.2.18-MariaDB) starting as process 8873 ...
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Uses event mutexes
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Compressed tables use zlib 1.2.7
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Using Linux native AIO
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Number of pools: 1
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Using SSE2 crc32 instructions
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Initializing buffer pool, total size = 3G, instances = 8, chunk size = 128M
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Completed initialization of buffer pool
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140320821323520 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Highest supported file format is Barracuda.
Nov 26 15:09:25 NCSQL mysqld[8873]: 2018-11-26 15:09:25 140324770257088 [Note] InnoDB: Starting crash recovery from checkpoint LSN=277791212387
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: 128 out of 128 rollback segments are active.
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: Creating shared tablespace for temporary tables
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: Waiting for purge to start
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] InnoDB: 5.7.23 started; log sequence number 277791212441
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140320398370560 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Plugin 'FEEDBACK' is disabled.
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Recovering after a crash using tc.log
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Starting crash recovery...
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Crash recovery finished.
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140320398370560 [Note] InnoDB: Buffer pool(s) load completed at 181126 15:09:27
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Server socket created on IP: '::'.
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [ERROR] mysqld: Table './mysql/event' is marked as crashed and should be repaired
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [ERROR] mysqld: Table 'event' is marked as crashed and should be repaired
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Warning] Checking table:   './mysql/event'
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [ERROR] mysql.event: 1 client is using or hasn't closed the table properly
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324635596544 [Note] Event Scheduler: scheduler thread started with id 6
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Reading of all Master_info entries succeded
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] Added new Master_info '' to hash table
Nov 26 15:09:27 NCSQL mysqld[8873]: 2018-11-26 15:09:27 140324770257088 [Note] /usr/sbin/mysqld: ready for connections.
Nov 26 15:09:27 NCSQL mysqld[8873]: Version: '10.2.18-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server
Nov 26 15:09:27 NCSQL systemd[1]: Started MariaDB 10.2.18 database server.

我的server.cnf具有以下内容:

[mysqld]
lower_case_table_names=1
event_scheduler=on
max_heap_table_size=4G
key_buffer_size=20M
innodb_buffer_pool_size=3G
sql_mode='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

2 个答案:

答案 0 :(得分:0)

看起来您的表已损坏。 执行以下命令来解决该问题

REPAIR TABLE `<tableName>`; 

就您而言,

USE mysql
REPAIR TABLE event;

答案 1 :(得分:0)

Linux OOM杀手正在关闭数据库服务。因此,没有显示MySQL / MariaDB错误日志消息。

以下命令有助于确认:

{{1}}