mariadb10.5のログの比較
| 登録日 | :2024/06/05 04:24 |
|---|---|
| カテゴリ | :Linux |
正常起動の場合
[root@rockylinux_test_zabbix mariadb]# cat mariadb.log
2024-06-04 17:12:20 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 1037
2024-06-04 17:12:20 0 [Warning] WSREP: Failed to guess base node address. Set it explicitly via wsrep_node_address.
2024-06-04 17:12:20 0 [Warning] WSREP: Failed to guess base node address. Set it explicitly via wsrep_node_address.
2024-06-04 17:12:20 0 [Warning] WSREP: Guessing address for incoming client connections failed. Try setting wsrep_node_incoming_address explicitly.
2024-06-04 17:12:20 0 [Note] WSREP: Node addr:
2024-06-04 17:12:21 0 [Note] InnoDB: Uses event mutexes
2024-06-04 17:12:21 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-04 17:12:21 0 [Note] InnoDB: Number of pools: 1
2024-06-04 17:12:21 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-04 17:12:21 0 [Note] InnoDB: Using Linux native AIO
2024-06-04 17:12:21 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-06-04 17:12:21 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-04 17:12:21 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=401296178,401296370
2024-06-04 17:12:23 0 [Note] InnoDB: Starting final batch to recover 396 pages from redo log.
2024-06-04 17:12:24 0 [Note] InnoDB: 128 rollback segments are active.
2024-06-04 17:12:24 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2024-06-04 17:12:24 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-06-04 17:12:24 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-06-04 17:12:24 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-06-04 17:12:24 0 [Note] InnoDB: 10.5.22 started; log sequence number 417004300; transaction id 1016482
2024-06-04 17:12:24 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-06-04 17:12:25 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 17:12:25 0 [Note] Server socket created on IP: '::'.
2024-06-04 17:12:25 0 [Note] Reading of all Master_info entries succeeded
2024-06-04 17:12:25 0 [Note] Added new Master_info '' to hash table
2024-06-04 17:12:25 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.5.22-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
2024-06-04 17:12:25 0 [Note] InnoDB: Buffer pool(s) load completed at 240604 17:12:25
[root@rockylinux_test_zabbix mariadb]#
障害で起動できないmariadbのログ
[root@zabbix60 my.cnf.d]# cat /var/log/mariadb/mariadb.log
2024-06-04 7:33:57 3 [Warning] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost'
2024-06-04 7:34:04 4 [Warning] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost'
2024-06-04 7:39:12 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 10715
2024-06-04 7:39:12 0 [Note] InnoDB: !!! innodb_force_recovery is set to 1 !!!
2024-06-04 7:39:12 0 [Note] InnoDB: Uses event mutexes
2024-06-04 7:39:12 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-04 7:39:12 0 [Note] InnoDB: Number of pools: 1
2024-06-04 7:39:12 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-04 7:39:12 0 [Note] InnoDB: Using Linux native AIO
2024-06-04 7:39:12 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-06-04 7:39:12 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-04 7:39:12 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=145646096984,145646096984
2024-06-04 7:39:12 0 [Note] InnoDB: 128 rollback segments are active.
2024-06-04 7:39:12 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2024-06-04 7:39:12 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2024-06-04 7:39:12 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2024-06-04 7:39:12 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2024-06-04 7:39:12 0 [Note] InnoDB: 10.5.22 started; log sequence number 145646096996; transaction id 81767482
2024-06-04 7:39:12 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:39:12 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2024-06-04 7:39:12 0 [Note] Server socket created on IP: '::'.
2024-06-04 7:39:12 0 [Note] Reading of all Master_info entries succeeded
2024-06-04 7:39:12 0 [Note] Added new Master_info '' to hash table
2024-06-04 7:39:12 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.5.22-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
2024-06-04 7:39:12 0 [Note] InnoDB: Buffer pool(s) load completed at 240604 7:39:12
2024-06-04 7:39:37 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 10838
2024-06-04 7:39:37 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2024-06-04 7:40:07 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2024-06-04 7:40:07 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2024-06-04 7:40:07 0 [Note] InnoDB: !!! innodb_force_recovery is set to 1 !!!
2024-06-04 7:40:07 0 [Note] InnoDB: Uses event mutexes
2024-06-04 7:40:07 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-04 7:40:07 0 [Note] InnoDB: Number of pools: 1
2024-06-04 7:40:07 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-04 7:40:07 0 [Note] InnoDB: Using Linux native AIO
2024-06-04 7:40:07 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-06-04 7:40:07 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-04 7:40:07 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:40:07 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2024-06-04 7:40:07 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:40:07 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:40:07 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:40:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:40:07 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
2024-06-04 7:40:07 0 [ERROR] Failed to initialize plugins.
2024-06-04 7:40:07 0 [ERROR] Aborting
2024-06-04 7:44:16 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 11015
2024-06-04 7:44:16 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2024-06-04 7:44:46 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2024-06-04 7:44:46 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2024-06-04 7:44:46 0 [Note] InnoDB: Uses event mutexes
2024-06-04 7:44:46 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-04 7:44:46 0 [Note] InnoDB: Number of pools: 1
2024-06-04 7:44:46 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-04 7:44:46 0 [Note] InnoDB: Using Linux native AIO
2024-06-04 7:44:46 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-06-04 7:44:46 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-04 7:44:46 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:44:46 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2024-06-04 7:44:46 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:44:46 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:44:46 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:44:46 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:44:46 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
2024-06-04 7:44:46 0 [ERROR] Failed to initialize plugins.
2024-06-04 7:44:46 0 [ERROR] Aborting
2024-06-04 7:46:49 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 11137
2024-06-04 7:46:49 0 [Note] InnoDB: Uses event mutexes
2024-06-04 7:46:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2024-06-04 7:46:49 0 [Note] InnoDB: Number of pools: 1
2024-06-04 7:46:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
2024-06-04 7:46:49 0 [Note] InnoDB: Using Linux native AIO
2024-06-04 7:46:49 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
2024-06-04 7:46:49 0 [Note] InnoDB: Completed initialization of buffer pool
2024-06-04 7:46:49 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:46:49 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2024-06-04 7:46:49 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:46:49 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:46:49 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:46:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:46:49 0 [Note] Zerofilling moved table: './mysql/plugin'
2024-06-04 7:46:49 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2024-06-04 7:46:49 0 [ERROR] Aborting
[root@zabbix60 my.cnf.d]#
エラー部分を抜き出してみた
[root@zabbix60 my.cnf.d]# cat /var/log/mariadb/mariadb.log
2024-06-04 7:33:57 3 [Warning] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost'
2024-06-04 7:34:04 4 [Warning] Access denied for user 'UNKNOWN_MYSQL_USER'@'localhost'
2024-06-04 7:39:12 0 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.5.22-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
2024-06-04 7:39:12 0 [Note] InnoDB: Buffer pool(s) load completed at 240604 7:39:12
2024-06-04 7:39:37 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 10838
2024-06-04 7:39:37 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2024-06-04 7:40:07 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2024-06-04 7:40:07 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2024-06-04 7:40:07 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:40:07 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:40:07 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:40:07 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:40:07 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:40:07 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
2024-06-04 7:40:07 0 [ERROR] Failed to initialize plugins.
2024-06-04 7:40:07 0 [ERROR] Aborting
2024-06-04 7:44:16 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 11015
2024-06-04 7:44:16 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds
2024-06-04 7:44:46 0 [ERROR] mysqld: Got error 'Could not get an exclusive lock; file is probably in use by another process' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2024-06-04 7:44:46 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2024-06-04 7:44:46 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:44:46 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2024-06-04 7:44:46 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:44:46 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:44:46 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:44:46 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:44:46 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engine 'Aria'". Some plugins may be not loaded
2024-06-04 7:44:46 0 [ERROR] Failed to initialize plugins.
2024-06-04 7:44:46 0 [ERROR] Aborting
2024-06-04 7:46:49 0 [Note] Starting MariaDB 10.5.22-MariaDB source revision 7e650253dc488debcb0898ebe6d385bf6dfa3656 as process 11137
2024-06-04 7:46:49 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2024-06-04 7:46:49 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2024-06-04 7:46:49 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2024-06-04 7:46:49 0 [Note] InnoDB: Starting shutdown...
2024-06-04 7:46:49 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2024-06-04 7:46:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2024-06-04 7:46:49 0 [Note] Zerofilling moved table: './mysql/plugin'
2024-06-04 7:46:49 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2024-06-04 7:46:49 0 [ERROR] Aborting
[root@zabbix60 my.cnf.d]#
さらに、journalctl -xeを確認した。
[root@zabbix60 lib]# sudo journalctl -xe
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
6月 04 07:40:23 zabbix60 sudo[10856]: root : TTY=pts/1 ; PWD=/var/lib/mysql ; USER=root ; COMMAND=/bin/journalc>
6月 04 07:40:23 zabbix60 sudo[10856]: pam_unix(sudo:session): session opened for user root by root(uid=0)
6月 04 07:40:53 zabbix60 sudo[10856]: pam_unix(sudo:session): session closed for user root
6月 04 07:43:47 zabbix60 packagekitd[2419]: LRO_MIRRORLISTURL processing failed: Curl error (28): Timeout was reach>
6月 04 07:44:16 zabbix60 systemd[1]: Starting MariaDB 10.5 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
6月 04 07:44:16 zabbix60 mysql-prepare-db-dir[10977]: Database MariaDB is probably initialized in /var/lib/mysql al>
6月 04 07:44:16 zabbix60 mysql-prepare-db-dir[10977]: If this is not the case, make sure the /var/lib/mysql is empt>
6月 04 07:44:46 zabbix60 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
6月 04 07:44:46 zabbix60 systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
6月 04 07:44:46 zabbix60 systemd[1]: Failed to start MariaDB 10.5 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
6月 04 07:45:26 zabbix60 sudo[11036]: root : TTY=pts/1 ; PWD=/var/lib/mysql ; USER=root ; COMMAND=/bin/journalc>
6月 04 07:45:26 zabbix60 sudo[11036]: pam_unix(sudo:session): session opened for user root by root(uid=0)
6月 04 07:46:03 zabbix60 sudo[11036]: pam_unix(sudo:session): session closed for user root
6月 04 07:46:49 zabbix60 systemd[1]: Starting MariaDB 10.5 database server...
-- Subject: Unit mariadb.service has begun start-up
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has begun starting up.
6月 04 07:46:49 zabbix60 mysql-prepare-db-dir[11099]: Database MariaDB is probably initialized in /var/lib/mysql al>
6月 04 07:46:49 zabbix60 mysql-prepare-db-dir[11099]: If this is not the case, make sure the /var/lib/mysql is empt>
6月 04 07:46:50 zabbix60 systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
6月 04 07:46:50 zabbix60 systemd[1]: mariadb.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The unit mariadb.service has entered the 'failed' state with result 'exit-code'.
6月 04 07:46:50 zabbix60 systemd[1]: Failed to start MariaDB 10.5 database server.
-- Subject: Unit mariadb.service has failed
-- Defined-By: systemd
-- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mariadb.service has failed.
--
-- The result is failed.
6月 04 07:48:29 zabbix60 sudo[11190]: root : TTY=pts/1 ; PWD=/var/lib ; USER=root ; COMMAND=/bin/journalctl -xe
6月 04 07:48:29 zabbix60 sudo[11190]: pam_unix(sudo:session): session opened for user root by root(uid=0)
初回起動時は、ユーザがないと怒られている印象。
その後、2回程、mariadbの再起動を試みているので、INNODBのロックができない(つまり、プロセスが競合している?)ことによって起動できない、、というエラーとも思える。
Zabbixを構築するときに、Zabbixユーザは作成して権限を与えているのに、アクセスを拒否されるのはどうしてだろう。
以下の手順で、権限を見てみよう。
ログインしてMariaDBのユーザー確認
MariaDBが起動した場合、MySQLのユーザー情報を確認します。MySQLにログインしてユーザーを確認し、適切な権限が設定されているかどうかを確認します。
mysql -u root -p
MariaDBにログインしたら、ユーザー情報を確認します。
SELECT User, Host FROM mysql.user;
新しいユーザーの作成または権限の修正
適切なユーザーが存在しない場合、新しいユーザーを作成し、必要な権限を与えます。
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
MariaDBの設定ファイルの確認
設定ファイル(/etc/my.cnf)を確認し、正しいユーザーが設定されているかどうかを確認します。設定ファイルに問題がある場合は修正します。
MariaDB設定ファイルの例
[mysqld]
user=mysql
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
log-error=/var/log/mariadb/mariadb.log
pid-file=/run/mariadb/mariadb.pid
Zabbixサーバの初回構成時も、似たようなエラーで起動できないことはあった。
その時は、ローカルユーザを無効化して、何度か再インストールと、Zabbix4.0のデータベースの再インポートを行って安定稼働した経緯がある。。
しかし、再起動後にまたこのようなことになるとは、、、困ったものである。
ディスク容量としては、まだ7GBあるため、幾分余裕もあることから、ディスク容量を大きくすることではないかなと。
根本的に解決をしていかないと、再構成をしてもまた発生する可能性がある。データも失いたくないから、何とか解決をしたい。