Set Local Region Name

Learn how to set a name to the local region in a Multi-Region NoSQL Database.

After deploying the KVStore and before creating the first MR Table in each participating region, you must set a local region name. You can change the local region name as long as no MR Tables are created in that region. After creating the first MR Table, the local region name becomes immutable.

Steps:

To set the local region name:

  1. Connect to the sql prompt from the local region, and connect to the local KVStore.
  2. Execute the following command from the sql prompt.
    sql-> SET LOCAL REGION <local region name>;
  3. Optionally, you can execute the following command to verify that the local region name is set successfully.
    sql-> SHOW REGIONS;

Example:

Set the local region name for the two proposed regions, Frankfurt and London.

# Connect to the KVStore deployed at host1, host2, and host3 from the SQL shell
[~]$java -jar $KVHOME/lib/sql.jar \
-helper-hosts host1:5000,host2:5000,host3:5000 \
-store mrtstore

-- Set the local region name to 'fra'
sql-> SET LOCAL REGION fra;
Statement completed successfully

-- List the regions
sql-> SHOW REGIONS;
regions
    fra (local, active)
# Connect to the KVStore deployed at host4, host5, and host6 from the SQL shell
[~]$java -jar $KVHOME/lib/sql.jar \
-helper-hosts host4:5000,host5:5000,host6:5000 \
-store mrtstore

-- Set the local region name to 'lnd'
sql-> SET LOCAL REGION lnd;
Statement completed successfully

-- List the regions
sql-> SHOW REGIONS;
regions
    lnd (local, active)