リモート・リージョンの作成
複数リージョンNoSQL Databaseの各リージョンからリモート・リージョンを作成する方法を学習します。
MR表を作成して操作する前に、リモート・リージョンを定義する必要があります。各リージョンのローカル・リージョン名は、前のステップですでに設定しています。このステップでは、各リージョンにすべてのリモート・リージョンを定義します。リモート・リージョンは、コマンドが実行されるローカル・リージョンとは異なります。
ステップ:
リモート・リージョンを作成するには、次の手順を実行します。
- ローカル・リージョンから
sql
プロンプトに接続し、ローカルのKVStoreに接続します。 sql
プロンプトから次のコマンドを実行します。sql-> CREATE REGION <remote region name>;
- オプションで、次のコマンドを実行して、正常に作成されたリモート・リージョンを一覧表示できます。
sql-> SHOW REGIONS;
次に例を示します。
フランクフルトとロンドンの両リージョンでリモート・リージョンを作成します。
# Connect to the KVStore deployed in the 'fra' region from the SQL shell
[~]$java -jar $KVHOME/lib/sql.jar \
-helper-hosts host1:5000,host2:5000,host3:5000 \
-store mrtstore
–- Create a remote region 'lnd'
sql-> CREATE REGION lnd;
Statement completed successfully
– List the regions
sql-> SHOW REGIONS;
regions
fra (local, active)
lnd (remote, active)
# Connect to the KVStore deployed in the 'lnd' region from the SQL shell
[~]$java -jar $KVHOME/lib/sql.jar \
-helper-hosts host4:5000,host5:5000,host6:5000 \
-store mrtstore
–- Create a remote region 'fra'
sql-> CREATE REGION fra;
Statement completed successfully
– List the regions
sql-> SHOW REGIONS;
regions
lnd (local, active)
fra (remote, active)