XRegionサービスの構成

複数リージョンOracle NoSQL DatabaseでXRegionサービスを構成する方法について学習します

MR表を作成する前に、XRegionサービスをデプロイする必要があります。簡単に言うと、これはエージェントとも呼ばれます。XRegionサービスはローカルのKVStoreとは独立して実行されるため、ローカルのKVStoreの近くにデプロイすることをお薦めします。エージェントおよびエージェント・グループの詳細は、概要マニュアルリージョン間サービスを参照してください。

ステップ:

XRegionサービスを構成するには、各リージョンで次のタスクを実行します。

  1. XRegionサービスのホーム・ディレクトリを作成します。
  2. ステップ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ファイルの各属性の詳細は次のとおりです。

  3. 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"
      ]
    }
  ]
}