Extending the Database Across a Second Host (Scaling Out)

NuoDB is a distributed, peer-to-peer, database system. Each host in the NuoDB domain runs one NuoDB Admin (nuoadmin) process that is registered within the NuoDB domain forming a network of host resources available for hosting NuoDB databases. The commands in this section can be entered from any host in the domain running a nuoadmin service.

Installing NuoDB on a Second Host

As part of configuring a multi-host database, install NuoDB on a second host. For information on installing NuoDB, see Installing NuoDB.

Configuring and Starting NuoDB Admin on a Second Host

Configuring NuoDB Admin on a Second Host

On each host that will participate in the NuoDB domain, configure NuoDB Admin (for configuration details, see Configuring NuoDB Admin).

Below is an excerpt from a sample nuoadmin.conf file, on a second host that defines an additional admin process (server1), which includes the required changes for that admin process to peer into the NuoDB domain and gain membership. The initialMembership property must also include a unique admin process identifier, for example server0.

{
"initialMembership": {
"server0" : { "transport" : "host1:48005", "version" : "0:10000" }
},
"ThisServerId" : "server1",
"agentPort" : "48004",
"agentBindAddress" : "",
"adminPort" : "48005",
"portRange" : "48006",
"adminBindAddress" : "",
"altAddr" : "host2",
...

Starting NuoDB Admin on a Second Host

When you have configured NuoDB Admin on a second host, then start NuoDB Admin for that host (for details, see Starting and Stopping NuoDB Admin).

Once the server1 admin process is started on a second host (host2), server1 will be successfully added as a FOLLOWER to the NuoDB domain.

Verifying that a Second Host is Active

To verify that a second host has been successfully installed, is running, and is connected to the domain, run the show domain command:

nuocmd show domain
server version: 3.3.5472-a571fd0b3c, server license: Enterprise
server time: 2018-06-08T06:21:58.175000, client token: f37640883d151b9a034970300ceb37ae46fecbad
Servers:
[server0] host1:48005 (LEADER, Leader=server0) ACTIVE:Connected
[server1] host2:48005 (FOLLOWER, Leader=Server0) ACTIVE:Connected *
Databases:
test [RUNNING]
[SM] host1:48007 (Default) [sid = 2] [server = server0] MONITORED:RUNNING
[TE] host1:48006 (Default) [sid = 3] [server = server0] MONITORED:RUNNING

Note: The show domain command is issued using NuoDB Command (nuocmd). For more information on NuoDB Command and other command line tools, see Command Line Tools.

Creating an Archive for a Second Host

If planning to start an SM process on a second host, use the create archive command to create each required archive. For details, see Creating an Archive.

Starting Database Processes on a Second Host

Whenever starting additional database processes (on a running database), use the start database command with the --incremental option. The database process(es) you decide start does not matter; it may be either a TE and or a SM.

For example, the following commands are used to start an SM and TE process for the test database on the second host (server1).

nuocmd create archive --db-name test --server-id server1 --archive-path /var/opt/nuodb/production-archives/test
nuocmd start database --db-name test --incremental --te-server-id server1

Note: --te-server-id server1 starts a TE on the second host. Where an archive is created, an SM process is implicitly started on the available archive.

Verifying that Database Processes Have Started on a Second Host

To confirm that database processes have been successfully started on a second host, run the show domain command:

nuocmd show domain
server version: 3.3.5472-a571fd0b3c, server license: Enterprise
server time: 2018-06-08T06:52:35.792000, client token: 0350ad7d525c1b65c0530a799830bc73cce9558c
Servers:
[server0] host1:48005 (LEADER, Leader=Server0) ACTIVE:Connected *
[server1] host2:48005 (FOLLOWER, Leader=Server0) ACTIVE:Connected
Databases:
test [RUNNING][SM] host1:48007 (Default) [sid = 2] [server = server0] MONITORED:RUNNING
[TE] host1:48006 (Default) [sid = 3] [server = server0] MONITORED:RUNNING
[SM] host2:48007 (Default) [sid = 4] [server = server1] MONITORED:RUNNING
[TE] host2:48006 (Default) [sid = 5] [server = server1] MONITORED:RUNNING