Enable Enforcer

This is a NuoDB Manager command. See NuoDB Manager.

Description

Enable enforcement at either the domain, database, or host level, assuming enforcemement has been disabled with the disable enforcer command (see Disable Enforcer). Enforcement is when the broker compares the state of the domain against the requirements for the database or against the template used to create the database. Enforcement starts additional processes as needed.

Syntax

enable enforcer domain
enable enforcer database database_name
enable enforcer host host_name

Parameters

Interactive Example

Start with a minimally redundant database and disable the enforcer for the domain. Shut down one of the database processes:

nuodb [domain] > show domain summary
 
Hosts:
[broker] * ec2-54-200-117-181.us-west-2.compute.amazonaws.com/54.200.117.181:48004 (us-west-2)
[broker] ip-172-31-2-230/54.213.31.65:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 18002 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 18019 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 11555 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.213.31.65:48006 (us-west-2) [ pid = 11583 ] [ nodeId = 4 ] RUNNING
 
nuodb [domain] > disable enforcer domain
nuodb [domain] > show domain disabledEnforcer
Domain enforcer: false
Disabled hosts:
 
nuodb [domain] > shutdown process
Host: 54.213.31.65
Process ID: 11583
Shutdown gracefully (optional): yes
Shutdown even if database would become non-durable (optional):
Timeout (ms/s/m/h/d/w) (optional):
Remote process shutdown timeout (ms/s/m/h/d/w) (optional):
Process shutdown cleanly
nuodb [domain] > show domain summary
 
Hosts:
[broker] * ec2-54-200-117-181.us-west-2.compute.amazonaws.com/54.200.117.181:48004 (us-west-2)
[broker] ip-172-31-2-230/54.213.31.65:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] UNMET, processes [1 TE, 2 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 18002 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 18019 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 11555 ] [ nodeId = 3 ] RUNNING
 

Enable enforcement for the domain again and observe the TE that shut down restarts:

nuodb [domain] > enable enforcer domain
nuodb [domain] > show domain disabledEnforcer
Domain enforcer: true
Disabled hosts:
 
nuodb [domain] > show domain summary
 
Hosts:
[broker] * ec2-54-200-117-181.us-west-2.compute.amazonaws.com/54.200.117.181:48004 (us-west-2)
[broker] ip-172-31-2-230/54.213.31.65:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 18002 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 18019 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 11555 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.213.31.65:48006 (us-west-2) [ pid = 11619 ] [ nodeId = 5 ] RUNNING

Scripting Example

The same enable enforcer command can be executed with --command as follows:

nuodbmgr --broker host --password password --command "enable enforcer domain"