There are actually two modes of operation for a VoltDB database: normal operation and admin mode. During normal operation clients can connect to the cluster and invoke stored procedures (as allowed by the security permissions set in the application catalog and deployment files). In admin mode, only clients connected through a special admin port are allowed to initiate stored procedures. Requests received from any other clients are rejected.
The goal of admin mode is to quell database activity prior to executing sensitive administrative functions. By entering admin mode, it is possible to ensure that no changes are made to the database contents during operations such as save, restore, or updating the runtime catalog.
You initiate admin mode by calling the @Pause system procedure through the admin port. The admin port works just like the regular client port and can be called through any of the standard VoltDB client interfaces (such as Java or JSON) by specifying the admin port number when you create the client connection.
Once the database enters admin mode, any requests received over the client port are rejected, returning a status of ClientResponse.SERVER_UNAVAILABLE. The client application can check for this response and resubmit the transaction after a suitable pause.
By default the admin port is 21211, but you can specify an alternate admin port using the <admin-mode> tag in the deployment file. For example:
<deployment> ... <admin-mode port="9999" /> </deployment>
Once admin mode is turned on, VoltDB processes requests received over the admin port only. Once you are ready to resume normal operation, you must call the system procedure @Resume through the admin port.
By default, a VoltDB database starts in normal operating mode. However, you can tell the database to start in admin mode by adding the adminstartup attribute to the <admin-mode> tag in the deployment file. For example:
<deployment> ... <admin-mode port="9999" adminstartup="true" /> </deployment>
When adminstartup is set to true, the database starts in admin mode. No activity is allowed over the standard client port until you explicitly stop admin mode with the voltadmin resume command or a call to the @Resume system procedure.
Starting in admin mode can be very useful, especially if you want to perform some initialization on the database prior to allowing client access. For example, it is recommended that you start in admin mode if you plan to manually restore a snapshot or prepopulate the database with data through a set of custom stored procedures. For example, the following commands restore a snapshot, then exit admin mode once the initialization is complete:
$ voltadmin restore 'voltdbroot/snapshots' 'MySnapshot' $ voltdbadmin resume