Disable Enforcer

This is a NuoDB Manager command. See NuoDB Manager.

Description

Suspend enforcement at either the domain, database, or host level. 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

disable enforcer domain
disable enforcer database database_name
disable enforcer host host_name [ untilRestart { true | false } ]

Parameters

Interactive Example

Normal enforcement - shut down a TE process (pid=2870) and it gets restarted:

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 = 3168 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 3186 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 2843 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.213.31.65:48006 (us-west-2) [ pid = 2870 ] [ nodeId = 4 ] RUNNING
 
nuodb [domain] > shutdown process
Host: 54.213.31.65
Process ID: 2870
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] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 3168 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 3186 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 2843 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.213.31.65:48006 (us-west-2) [ pid = 2892 ] [ nodeId = 5 ] RUNNING

Note, a new TE with pid 2892 has started. Now, disable enforcement for the database and then shut down the TE process. Note, the TE is not restarted and the database state is UNMET.

nuodb [domain] > disable enforcer database
Database name: test
nuodb [domain] > shutdown process
Host: 54.213.31.65
Process ID: 2892
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 = 3168 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 3186 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 2843 ] [ nodeId = 3 ] RUNNING
 

Now, re-enable enforcement for the database and observe the TE process restarted:

nuodb [domain] > enable enforcer database
Database name: test
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 = 3168 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 3186 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.213.31.65:48005 (us-west-2) [ pid = 2843 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.213.31.65:48006 (us-west-2) [ pid = 2911 ] [ nodeId = 6 ] RUNNING

Now disable the enforcer for one host without setting untilRestart (default is false). Shut down both the TE and SM processes on the disabled host and observe they do not restart automatically:

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.148.240.227: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 = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 20580 ] [ nodeId = 4 ] RUNNING
[SM] ip-172-31-2-230/54.148.240.227:48005 (us-west-2) [ pid = 2388 ] [ nodeId = 9 ] RUNNING
[TE] ip-172-31-2-230/54.148.240.227:48006 (us-west-2) [ pid = 2404 ] [ nodeId = 10 ] RUNNING
 
nuodb [domain] > disable enforcer host
Host: 54.148.240.227
Until Restart: 
nuodb [domain] > shutdown process
Host: 54.148.240.227
Process ID: 2404
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] > shutdown process
Host: 54.148.240.227
Process ID: 2388
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.148.240.227:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] UNMET, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 20580 ] [ nodeId = 4 ] RUNNING

Note above that the TE and SM on 54.148.240.227 did not restart automatically. Now shut down a process on the host where enforcement is still enabled:

nuodb [domain] > shutdown process
Host: 54.200.117.181
Process ID: 20580
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.148.240.227:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] UNMET, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING

The TE process on the enabled host is automatically restarted. Now, shut down the broker on the disabled host. See Starting and Stopping NuoDB Services for more information. Observe that only one broker is running in the domain.

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)
 
Database: test, null, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING

Restart the broker again on the disabled host and observe that the TE/SM processes still do not automatically restart.

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.148.240.227:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] UNMET, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING

Re-enable enforcement and then observe that the TE/SM processes restart:

nuodb [domain] > enable enforcer host
Host: 54.148.240.227
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.148.240.227: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 = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING
[SM] ip-172-31-2-230/54.148.240.227:48005 (us-west-2) [ pid = 3156 ] [ nodeId = 14 ] RUNNING
[TE] ip-172-31-2-230/54.148.240.227:48006 (us-west-2) [ pid = 3182 ] [ nodeId = 15 ] RUNNING

Now, disable enforcement on the host with untilRestart set to true. This means, enforcement will be disabled until the host (broker) is restarted. Shut down the TE/SM processes and restart the broker.

nuodb [domain] > disable enforcer host
Host: 54.148.240.227
Until Restart: true
nuodb [domain] > shutdown process
Host: 54.148.240.227
Process ID: 3182
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] > shutdown process
Host: 54.148.240.227
Process ID: 3156
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.148.240.227:48004 (us-west-2)
 
Database: test, template [Minimally Redundant] UNMET, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING

Shut down the broker on the disabled host:

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)
 
Database: test, null, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING

Restart the broker, and observe that this time the TE/SM on the previously disabled host automatically start up.

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.148.240.227: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 = 20556 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 22383 ] [ nodeId = 11 ] RUNNING
[SM] ip-172-31-2-230/54.148.240.227:48005 (us-west-2) [ pid = 3399 ] [ nodeId = 16 ] RUNNING
[TE] ip-172-31-2-230/54.148.240.227:48006 (us-west-2) [ pid = 3424 ] [ nodeId = 17 ] RUNNING

Scripting Example

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

nuodbmgr --broker host --password password \
    --command "disable enforcer database test"nuodbmgr --broker host --password password \
    --command "disable enforcer host 54.148.240.227"