XRegionサービスの構成
複数リージョンOracle NoSQL DatabaseでXRegionサービスを構成する方法について学習します
MR表を作成する前に、XRegionサービスをデプロイする必要があります。簡単に言うと、これはエージェントとも呼ばれます。XRegionサービスはローカルのKVStoreとは独立して実行されるため、ローカルのKVStoreの近くにデプロイすることをお薦めします。エージェントおよびエージェント・グループの詳細は、概要マニュアルのリージョン間サービスを参照してください。
ステップ:
XRegionサービスを構成するには、各リージョンで次のタスクを実行します。
- XRegionサービスのホーム・ディレクトリを作成します。
- ステップ1で作成したホーム・ディレクトリにJSON構成ファイルを作成します。
json.config
ファイルの構造を次に示します。{ "path" : "<entire path to the home directory for the XRegion Service>", "agentGroupSize" : <number of service agents>, "agentId" : <agent id using 0-based numbering>, "region" : "<local region name>", "store" : "<local store name>", "helpers" : [ "<host1>:<port>", "<host2>:<port>", … "<hostn>:<port>" ], "security" : "<entire path to the security file of the local store>", "regions" : [ { "name" : "<remote region name>", "store" : "<remote store name>", "security" : "<entire path to the security file of the remote store>", "helpers" : [ "<host1>:<port>", "<host2>:<port>", … "<hostn>:<port> ] }, { "name" : "<remote region name>", "store" : "<remote store name>", "security" : "<entire path to the security file of the remote store>", "helpers" : [ "<host1>:<port>", "<host2>:<port>", … "<hostn>:<port> ] }, ... ] "durability" : "<durability setting>" }
ここで、
json.config
ファイルの各属性の詳細は次のとおりです。path
これは、XRegionサービスのルート・ディレクトリです。エージェントは、このディレクトリを使用してログ、統計およびその他の補助ファイルをダンプします。ディレクトリはエージェントから読取り可能かつ書込み可能であるものとします。 agentGroupSize
およびagentId
エージェント・グループ内のサービス・エージェントの数およびエージェントIDを指定します。エージェントIDは0から始まる番号として指定します。これらの詳細は、ローカル・リージョンにサービスを提供するエージェントのグループを形成するために使用されます。エージェントのグループを形成することで、水平スケーラビリティが実現されます。 ノート:
現在のリリースでは、ローカル・リージョンごとに1つのサービスのみがサポートされています。したがって、agentGroupSize
を1を設定し、agentId
を0に設定します。security
エージェントで使用されるセキュリティ・ファイルを指定します。この属性は、ローカル・ストアおよびリモート・ストアの両方に対して定義する必要があります。 region
エージェントを構成するリージョンに対して定義されたローカル・リージョン名を指定します。 store
ローカル・リージョン内のストアの名前を指定します。 helpers
ローカル・ストアの構成に使用するホスト番号とポート番号のリストを指定します。これらのヘルパー・ホストは、KVクライアントの作成に使用したものです。XRegionサービスがローカルおよびリモートのリージョンに接続できるようにするには、各リージョンのファイアウォールがレジストリ・ポートおよびHAポートを開くように構成されている必要があります。 regions
ローカル・リージョンを定義した後で、リモート・リージョンのリストを定義する必要があります。MR表を作成するために、少なくとも1つのリモート・リージョンを定義するものとします。 対象として含める各リモート・リージョンのリージョン名、ストア名およびヘルパー・ホストを指定します。
ノート:
このリストで指定するリモート・リージョン名は、それらのリージョンに対応するローカル・リージョン名の定義と一致する必要があります。durability
これはオプション・パラメータです。マスター・コミット同期の永続性設定を指定します。指定できる値は次のとおりです。 COMMIT_NO_SYNC
COMMIT_SYNC
COMMIT_WRITE_NO_SYNC
デフォルトの永続性設定は
COMMIT_NO_SYNC
です。 - XRegionサービス・エージェントに次の権限を付与します。
- システム表に対する書込み権限
- すべてのユーザー表に対する読取りおよび書込み権限
— create role for the agent -- CREATE ROLE <Agent Role> — grant privileges to the role -- GRANT WRITE_SYSTEM_TABLE to <Agent Role> GRANT READ_ANY_TABLE to <Agent Role> GRANT INSERT_ANY_TABLE to <Agent Role> — grant role to the agent user -- GRANT <Agent Role> to user <Agent User>
ノート:
このステップはセキュアなKVStoreの場合にのみ必要です。非セキュアなKVStoreの設定では、このステップをスキップできます。
次に例を示します。
提案されたリージョン(フランクフルトおよびロンドン)ごとにjson.config
ファイルを作成します。
# Contents of the configuration file in the 'fra' Region
{
"path": "<path to the json config file>",
"agentGroupSize": 1,
"agentId": 0,
"region": "fra",
"store": "<storename at the fra region>",
"security": "<path to the security file>",
"helpers": [
"host1:5000",
"host2:5000",
"host3:5000"
],
"regions": [
{
"name": "lnd",
"store": "<storename at the lnd region>",
"security": "<path to the security file>",
"helpers": [
"host4:5000",
"host5:5000",
"host6:5000"
]
}
]
}
# Contents of the configuration file in the 'lnd' Region
{
"path": "<path to the json config file>",
"agentGroupSize": 1,
"agentId": 0,
"region": "lnd",
"store": "<storename at the lnd region>",
"security": "<path to the security file>",
"helpers": [
"host4:5000",
"host5:5000",
"host6:5000"
],
"regions": [
{
"name": "fra",
"store": "<storename at the fra region>",
"security": "<path to the security file>",
"helpers": [
"host1:5000",
"host2:5000",
"host3:5000"
]
}
]
}