3.3. Stopping the Database

Documentation

Home » Documentation » Administrator's Guide

3.3. Stopping the Database

How you choose to stop a VoltDB depends on what features you have enabled. For example, if you do not have any durability features enabled (such as auto snapshots or command logging), it is strongly recommended that you pause the database and take a manual snapshot before shutting down, so you preserve the data across sessions.

If you have command logging enabled, a manual snapshot is not necessary. However, it is still a good idea to pause the database before shutting down to ensure that all active client queries have a chance to complete and return their results (and no new queries start) before the shutdown occurs.

To pause and shutdown the cluster you can use the voltadmin pause and shutdown commands:

$ voltadmin pause
$ voltadmin shutdown

As with all voltadmin commands, you can use them remotely by specifying one of the cluster servers on the command line:

$ voltadmin pause --host=voltsvr2
$ voltadmin shutdown --host=voltsvr2

If security is enabled, you will also need to specify a username and password for a user with sysproc permissions:

$ voltadmin pause --host=voltsvr2 -u root -p Suda51
$ voltadmin shutdown --host=voltsvr2 -u root -p Suda51

Finally, if you are not using the durability features of automatic snapshots or command logging, you should perform a manual snapshot using the save command after pausing and before shutting down. Use the --blocking flag to ensure the snapshot completes before the shutdown occurs:

$ voltadmin pause
$ voltadmin save --blocking /tmp/voltdb backup
$ voltadmin shutdown