Amazon Keyspaces (for Apache Cassandra) および Application Auto Scaling
ターゲット追跡スケーリングポリシーとスケジュールされたスケーリングを使用して、Amazon Keyspaces tables をスケールできます。
Amazon Keyspaces と Application Auto Scaling の統合には、次の情報を参考にしてください。
Amazon Keyspaces tables のスケーリングを始めたばかりの場合は、以下のドキュメントで、Application Auto Scaling での Amazon Keyspaces の使用に関するサンプル設定と詳細を確認できます。
-
Managing Amazon Keyspaces throughput capacity with Application Auto Scaling in the Amazon Keyspaces (for Apache Cassandra) Developer Guide
Amazon Keyspaces 向けに作成されたサービスリンクロール
The following service-linked role is automatically created in your AWS account when registering Amazon Keyspaces resources as scalable targets with Application Auto Scaling. This role allows Application Auto Scaling to perform supported operations within your account. For more information, see Application Auto Scaling のサービスリンクロール.
-
AWSServiceRoleForApplicationAutoScaling_CassandraTable
サービスリンクロールが使用するサービスプリンシパル
The service-linked role in the previous section can be assumed only by the service principal authorized by the trust relationships defined for the role. The service-linked role used by Application Auto Scaling grants access to the following service principal:
-
cassandra.application-autoscaling.amazonaws.com
スケーラブルターゲットとしての Amazon Keyspaces tables の Application Auto Scaling への登録
Application Auto Scaling では、Amazon Keyspaces テーブルのスケーリングポリシーまたはスケジュールされたアクションを作成する前に、スケーラブルターゲットが必要になります。スケーラブルターゲットとは、Application Auto Scaling がスケールアウトまたはスケールインできるリソースです。スケーラブルターゲットは、リソース ID、スケーラブルディメンション、および名前空間の組み合わせによって一意に識別されます。
Amazon Keyspaces コンソールを使用してオートスケーリングを設定すると、Amazon Keyspaces がユーザーに代わってスケーラブルターゲットを自動的に登録します。
AWS CLI または AWS SDK の 1 つを使用してオートスケーリングを設定する場合は、次のオプションを使用できます。
-
AWS CLI:
Amazon Keyspaces テーブルのために register-scalable-target コマンドを呼び出します。以下の例は、最小容量を 5 個の書き込みキャパシティーユニット、最大容量を 10 個の書き込みキャパシティーユニットとして、
mytable
と呼ばれるテーブルのプロビジョニングされた書き込みキャパシティーを登録します。aws application-autoscaling register-scalable-target \ --service-namespace cassandra \ --scalable-dimension cassandra:table:WriteCapacityUnits \ --resource-id keyspace/
mykeyspace
/table/mytable
\ --min-capacity5
\ --max-capacity10
以下の例は、最小容量を 5 個の読み取りキャパシティーユニット、最大容量を 10 個の読み取りキャパシティーユニットとして、
mytable
と呼ばれるテーブルのプロビジョニングされた読み取りキャパシティーを登録します。aws application-autoscaling register-scalable-target \ --service-namespace cassandra \ --scalable-dimension cassandra:table:ReadCapacityUnits \ --resource-id keyspace/
mykeyspace
/table/mytable
\ --min-capacity5
\ --max-capacity10
-
AWS SDK:
RegisterScalableTargetオペレーションを呼び出し、
ResourceId
、ScalableDimension
、ServiceNamespace
、MinCapacity
、およびMaxCapacity
をパラメータとして指定します。