Configure XRegion Service

Learn how to configure the XRegion Service in a Multi-Region Oracle NoSQL Database

Before creating any MR Table, you must deploy an XRegion Service. In simple terms, this is also called an agent. The XRegion Service runs independently with the local KVStore and it is recommended to deploy it close to the local KVStore. To know more about agent and agent groups, see Cross-Region Service in the Concepts Guide.

Steps:

To configure the XRegion Service, execute the following tasks in each region:

  1. Create a home directory for the XRegion Service.
  2. Create a JSON config file in the home directory created in the step 1. The structure of the json.config file is shown below.
    {
      "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>"
    }

    Where each attribute in the json.config file is explained below:

  3. Grant the following privileges to the XRegion Service Agent:
    • Write permission to system table
    • Read and Write permission to all the user tables
    — 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>

    Note:

    This step is required only for secure KVStores. In a non-secure KVStore setup, this step can be skipped.

Example:

Create a json.config file for each proposed region, Frankfurt and London.

# 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"
      ]
    }
  ]
}