Quantcast
Channel: @blog.justoneplanet.info
Viewing all articles
Browse latest Browse all 46

RDSでインスタンスがブロックされMySQLに接続できなくなる

$
0
0

RDSを使っているとMulti-AZ DeploymentがYesになっている場合でも、以下のようにMySQLに接続できない時間が存在する。

Database connection "SQLSTATE[HY000] [2003] Can't connect to MySQL server on 'endpoint.zone.amazonaws.com' " is missing, or could not be created.

ユーザーのアクセスごとにconnectが発生するようなシステムの場合、上述の接続できない時間の間に多数のユーザーがアクセスし、クライアントが接続エラーを繰り返す場合がある。その場合、以下のエラーが発生する。

Database connection "SQLSTATE[HY000] [1129] Host 'instance.zone.compute.internal' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" is missing, or could not be created.

■上限値を増やす

max_connect_errorsを変更することで接続エラーの上限値を変更できる。

■ブロックを解除する

mysqladmin -h endpoint.zone.amazonaws.com -u user --password=password flush-hosts
Host ‘host_name’ is blocked
  • blocked because of many connection errors; unblock with ‘mysqladmin flush-h

  • Viewing all articles
    Browse latest Browse all 46

    Trending Articles