GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • V8.x Documentation
  • Privacy Statement
  • License Agreement
  • Contact Us

This view

  • Original page
  • New address

GeezerVison is showing docs.voltdb.com — @StopNode

  • Volt Active Data
  • Feedback/Discuss
  • Books
    • VoltDB Tutorial
    • Using VoltDB
    • VoltDB Guide to Performance and Customization
    • VoltDB Planning Guide
    • VoltDB Administrator's Guide
    • VoltDB Quick Reference
  • Current docs ▶
  • VoltDB V8 LTS
    • VoltDB V16
    • VoltDB V15.3 LTS
    • VoltDB V14.3 LTS
    • VoltDB V13.3 LTS
    • VoltDB V12.3 LTS
    • VoltDB V11.4
    • VoltDB V10.2
    • VoltDB V9.3
@StopNode

Documentation

VoltDB Home » Documentation » Using VoltDB
< previoustable of contentsnext >

@StopNode

@StopNode — Stops a VoltDB server process, removing the node from the cluster.

Synopsis

@StopNode Integer host-ID

Description

The @StopNode system procedure lets you stop a specific server in a K-safe cluster. You specify which node to stop using the host ID, which is the unique identifier for the node assigned by VoltDB when the server joins the cluster.

Note that by calling the @StopNode procedure on a node other than the node being stopped, you will receive a return status indicating the success or failure of the call. If you call the procedure on the node that you are requesting to stop, the return status can only indicate that the call was interrupted (by the VoltDB process on the node stopping), not whether it was successfully completed or not.

If you call @StopNode on a node or cluster that is not K-safe — either because it was started with a K-safety value of zero or one or more nodes have failed so any further failure could crash the database — the @StopNode procedure will not be executed. You can only stop nodes on a cluster that will remain viable after the node stops. To stop the entire cluster, please use the voltadmin shutdown command.

Return Values

Returns one VoltTable with one row.

NameDatatypeDescription
STATUSBIGINTAlways returns the value zero (0) indicating success.

Examples

The following program example uses grep, sqlcmd, and the @SystemInformation stored procedure to identify the host ID for a specific node (doodah) of the cluster. The example then uses that host ID (2) to call @StopNode and stop the desired node.

$ echo "exec @SystemInformation overview;" | sqlcmd | grep "doodah"
       2 HOSTNAME                doodah
$ sqlcmd
1> exec @StopNode 2;

The next example uses the voltadmin stop command to perform the same action. Note that voltadmin stop performs the translation from a network name to a host ID for you.

$ voltadmin stop doodah

The following Java code fragment performs the same function programmatically.

try {
     results = client.callProcedure("@SystemInformation",
                                    "overview").getResults();
}
catch (Exception e) { e.printStackTrace(); }

VoltTable table = results[0];
table.resetRowPosition();
int targetHostID = -1;

while (table.advanceRow() && targetHostId < 0) { 
    if ( (table.getString("KEY") == "HOSTNAME") && 
            (table.getString("VALUE") == targetHostName) ) {
         targetHostId = (int) table.getLong("HOST_ID");
    }
} 

try {
      client.callProcedure("@SStopNode", 
                           targetHostId).getResults();
   }
  catch (Exception e) { e.printStackTrace(); }
< previoustable of contentsnext >
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.