Dynamic Servers を使ったプールの作成と使用

Fastly のロードバランサーでは、Fastly のダイナミックサーバー機能を利用し、動的な管理が可能なオリジンサーバーのプールを作成し、受信したリクエストを分散、転送することができます。プールは、オリジンサーバーのグループ間のリクエストをバランスを分配する役割を果たします。ロードバランシングに加えて、失敗したリクエストを再試行するようにプールを設定できます。プールには、停止したオリジンサーバーが再起動した際の問題を防ぐために、プール全体が up として扱われるタイミングを決定するクォーラム設定があります。

重要

この情報は、限定公開されているリリースの一部に関するものです。詳細については、製品と機能のライフサイクルの説明をご覧ください。

プールの作成

Dynamic Servers の使用を開始するには、ロックが解除済みでまだ有効化されていないサービスバージョン内に、空のプールを作成する必要があります。ターミナルアプリケーションで以下の API コールを行います。

$ 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 "between_bytes_timeout": "10000",
3 "comment": "<comment>",
4 "connect_timeout": "1000",
5 "created_at": "2016-08-01T14:43:22+00:00",
6 "deleted_at": null,
7 "first_byte_timeout": "15000",
8 "healthcheck": null,
9 "id": "2IpWU5CGzPpbpGsABSDops",
10 "max_conn_default": "200",
11 "max_tls_version": null,
12 "min_tls_version": null,
13 "name": "<pool_name>",
14 "quorum": "75",
15 "request_condition": null,
16 "service_id": "<service_id>",
17 "shield": null,
18 "tls_ca_cert": null,
19 "tls_cert_hostname": null,
20 "tls_check_cert": 1,
21 "tls_ciphers": null,
22 "tls_client_cert": null,
23 "tls_client_key": null,
24 "tls_sni_hostname": null,
25 "type": "random",
26 "updated_at": "2016-08-01T14:43:22+00:00",
27 "use_tls": 0,
28 "version": "<service_version>"
29}

少なくとも1つのオリジンサーバーを追加した後、プールに関連付けられた最新バージョンを有効化してください。

注意

各 Fastly サービスに対して、最大5つのオリジンサーバーを設定することができます。アカウントで各サービスに対して5つ以上のオリジンサーバーを有効にする場合は、sales@fastly.comにお問い合わせください。

プールの確認

特定のサービスバージョンに付加されたすべてのプールのリストを表示するには、ターミナルアプリケーションで以下の API コールを行います。

$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool

以下のようなレスポンスが返されます。

1[
2{
3 "between_bytes_timeout": "10000",
4 "comment": "just my first pool",
5 "connect_timeout": "1000",
6 "created_at": "2016-08-01T14:43:22+00:00",
7 "deleted_at": null,
8 "first_byte_timeout": "15000",
9 "healthcheck": null,
10 "id": "2IpWU5CGzPpbpGsABSDops",
11 "max_conn_default": "200",
12 "max_tls_version": null,
13 "min_tls_version": null,
14 "name": "SP_Prod_Pool_1",
15 "quorum": "75",
16 "request_condition": null,
17 "service_id": "<service_id>",
18 "shield": null,
19 "tls_ca_cert": null,
20 "tls_cert_hostname": null,
21 "tls_check_cert": 1,
22 "tls_ciphers": null,
23 "tls_client_cert": null,
24 "tls_client_key": null,
25 "tls_sni_hostname": null,
26 "type": "random",
27 "updated_at": "2016-08-01T14:43:22+00:00",
28 "use_tls": 0,
29 "version": "<service_version>"
30}
31]

特定のサービスバージョンに付加された単一のプール (この例では SP_Prod_Pool_1) に関する情報を確認するには、ターミナルアプリケーションで以下の API コールを行います。

$ curl -vs -H "Fastly-Key: FASTLY_API_TOKEN" https://api.fastly.com/service/<service_id>/version/<service_version>/pool/<pool_name>

以下のようなレスポンスが返されます。

1{
2 "between_bytes_timeout": "10000",
3 "comment": "just my first pool",
4 "connect_timeout": "1000",
5 "created_at": "2016-08-01T14:43:22+00:00",
6 "deleted_at": null,
7 "first_byte_timeout": "15000",
8 "healthcheck": null,
9 "id": "2IpWU5CGzPpbpGsABSDops",
10 "max_conn_default": "200",
11 "max_tls_version": null,
12 "min_tls_version": null,
13 "name": "SP_Prod_Pool_1",
14 "quorum": "75",
15 "request_condition": null,
16 "service_id": "<service_id>",
17 "shield": null,
18 "tls_ca_cert": null,
19 "tls_cert_hostname": null,
20 "tls_check_cert": 1,
21 "tls_ciphers": null,
22 "tls_client_cert": null,
23 "tls_client_key": null,
24 "tls_sni_hostname": null,
25 "type": "random",
26 "updated_at": "2016-08-01T14:43:22+00:00",
27 "use_tls": 0,
28 "version": "<service_version>"
29}

プールの削除

プールを削除すると、プールに関連するサーバーエントリーがすべて削除されます。プールを削除するには、ターミナルアプリケーションで以下の API コールを行います。

$ 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 "status":"ok"
3}

翻訳についての注意事項
このガイドは役に立ちましたか?

このフォームを使用して機密性の高い情報を送信しないでください。サポートが必要な場合は、サポートチームまでご連絡ください