Adding a Storage Group Using the storage-group Database Option

The storage-group database option may be specified when starting and initializing an SM. A database option may be set or modified using the Automation Console, NuoDB Manager, or the REST API. See Database Options for more information.

# In this example, there are four hosts in the domain.
nuodb [domain] > show domain summary
 
Hosts:
[broker] * ec2-52-24-143-83.us-west-2.compute.amazonaws.com/52.24.143.83:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-24/52.25.11.202:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-68/52.11.92.215:48004 (us-west-2) CONNECTED
[broker] ip-172-31-14-56/52.25.88.188:48004 (us-west-2) CONNECTED
 
# Start a storage manager with no storage-group option.
nuodb [domain] > start process sm
Database: test
Host: 52.24.143.83
Process command-line options (optional): 
Archive directory: /var/opt/nuodb/production-archives/test
Initialize archive (optional): true
Started: [SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ db = test ] [ nodeId = 1 ] ACTIVE

# Start a TE.
nuodb [domain/test] > start process te
Host: 52.24.143.83
Process command-line options (optional): dba-user dba dba-password dba
Started: [TE] ip-172-31-14-171/52.24.143.83:48006 (us-west-2) [ pid = 26819 ] [ db = test ] [ nodeId = 3 ] ACTIVE

nuodb [domain/test] > show domain summary
 
Hosts:
[broker] * ec2-52-24-143-83.us-west-2.compute.amazonaws.com/52.24.143.83:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-24/52.25.11.202:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-68/52.11.92.215:48004 (us-west-2) CONNECTED
[broker] ip-172-31-14-56/52.25.88.188:48004 (us-west-2) CONNECTED
 
Database: test, (unmanaged), processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-14-171/52.24.143.83:48006 (us-west-2) [ pid = 26819 ] [ nodeId = 3 ] RUNNING
 
# Observe that there is one SM servicing the UNPARTITIONED Storage Group.
nuodb [domain/test] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:
 
# Start another SM/TE pair in the same way.
nuodb [domain/test] > start process sm
Host: 52.25.11.202
Process command-line options (optional): 
Archive directory: /var/opt/nuodb/production-archives/test
Initialize archive (optional): true
Started: [SM] ip-172-31-0-24/52.25.11.202:48005 (us-west-2) [ pid = 8365 ] [ db = test ] [ nodeId = 4 ] ACTIVE
nuodb [domain/test] > start process te
Host: 52.25.11.202
Process command-line options (optional): dba-user dba dba-password dba
Started: [TE] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 8398 ] [ db = test ] [ nodeId = 5 ] ACTIVE

nuodb [domain/test] > show domain summary
 
Hosts:
[broker] * ec2-52-24-143-83.us-west-2.compute.amazonaws.com/52.24.143.83:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-24/52.25.11.202:48004 (us-west-2) CONNECTED
[broker] ip-172-31-0-68/52.11.92.215:48004 (us-west-2) CONNECTED
[broker] ip-172-31-14-56/52.25.88.188:48004 (us-west-2) CONNECTED
 
Database: test, (unmanaged), processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-14-171/52.24.143.83:48006 (us-west-2) [ pid = 26819 ] [ nodeId = 3 ] RUNNING
[SM] ip-172-31-0-24/52.25.11.202:48005 (us-west-2) [ pid = 8365 ] [ nodeId = 4 ] RUNNING
[TE] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 8398 ] [ nodeId = 5 ] RUNNING
 
# Now there are two SMs servicing the UNPARTITIONED Storage Group.
nuodb [domain/test] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48005 (us-west-2) [ pid = 8365 ] [ nodeId = 4 ] RUNNING
    [SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:
 
# Start an SM that will service all Storage Groups in the test database.
nuodb [domain/test] > start process sm
Host: 52.11.92.215
Process command-line options (optional): storage-group all
Archive directory: /var/opt/nuodb/production-archives/test
Initialize archive (optional): true
Started: [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ db = test ] [ nodeId = 6 ] ACTIVE

# Now there are three SMs servicing the UNPARTITIONED Storage Group, one of which does so because it services all Storage Groups.
nuodb [domain/test] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ nodeId = 6 ] RUNNING
    [SM] ip-172-31-0-24/52.25.11.202:48005 (us-west-2) [ pid = 8365 ] [ nodeId = 4 ] RUNNING
    [SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ nodeId = 6 ] RUNNING
 
