Dynamic Servers を使ったプールの作成と使用
最終更新日 2018-04-25
Fastly のロードバランサーでは、Fastly のダイナミックサーバー機能を利用し、動的な管理が可能なオリジンサーバーのプールを作成し、受信したリクエストを分散、転送することができます。プールは、オリジンサーバーのグループ間のリクエストをバランスを分配する役割を果たします。ロードバランシングに加えて、失敗したリクエストを再試行するようにプールを設定できます。プールには、停止したオリジンサーバーが再起動した際の問題を防ぐために、プール全体が up
として扱われるタイミングを決定するクォーラム設定があります。
この情報は、限定提供版 (Limited Availability) のリリースの一部として提供されています。詳細については、プロダクトと機能のライフサイクルに関する説明をご覧ください。
プールの作成
Dynamic Servers の使用を開始するには、ロックが解除済みでまだ有効化されていないサービスバージョン内に、空のプールを作成する必要があります。ターミナルアプリケーションで以下の API コールを行います。
1
$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X POST https://api.fastly.com/service/<service_id>/version/<service_version>/pool -d 'name=<pool_name>&comment=<comment>'
レスポンスは以下のようになります。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"between_bytes_timeout": "10000",
"comment": "<comment>",
"connect_timeout": "1000",
"created_at": "2016-08-01T14:43:22+00:00",
"deleted_at": null,
"first_byte_timeout": "15000",
"healthcheck": null,
"id": "2IpWU5CGzPpbpGsABSDops",
"max_conn_default": "200",
"max_tls_version": null,
"min_tls_version": null,
"name": "<pool_name>",
"quorum": "75",
"request_condition": null,
"service_id": "<service_id>",
"shield": null,
"tls_ca_cert": null,
"tls_cert_hostname": null,
"tls_check_cert": 1,
"tls_ciphers": null,
"tls_client_cert": null,
"tls_client_key": null,
"tls_sni_hostname": null,
"type": "random",
"updated_at": "2016-08-01T14:43:22+00:00",
"use_tls": 0,
"version": "<service_version>"
}
少なくとも1つのオリジンサーバーを追加した後、プールに関連付けられた最新バージョンを有効化してください。
各 Fastly サービスにて、最大5つのオリジンサーバーを設定することができます。お客様のアカウントでサービスごとに5台以上のオリジンサーバーを有効にする場合は、sales@fastly.com までお問い合わせください。
プールの確認
特定のサービスバージョンに付加されたすべてのプールのリストを表示するには、ターミナルアプリケーションで以下の API コールを行います。
1
$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool
レスポンスは以下のようになります。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
[
{
"between_bytes_timeout": "10000",
"comment": "just my first pool",
"connect_timeout": "1000",
"created_at": "2016-08-01T14:43:22+00:00",
"deleted_at": null,
"first_byte_timeout": "15000",
"healthcheck": null,
"id": "2IpWU5CGzPpbpGsABSDops",
"max_conn_default": "200",
"max_tls_version": null,
"min_tls_version": null,
"name": "SP_Prod_Pool_1",
"quorum": "75",
"request_condition": null,
"service_id": "<service_id>",
"shield": null,
"tls_ca_cert": null,
"tls_cert_hostname": null,
"tls_check_cert": 1,
"tls_ciphers": null,
"tls_client_cert": null,
"tls_client_key": null,
"tls_sni_hostname": null,
"type": "random",
"updated_at": "2016-08-01T14:43:22+00:00",
"use_tls": 0,
"version": "<service_version>"
}
]
特定のサービスバージョンに付加された単一のプール (この例では SP_Prod_Pool_1
) に関する情報を確認するには、ターミナルアプリケーションで以下の API コールを行います。
1
$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool/<pool_name>
レスポンスは以下のようになります。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"between_bytes_timeout": "10000",
"comment": "just my first pool",
"connect_timeout": "1000",
"created_at": "2016-08-01T14:43:22+00:00",
"deleted_at": null,
"first_byte_timeout": "15000",
"healthcheck": null,
"id": "2IpWU5CGzPpbpGsABSDops",
"max_conn_default": "200",
"max_tls_version": null,
"min_tls_version": null,
"name": "SP_Prod_Pool_1",
"quorum": "75",
"request_condition": null,
"service_id": "<service_id>",
"shield": null,
"tls_ca_cert": null,
"tls_cert_hostname": null,
"tls_check_cert": 1,
"tls_ciphers": null,
"tls_client_cert": null,
"tls_client_key": null,
"tls_sni_hostname": null,
"type": "random",
"updated_at": "2016-08-01T14:43:22+00:00",
"use_tls": 0,
"version": "<service_version>"
}
プールの削除
プールを削除すると、プールに関連するサーバーエントリーがすべて削除されます。プールを削除するには、ターミナルアプリケーションで以下の API コールを行います。
1
$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" -X DELETE https://api.fastly.com/service/<service_id>/version/<service_version>/pool/<pool_name>
レスポンスは以下のようになります。
1
2
3
{
"status":"ok"
}