GridGain Developers Hub
GitHub logo GridGain iso GridGain.com
GridGain Software Documentation

Starting and Shutting Down Nodes

This chapter explains how to start server nodes and client nodes. Refer to the Installation Guide for the installation instructions.

You can start a node by running the ignite.sh script.

Starting Server Nodes

To start a regular server node, use the following command or code snippet:

ignite.sh path/to/configuration.xml
IgniteConfiguration cfg = new IgniteConfiguration();
Ignite ignite = Ignition.start(cfg);

The Ignite is an autoclosable resource. You can use the try-with-resource statement to automatically close it:

IgniteConfiguration cfg = new IgniteConfiguration();

try (Ignite ignite = Ignition.start(cfg)) {
    //
}

Starting Client Nodes

To start a client node, simply enable the client mode in the node’s configuration:

<bean class="org.apache.ignite.configuration.IgniteConfiguration" id="ignite.cfg">
    <property name="clientMode" value="true"/>
    <!-- other properties -->
</bean>
IgniteConfiguration cfg = new IgniteConfiguration();

// Enable client mode.
cfg.setClientMode(true);

// Start a client
Ignite ignite = Ignition.start(cfg);

Shutting Down Nodes

If you started a node by running the ignite.sh script and didn’t detach from the terminal, you can stop the node by hitting Ctrl+C. If you detached from the terminal, you can kill the node by executing the kill command:

kill <pid>

To stop a node from the program that launched it, use the following code:

ignite.close();
Ignition::Stop(ignite.GetName(), false);