An Example Running In Three Different Modes

These examples show the use of nuodbmgr by means of a command line, a script, and interactive usage. The examples assume you created the QuickStart test database. See Running the SQL QuickStart. Each example does the following:

  1. Shows the domain summary
  2. Starts a transaction engine
  3. Shows the domain summary again.

Command Line Usage

$ nuodbmgr --broker host --password password \
    --command "show domain summary; start process te host 172.31.34.74 database test options 
    '--dba-user dba --dba-password dba'; show domain summary"
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING
 
Started: [TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31057 ] [ db = test ] [ nodeId = 5 ] ACTIVE
 
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [3 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31057 ] [ nodeId = 5 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING

Running a Script

The same three commands are executed from a script called add_a_te.script. Commands can each be specified on their own line or optionally specified on the same line separated by semi-colons.

$ cat add_a_te.script
show domain summary
start process te host 172.31.34.74 database test options '--dba-user dba --dba-password dba'
show domain summary
 
$ nuodbmgr --broker host --password password --file add_a_te.script 
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING
 
Started: [TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31375 ] [ db = test ] [ nodeId = 7 ] ACTIVE
 
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [3 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31375 ] [ nodeId = 7 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING

Interactive Usage

nuodb [domain] > show domain summary
 
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING
 
nuodb [domain] > start process te
Database: test
Host: 172.31.34.74
Process command-line options: --dba-user dba --dba-password dba
Started: [TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31608 ] [ db = test ] [ nodeId = 9 ] ACTIVE
 
nuodb [domain/test] > show domain summary
Hosts:
[broker] * ip-172-31-34-74/172.31.34.74:48004 (us-east-1)
[ agent] ip-172-31-40-24/107.23.52.10:48004 (us-east-1)
 
Database: test, template [Minimally Redundant] MET, processes [3 TE, 2 SM], ACTIVE
[SM] ip-172-31-34-74/54.88.137.63:48005 (us-east-1) [ pid = 29756 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48006 (us-east-1) [ pid = 29770 ] [ nodeId = 2 ] RUNNING
[TE] ip-172-31-34-74/54.88.137.63:48007 (us-east-1) [ pid = 31608 ] [ nodeId = 9 ] RUNNING
[SM] ip-172-31-40-24/107.23.52.10:48005 (us-east-1) [ pid = 23380 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-40-24/107.23.52.10:48006 (us-east-1) [ pid = 23407 ] [ nodeId = 4 ] RUNNING
nuodb [domain/test] >