サービス・インスタンスの監視
次の手順で説明するように、REST APIを使用してOracle Java Cloud Serviceインスタンスの状態を監視できます。
注意: cURLコマンドの例では、URL構造https://rest_server_url/resource-pathが使用されています。ここで、rest_server_urlはアイデンティティ・ドメインまたはテナント名を問い合せるためのOracle Public CloudまたはOracle Cloud MachineのRESTサーバーです。 Oracle Public CloudまたはOracle Cloud Machineに使用する適切なURL構造の詳細は、リクエストの送信を参照してください。
Oracle Java Cloud Serviceインスタンスを監視するには、次の手順を実行します。
- Oracle Java Cloud Serviceインスタンスを監視する前に、監視するサービス・インスタンスを識別する、現存するサービス・インスタンスを確認します。
curl -i -X GET -u username:userPassword1! -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/service/jcs/api/v1.1/instances/ExampleIdentityDomain
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(GET)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
詳細は、「すべてのサービス・インスタンスの表示」を参照してください。
レスポンス本文の例を次に示します。 この例には、2つのサービス・インスタンスがあります。
{ "uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain", "service_type":"jaas", "implementation_version":"1.0", "services":[ { "service_name":"ExampleInstance", "version":"12cR3", "wlsVersion":"12.1.3.0.xxxxxx", "status":"Running", "error_status_desc":"", "compliance_status":"", "compliance_status_desc":"", "auto_update":"true", "description":"Example Instance created using REST API", "identity_domain":"ExampleIdentityDomain", "creation_time":"Mon Jun 6 19:37:41 UTC 2016", "last_modified_time":"Sat Jul 2 7:10:35 UTC 2016", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/ExampleInstance" }, { "service_name":"My1221Instance", "version":"12cRelease2", "wlsVersion":"12.2.1.0.xxxxxx", "status":"Running", "error_status_desc":"", "compliance_status":"", "compliance_status_desc":"", "auto_update":"true", "description":"desc", "identity_domain":"ExampleIdentityDomain", "creation_time":"Tue Jun 7 21:22:20 UTC 2016", "last_modified_time":"Sat Jul 2 9:10:25 UTC 2016", "created_by":"username", "service_uri":"https:\/\/rest_server_url\/paas\/service\/jcs\/api\/v1.1\/instances\/ExampleIdentityDomain\/My1221Instance" } ] }
- 次のコマンドを入力して、ExampleInstanceサービス・インスタンスを監視します。
curl -i -X GET -u username:userPassword1! -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/core/api/v1.1/healthcheck/ExampleIdentityDomain/services/jaas/instances/ExampleInstance
cURLコマンドラインで次のオプションを指定します。
出力にHTTPヘッダーを含める-iオプション。 このオプションは省略可能です。
リクエストのタイプ(GET)を指定する-Xオプション。
認証のためのOracle Java Cloud Serviceアカウントのユーザー名とパスワードを指定する-uオプション。
アイデンティティ・ドメインIDまたはテナント名を識別するカスタム・ヘッダーX-ID-TENANT-NAMEを定義する-H。
詳細は、「サービス・インスタンスの監視」を参照してください。
Oracle Public Cloudでのレスポンス本文の例を次に示します。
{ "summary": { "status":"UP", "status_time":"2016-11-17T20:23:20.029+00:00" }, "identity_domain":"ExampleIdentityDomain", "service_components":[ { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:11.000+00:00" }, "component":"OTD", "vms":[ { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:18.511+00:00" }, "vm":"exampleinstance-lb-1", "servers":[] }], "health_data":[ { "unit":"count", "name":"requestCount", "value":"2", "displayName":"Execution t" }, { "unit":"count", "name":"errorRequestCount", "value":"0", "displayName":"Execution t" }, { "unit":"ms", "name":"epsLast5MinAvg", "value":"0", "displayName":"Execution time" }, { "unit":"ms", "name":"upsince", "value":"2016-11-17T19:53:16.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"ms", "name":"rtLast5MinAvg", "value":"0", "displayName":"Execution t" }] }, { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:10.000+00:00", "status_message":"Number of servers processing request:1" }, "component":"WLS", "vms":[ { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:18.511+00:00" }, "vm":"exampleinstance-wls-1", "servers":[ { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:10.000+00:00" }, "server_name":"ExampleI_server_1", "server_role":"MANAGED", "health_data":[ { "unit":"MB", "name":"heapmax", "value":"1820.5", "displayName":"Max memory" }, { "unit":"ms", "name":"upsince", "value":"2016-11-17T19:56:14.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"MB", "name":"heapfree", "value":"1328.96", "displayName":"Free memory" }] }, { "summary": { "status":"UP", "status_time":"2016-11-17T20:23:10.000+00:00", "status_message":"Not processing requests" }, "server_name":"ExampleI_adminserver", "server_role":"ADMIN", "health_data":[ { "unit":"MB", "name":"heapmax", "value":"1820.5", "displayName":"Max memory" }, { "unit":"ms", "name":"upsince", "value":"2016-11-17T17:50:22.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"MB", "name":"heapfree", "value":"1146.91", "displayName":"Free memory" }] }] }] }], "service_name":"ExampleInstance" }
Oracle Cloud Machineでのレスポンス本文の例を次に示します。
{ "summary": { "status":"UP", "status_time":"2016-07-28T20:16:41.829+00:00" }, "identity_domain":"ExampleIdentityDomain", "service_components":[ { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:29.000+00:00" }, "component":"OTD", "vms":[ { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:35.302+00:00" }, "vm":"exampleinstance-lb-1", "servers":[] }], "health_data":[ { "unit":"count", "name":"requestCount", "value":"14", "displayName":"Execution time" }, { "unit":"count", "name":"errorRequestCount", "value":"0", "displayName":"Execution time" }, { "unit":"ms", "name":"epsLast5MinAvg", "value":"0", "displayName":"Execution time" }, { "unit":"ms", "name":"upsince", "value":"2016-07-28T19:05:00.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"ms", "name":"rtLast5MinAvg", "value":"0", "displayName":"Execution time" }] }, { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:28.000+00:00", "status_message":"Number of servers processing request:2" }, "component":"WLS", "vms":[ { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:35.302+00:00" }, "vm":"exampleinstance-wls-2", "servers":[ { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:28.000+00:00" }, "server_name":"ExampleI_server_2", "server_role":"MANAGED", "health_data":[ { "unit":"ms", "name":"upsince", "value":"2016-07-28T19:32:28.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"MB", "name":"heapfree", "value":"1201.53", "displayName":"Free memory" }, { "unit":"MB", "name":"heapmax", "value":"1820.5", "displayName":"Max memory" }] }] }, { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:35.302+00:00" }, "vm":"exampleinstance-wls-1", "servers":[ { "summary": { "status":"UP", "status_time":"2016-07-28T20:16:28.000+00:00" }, "server_name":"ExampleI_server_1", "server_role":"MANAGED", "health_data":[ { "unit":"ms", "name":"upsince", "value":"2016-07-28T19:31:33.000+00:00", "displayName":"Server time from when it was up." }, { "unit":"MB", "name":"heapfree", "value":"1256.14", "displayName":"Free memory" }, { "unit":"MB", "name":"heapmax", "value":"1820.5", "displayName":"Max memory" }] }] }] }], "service_name":"ExampleInstance" }
- 状態監視データを確認し、必要に応じて処理を実行します。 次に例を示します。
- サーバーごとに、空きヒープ・サイズ(heapFree)を確認し、値が許容されるしきい値を下回っている場合はノードのスケーリングを検討します。
Oracle Traffic Director (OTD)コンポーネントについて、平均リクエスト時間(rtLast5MinAvg)を確認し、値が許容されるしきい値を上回っている場合はクラスタのスケーリングを検討します。
サービス・インスタンスのスケーリングの詳細は、「サービス・インスタンスのスケーリング」を参照してください。