Shutting Down the Redundant Storage Manager

Before shutting down a redundant SM in a minimally redundant database, you want to ensure that the enforcerThe enforcer is a process that runs in each broker in the domain. The enforcer compares the state of the domain against the requirements for the database(s) or against the template(s) used to create the database(s). On only the leader broker, the enforcer starts additional processes as needed. does not start a new SM in its place. Therefore, you need to temporaritly change the database requirements such that the min value for storage mangers does not require the SM being shut down to start again.

In a minimally redundant database, both the max and min settings for storage managers is 2. Set these both to 1 and the enforcer will not restart the SM being shut down. For example:

In NuoDB Manager, to ensure that the enforcer does not start a storage manager to replace the one you shut down, update the template variables SM_MAX and SM_MIN:

nuodb [domain] > update database
Database Name: test2

Template Name (Single Host, Minimally Redundant, Multi Host, Region distributed): Minimally Redundant

Template Variables (optional): SM_MAX 1 SM_MIN 1

Database Options (optional): 

Template Variable REGION (default: DEFAULT_REGION): us-east-1

Database Options for SMs (optional): 

Tag Constraints for SMs (optional): 

Database Options for TEs (optional): 

Tag Constraints for TEs (optional): 

For a multi host database that is running on at least three hosts, you want to guard against a situation in which the enforcer tries to start a storage manager on the host on which you shut down the storage manager to perform the backup. For example, suppose your database is running on hosts A, B, and C. You want to shut down the storage manager on host C so you can make a back-up copy. While you are making the copy, if the storage manager on host A or host B terminates then the enforcer tries to start a storage manager. You want to ensure that the enforcer does not try to start a storage manager on host C. To do this, you disable enforcement on host C. For example, invoke the NuoDB Manager disable enforcer command:

disable enforcer host C

To shut down the SM in the Automation Console, select the SM process in the Processes panel, and click Actions | Delete in the upper right corner. For example:

To shut down the SM in NuoDB Manager:

nuodb [domain] > show domain summary

Hosts:
[broker] * ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
[broker] ip-172-31-46-122/54.165.58.157:48004 (us-east-1)

Database: test, template [Minimally Redundant] UNMET, processes [2 TE, 1 SM], ACTIVE
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23120 ] [ nodeId = 4 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23242 ] [ nodeId = 5 ] RUNNING
[SM] ip-172-31-46-122/54.165.58.157:48007 (us-east-1) [ pid = 8151 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-46-122/54.165.58.157:48008 (us-east-1) [ pid = 8167 ] [ nodeId = 2 ] RUNNING

nuodb [domain] > shutdown process
Host: 107.23.52.10:48006
Process ID: 23242
Shutdown gracefully: yes
Process shutdown cleanly

nuodb [domain] > show domain summary

Hosts:
[broker] * ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
[broker] ip-172-31-46-122/54.165.58.157:48004 (us-east-1)

Database: test, template [Minimally Redundant] UNMET, processes [2 TE, 1 SM], ACTIVE
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23120 ] [ nodeId = 4 ] RUNNING
[SM] ip-172-31-46-122/54.165.58.157:48007 (us-east-1) [ pid = 8151 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-46-122/54.165.58.157:48008 (us-east-1) [ pid = 8167 ] [ nodeId = 2 ] RUNNING