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-resouce 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 higgint Ctrl+C.
If you detached from the terminal, you can kill the node by executing the kill
command:
kill -d <pid>
To stop a node from the program that launched it, use the following code:
ignite.close();
Ignition::Stop(ignite.GetName(), false);
© 2020 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.