Restarting a VoltDB database is different than starting it for the first time. How you restart the database depends on what durability features were in effect previously.
If you just use the voltdb create command, you create a new, empty database. Because VoltDB keeps its data in memory, to return the database to its last known state — including its content — you need to restore the data from a saved copy.
If you are using automatic snapshots or command logging, VoltDB can automatically reinstate the data when you use the voltdb recover command:
$ voltdb recover --deployment=deployment.xml \ --host=voltsvr1 \ --license=~/license.xml
Just as when starting a database for the first time, you must invoke the recover command on all nodes of the cluster before the database can start, You must also select one of the nodes as the "host" to facilitate startup and identify that node as the host on each of the servers when you issue the voltdb recover command.
When you recover a VoltDB database, the cluster performs the same initial coordination activities as when creating a new database: the host node facilitates establishing a quorum and ensures all nodes connect. Then the database servers restore the most recent snapshot plus (if command logging is enabled) the last logged transactions. Once the schema is loaded and all data is restored, the database enables client access.
If you are not using automatic snapshots or command logging, you must restore the last snapshot manually. You do this with the following procedure:
Start a new database using the voltdb create command on each server as described in Section 3.2, “Starting the Database”.
Use the voltadmin pause command to pause the database.
Use the voltadmin restore command to restore the data from the manual snapshot.
Use the voltadmin resume command to resume client activity.
For example, if the last snapshot was saved in
/tmp/voltdb using the unique ID
backup, you can restore the data with the following commands:
$ voltadmin pause $ voltadmin restore /tmp/voltdb backup $ voltadmin resume