Removing a Storage Group from a Storage Manager

Removing a storage group can be done with the NuoDB Manager remove storageGroup command. This command takes three arguments: the name of the storage group, the host on which the SM is running, and the process ID (pid) of the SM on that host.

The following example removes the storage group SG1 from the SM running on 52.11.92.215.

nuodb [domain] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=10] SG1 Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:
 
nuodb [domain] > remove storageGroup
Storage group name: sg1
Host: 52.11.92.215
Process ID: 27854
Success
nuodb [domain] > show storageGroups
Database: test
  [id=2] UNPARTITIONED Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
    [SM] ip-172-31-0-68/52.11.92.215:48005 (us-west-2) [ pid = 27854 ] [ nodeId = 1 ] RUNNING
 
  [id=10] SG1 Available
    Serviced by:
    [SM] ip-172-31-0-24/52.25.11.202:48006 (us-west-2) [ pid = 25950 ] [ nodeId = 3 ] RUNNING
 
  [id=1] ALL Available
    Serviced by:

Removing the association between a storage group and an SM when the SM is the last one servicing the storage group is possible only if the storage group is empty. Otherwise you will get an error:

nuodb [domain] > remove storageGroup 
Storage group name: sg1
Host: 52.11.92.215
Process ID: 4374
remove: Failed to remove storage group: The last storage group cannot be removed because it is in use by the following tables: {Schema: USER, Table: USERS}