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 NuoDB Command (nuocmd) commands in this section can be entered from any host in the domain running a nuoadmin service.

Step 1 - Installing NuoDB on a Second Host

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

Step 2 - Configuring NuoDB Admin on a Second Host

On each host that will participate in the NuoDB domain, edit the nuoadmin.config configuration file for that host machine. For information on setting properties for an admin process, see Host Properties (nuoadmin.conf).

Below is an excerpt from a sample nuoadmin.conf file, on a second host that defines an additional admin process (server1) that will run on the second host machine (host2) as defined by the value set for ThisServerID. Edits made to nuoadmin.conf (see examples in bold below) ensure that the admin process named server1 on host machine host2 peers into, and gains membership to, the initial NuoDB domain established by server0.

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

For information on additional properties to be set for an admin process, see Host Properties (nuoadmin.conf).

Step 3 - 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.

Step 4 - 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.

Step 6 - Starting Database Processes on a Second Host

If planning to start an SM process on a second host, first use the create archive command to create each archive required. For details, see Creating an Archive. 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.

To start an SM and TE process for the test database on the second host (server1), use the following commands:

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.

Step 7 - 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