# Start an SM that services a Storage Group named SG1.
nuodb [domain/test] > start process sm
Host: 52.25.88.188
Process command-line options (optional): storage-group sg1
Archive directory: /var/opt/nuodb/production-archives/test
Initialize archive (optional): true
Started: [SM] ip-172-31-14-56/52.25.88.188:48005 (us-west-2) [ pid = 26948 ] [ db = test ] [ nodeId = 7 ] ACTIVE

# Now, UNPARTITIONED is serviced by all SMs (this is always true), SG1 is serviced by the SM started with storage-group all and the SM started with storage-group sg1, and All Storage Groups are serviced by the SM started with storage-group all.
nuodb [domain/test] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-14-56/52.25.88.188:48005 (us-west-2) [ pid = 26948 ] [ nodeId = 7 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ nodeId = 6 ] RUNNING
    [SM] ip-172-31-0-24/52.25.11.202:48005 (us-west-2) [ pid = 8365 ] [ nodeId = 4 ] RUNNING
    [SM] ip-172-31-14-171/52.24.143.83:48005 (us-west-2) [ pid = 26779 ] [ nodeId = 1 ] RUNNING
 
  [id=10] SG1 Available
    Serviced by:
    [SM] ip-172-31-14-56/52.25.88.188:48005 (us-west-2) [ pid = 26948 ] [ nodeId = 7 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ nodeId = 6 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 3916 ] [ nodeId = 6 ] RUNNING

Here we see an example of a storage group defined to more than one storage manager.

nuodb [nuotest/test] > show domain summary
 
Hosts:
[broker] * nuotest01/nuotest01:48004 (US_EAST) CONNECTED
[broker] nuotest02/fe80:0:0:0:a00:27ff:fe0a:aef7%2:48004 (US_EAST) CONNECTED
 
Database: test, (unmanaged), processes [2 TE, 2 SM], ACTIVE
[SM] nuotest01/nuotest01:48005 (US_EAST) [ pid = 2204 ] [ nodeId = 1 ] RUNNING
[TE] nuotest01/nuotest01:48006 (US_EAST) [ pid = 2334 ] [ nodeId = 5 ] RUNNING
[TE] nuotest01/nuotest01:48007 (US_EAST) [ pid = 2603 ] [ nodeId = 6 ] RUNNING
[SM] nuotest01/nuotest01:48008 (US_EAST) [ pid = 16990 ] [ nodeId = 7 ] RUNNING

nuodb [nuotest/test] > add storageGroup
Storage group name: sg1
Host: nuotest01
Process ID: 2204
Success
nuodb [nuotest/test] > show storageGroups
Database: test
  [id=1] ALL Available
    No Leader Candidates.

  [id=2] UNPARTITIONED Available
    Leader Candidates:
    [SM] nuotest01/nuotest01:48005 (US_EAST) [ pid = 2204 ] [ nodeId = 1 ] RUNNING
    [SM] nuotest01/nuotest01:48008 (US_EAST) [ pid = 16990 ] [ nodeId = 7 ] RUNNING
  
  [id=10] SG1 Available
    Leader Candidates:
    [SM] nuotest01/nuotest01:48005 (US_EAST) [ pid = 2204 ] [ nodeId = 1 ] RUNNING

nuodb [nuotest/test] > add storageGroup
Storage group name: sg1
Host: nuotest01
Process ID: 16990
Success
nuodb [nuotest/test] > show storageGroups
Database: test

[id=1] ALL Available
    No Leader Candidates.

  [id=2] UNPARTITIONED Available
    Leader Candidates:
    [SM] nuotest01/nuotest01:48005 (US_EAST) [ pid = 2204 ] [ nodeId = 1 ] RUNNING
    [SM] nuotest01/nuotest01:48008 (US_EAST) [ pid = 16990 ] [ nodeId = 7 ] RUNNING
  
  [id=10] SG1 Available
    Leader Candidates:
    [SM] nuotest01/nuotest01:48005 (US_EAST) [ pid = 2204 ] [ nodeId = 1 ] RUNNING
    [SM] nuotest01/nuotest01:48008 (US_EAST) [ pid = 16990 ] [ nodeId = 7 ] RUNNING