Starting a Cluster

written by vdbdev on August 26, 2013 with no comments

VoltDB is usually configured to run in a cluster. Clusters provide both horizontal scaling (more transactions, more memory for storing data) and allow replication of data for high availability.

To start a VoltDB cluster, you specify two additional pieces of information when starting the database processes. You need to specify the number of hosts in the cluster and a hostname/ip-address for one host that will coordinate the establishment of the cluster during the startup phase.

You do not need to modify your DDL file or any Java stored procedures or recompile your catalog to run in a cluster.

For example, if you have hosts vdb1, vdb2 and vdb3 and you want to run the examples/voter application as a three node cluster.

First, modify the deployment.xml file to configure a hostcount of 3:

<?xml version="1.0"?>
<deployment>
    <cluster hostcount="3" sitesperhost="2" kfactor="0" />
    <httpd enabled="true">
        <jsonapi enabled="true" />
    </httpd>
</deployment>

Then, on each server run this command, specifying vdb1 as the temporary coordinating host for the startup process:

 voltdb create voter.jar --host=vdb1 --deployment=deployment.xml --background

If you would like to configure a highly-available three node cluster, additionally set a kfactor greater than 0 in the deployment file. See the availability recipe for a more detailed example of configuring high availability.