【Docker】MariaDBが動かない時の対処

Dockerで環境構築中にMariaDBが動かなかったのでメモ


エラーの確認

以下のコマンドでエラーを確認してください。

docker logs [コンテナ名]

mariadb | 2018-01-28 8:13:24 139822027995008 [Note] mysqld (mysqld 10.2.14-MariaDB-10.2.14+maria~jessie) starting as process 1 ...
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Uses event mutexes
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Compressed tables use zlib 1.2.8
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Using Linux native AIO
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Number of pools: 1
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Using SSE2 crc32 instructions
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Completed initialization of buffer pool
mariadb | 2018-01-28 8:13:24 139821292693248 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
mariadb | 2018-01-28 8:13:24 139822027995008 [ERROR] InnoDB: The Auto-extending innodb_system data file './ibdata1' is of a different size 0 pages than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages!
mariadb | 2018-01-28 8:13:24 139822027995008 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
mariadb | 2018-01-28 8:13:24 139822027995008 [Note] InnoDB: Starting shutdown...
mariadb | 2018-01-28 8:13:25 139822027995008 [ERROR] Plugin 'InnoDB' init function returned error.
mariadb | 2018-01-28 8:13:25 139822027995008 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
mariadb | 2018-01-28 8:13:25 139822027995008 [Note] Plugin 'FEEDBACK' is disabled.
mariadb | 2018-01-28 8:13:25 139822027995008 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
mariadb | 2018-01-28 8:13:25 139822027995008 [ERROR] Unknown/unsupported storage engine: InnoDB
mariadb | 2018-01-28 8:13:25 139822027995008 [ERROR] Aborting

結果を見ると「ibdata1」が作成出来なかったのが原因のようです。


対処方法

「innodb_flush_method」の設定が原因だったで以下のように設定を変更したら正常に起動いたしました。

[mysqld]
innodb_flush_method=O_DSYNC
innodb_use_native_aio=OFF

「innodb_use_native_aio」には、OFFにしないとWebアプリケーションから接続できなかったので書いておきました。


参考サイト:on windows, cannot start a container with host directory as /var/lib/mysql mount


0 件のコメント :

コメントを投稿