LoginSignup
0
0

More than 3 years have passed since last update.

OpenstackのコンポーネントがMySQLに接続できない

Last updated at Posted at 2020-11-16

MySQLをデータベースとしてopenstackを構築したところ、各コンポーネントのログにエラーが。

ERROR oslo_db.sqlalchemy.engines [req-e8ea5ffd-f4f9-4c44-855c-c72c4eeee270 - - - - -] Database connection was found disconnected; reconnecting: oslo_db.exception.DBConnectionError: (pymysql.err.OperationalError) (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))")

該当ホストからmysqlコマンドでログインできるため、ネットワーク的な問題はなさそうです。

どうやらコネクションタイムアウトっぽい。

MySQL側のwait timeoutは

MariaDB [(none)]> show global variables like 'wait_timeout';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  |   120 |
+---------------+-------+
1 row in set (0.001 sec)

となっていて、特に異常はないように思えた。

ところが、openstackではDBのコネクションを継続使用しているため、mysql側でtimeoutさせてはならないようだ。
そのため、timeoutさせないようにopenstackは300秒毎にポーリングも行ったいた。

openstackのポーリング秒 > MySQLのwait timeout

となってしまっていたため、最初の Database connection was found disconnectedが出ていた。

素直に

MariaDB [(none)]> set global wait_timeout=600;

やって無事解決。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0