Learn to create remote regions from each region in a Multi-Region NoSQL Database.
Before creating and operating on an MR table, you must define the remote regions. You have already set the local region name for each region, in an earlier step. In this step, you define all the remote regions for each region. A remote region is different from the local region where the command is executed.
To create the remote regions:
- Connect to the
sqlprompt from the local region, and connect to the local KVStore.
- Execute the following command from the
sql-> CREATE REGION <remote region name>;
- Optionally, you can execute the following command to list the remote regions
that are created
sql-> SHOW REGIONS;
Create the remote regions in both the regions, Frankfurt and London.
# 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)