Previous Next JavaScript must be enabled to correctly display this content

## Create Remote Regions

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.

Steps:

To create the remote regions:

1. Connect to the `sql` prompt from the local region, and connect to the local data store.
2. Execute the following command from the `sql` prompt.

       sql-> CREATE REGION <remote region name>;

3. Optionally, you can execute the following command to list the remote regions that are created successfully.

       sql-> SHOW REGIONS;

Example:

Create the remote regions in both the regions, Frankfurt and London.

    # Connect to the data store 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 data store 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)