3.2. Initializing the Database Root Directory

Documentation

VoltDB Home » Documentation » Administrator's Guide

3.2. Initializing the Database Root Directory

Once you create the configuration file, you are ready to initialize the database root directory, using the voltdb init command. You issue this command on each node of the cluster, specifying the location for the root directory, the configuration file, license, and schema and stored procedure class files. There are defaults for each argument. But if you do specify the configuration, license, schema or classes you must specify the same values on every node of the cluster. For example:

$ voltdb init --dir=~/database         \ 1
              --config=deployment.xml  \ 2
              --license=~/license.xml  \ 3 
              --schema=myschema.sql    \ 4
              --classes=myprocs.jar      5

On the command line, you can specify up to five arguments:

1

The location where the root directory will be created

2

The configuration file, which enables and sets attributes for specific VoltDB features

3

The license file (when using the VoltDB Enterprise Edition)

4

One or more SQL DDL files

5

One or more JAR files containing stored procedure classes

When you initialize the root directory, VoltDB:

  1. Creates the root directory (voltdbroot) as a subfolder of the specified parent directory

  2. Saves the configuration and license, plus any schema and class files to preload, in the new root directory

Note that you only need to initialize the root directory once. Once the root directory is initialized, you can start and stop the database as needed. VoltDB uses the root directory to manage the current configuration options and backups of the data — if those features are selected — in command logs and snapshots. If you do not specify a license on the command line, VoltDB looks for a license in the current working directory, your home directory, or in the directory where the VoltDB software is installed and copies it into the root directory if it finds one.

If the root directory already exists or has been initialized before, you cannot re-initialize the directory unless you include the --force argument. This is to protect you against accidentally deleting data from a previous database session.

Important

Volt uses the root directory to store files vital to the operation and recovery of the database in case of failure. Many product features rely on information stored within the root directory and its subfolders. Do not manually add new or modify existing files within the directory structure. You can, judiciously, delete files as a maintenance activity (such as old log files or snapshots archived in numbered subfolders if and when you reinitialize an existing root directory). But even these activities are best handled automatically by setting the appropriate retention properties for each feature in the database configuration.