DB シャードグループの操作 - Amazon Aurora

DB シャードグループの操作

Aurora PostgreSQL Limitless Database の DB シャードグループを追加および管理するには、次のタスクを実行します。

Aurora PostgreSQL Limitless Database DB クラスターへの接続

Aurora PostgreSQL Limitless Database を操作するには、クラスターライターまたはリーダーエンドポイントに接続します。psql または PostgreSQL で動作するその他の接続ユーティリティを使用できます。

$ psql -h DB_cluster_endpoint -p port_number -U database_username -d postgres_limitless

次の例では、CLI で作成した DB クラスターの エンドポイントを使用します。

$ psql -h my-limitless-cluster.cluster-ckifpdyyyxxx.us-east-1.rds.amazonaws.com -p 5432 -U postgres -d postgres_limitless
注記

Aurora PostgreSQL Limitless Database の DB シャードグループのデフォルトのデータベースは postgres_limitless です。

Limitless 接続プラグインの使用

Aurora PostgreSQL Limitless Database に接続する際、クライアントはクラスターエンドポイントを使用して接続し、Amazon Route 53 によってトランザクションルーターにルーティングされます。ただし、Route 53 の負荷分散機能には制限があり、トランザクションルーターのワークロードが不均等になる可能性があります。AWS JDBC ドライバー用の Limitless 接続プラグインは、負荷を考慮してクライアント側の負荷分散を実行することで、この問題に対処します。AWSJDBC ドライバーの詳細については、「Amazon Web Services (AWS) JDBC ドライバーを使用した Aurora PostgreSQL への接続」を参照してください。

DB シャードグループ内のルーターとシャードの数を確認する

次のクエリを使用して、ルーターとシャードの数を確認できます。

SELECT * FROM rds_aurora.limitless_subclusters; subcluster_id | subcluster_type ---------------+----------------- 1 | router 2 | router 3 | shard 4 | shard 5 | shard 6 | shard

DB シャードグループの記述

describe-db-shard-groups の AWS CLI コマンドを使用して DB シャードグループを記述します。次のパラメータはオプションです。

  • --db-shard-group-identifier – DB シャードグループの名前。

次の例では、特定の DB シャードグループを記述します。

aws rds describe-db-shard-groups --db-shard-group-identifier my-db-shard-group

出力は以下の例のようになります。

{ "DBShardGroups": [ { "DBShardGroupResourceId": "shardgroup-8986d309a93c4da1b1455add17abcdef", "DBShardGroupIdentifier": "my-shard-group", "DBClusterIdentifier": "my-limitless-cluster", "MaxACU": 1000.0, "ComputeRedundancy": 0, "Status": "available", "PubliclyAccessible": false, "Endpoint": "my-limitless-cluster.limitless-ccetp2abcdef.us-east-1.rds.amazonaws.com" } ] }

DB シャードグループの再起動

最大容量の変更により max_connections パラメータが変更された場合など、DB シャードグループを再起動する必要があることがあります。

AWS Management Console または AWS CLI を使用して、DB シャードグループの容量を変更できます。

次の手順に従ってください。

AWS Management Console にサインインし、Amazon RDS コンソール (https://console.aws.amazon.com/rds/) を開きます。

  1. [データベース] ページに移動します。

  2. 再起動する DB シャードグループを選択します。

  3. [アクション] で、[再起動] を選択します。

  4. [確認] を選択してください。

DB パラメータグループを再起動するには、reboot-db-shard-group の AWS CLI コマンドを使用して、次のパラメータを指定します。

  • --db-shard-group-identifier – DB シャードグループの名前。

次の の例では、DB シャードグループを再起動します。

aws rds reboot-db-shard-group --db-shard-group-identifier my-db-shard-group