LoginSignup
10
9

More than 5 years have passed since last update.

Serfで実装するHigh Availability NAT (EIP付け替えパターン)

Posted at

Serfによる冗長化

前に実装したSerf冗長化ですが、EIPを付け替える要望がありましたので、
スクリプトを実装しました。

Serfで実装するHigh Availability NAT

構成図

ha-nat-eip.png

実装

実装方法は前と替りませんが、スクリプトが変更になります。

実行方法

ha-nat-eip -R [変更するRouteTableのTagName] -E [Allocation-id] -N 0.0.0.0/0 -r ap-northeast-1

Serf.confもハンドラーのスクリプトを変更する

{
  "node_name": "nat1",
  "enable_syslog": true,
  "tags": {
    "role": "nat"
  },
  "reconnect_interval": "4s",←疎通間隔は4秒
  "reconnect_timeout": "12s",←タイムアウト検知12秒
  "tombstone_timeout": "12s",←タイムアウト検知12秒
  "event_handlers": [
    "member-join=ha-nat-eip -R [変更するRouteTableのTagName] -E [Allocation-id] -N 0.0.0.0/0 -r ap-northeast-1 >> /var/log/ha-nat.log 2>&1"
  ]
}

障害試験

Active側に障害が発生した場合は、約12秒で切り替わりが行われます。

10
9
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
10
9