Moving a Single Host Database

With the Single Host template, you can specify moving a database to another host, while it is still running.

Automation Console

In the Edit Database panel in the Automation Console, click the pulldown menu for Hosts, and choose a different host.

NuoDB Manager

# Show what hosts this Database uses
nuodb [domain] > show database hosts
Database: test
[broker] * ec2-54-200-117-181.us-west-2.compute.amazonaws.com/54.200.117.181:48004 (us-west-2)

# Update Database and change host
nuodb [domain] > update database
Database Name: test
Template Name (Single Host, Minimally Redundant, Multi Host, Region distributed): Single Host
Template Variables (optional): 
Database Options (optional): 
Template Variable HOST (default: localhost): 52.24.143.83
Database Options for SMs (optional): 
Tag Constraints for SMs (optional): 
Database Options for TEs (optional): 
Tag Constraints for TEs (optional): 

# The Database now uses both hosts, because the Enforcer will not shutdown existing process
nuodb [domain] > show database hosts
Database: test
[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)
 
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 [Single Host] MET, processes [2 TE, 2 SM], ACTIVE
[SM] ip-172-31-5-193/54.200.117.181:48005 (us-west-2) [ pid = 31040 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-5-193/54.200.117.181:48006 (us-west-2) [ pid = 31057 ] [ nodeId = 2 ] RUNNING
[SM] ip-172-31-2-230/54.148.240.227:48005 (us-west-2) [ pid = 433 ] [ nodeId = 3 ] RUNNING
[TE] ip-172-31-2-230/54.148.240.227:48006 (us-west-2) [ pid = 460 ] [ nodeId = 4 ] RUNNING
 
# When we restart the database, we will see it come back up with processes just on the new host.
nuodb [domain] > shutdown database test
Timeout (ms/s/m/h/d/w) (optional): 
Remote process shutdown timeout (ms/s/m/h/d/w) (optional): 
Shutdown database test
nuodb [domain] > start database test
nuodb [domain] > show database hosts
Database: test
[broker] ip-172-31-2-230/54.148.240.227:48004 (us-west-2)
 
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 [Single Host] MET, processes [1 TE, 1 SM], ACTIVE
[SM] ip-172-31-2-230/54.148.240.227:48005 (us-west-2) [ pid = 491 ] [ nodeId = 1 ] RUNNING
[TE] ip-172-31-2-230/54.148.240.227:48006 (us-west-2) [ pid = 504 ] [ nodeId = 2 ] RUNNING