How to start a node

How to start a rocket, van Gogh

A node requires some information without which it cannot be executed. Besides the classpath for the kernel JAR file and the libraries this includes:

  • (the node ID)
  • config.dir (directory for configuration files)
  • plugin.dir (directory for plugins)
  • storage.dir (directory for storage)
  • (the segment ID)
  • type.of.node (the type of the node)
  • license (the license code)

All data except the node ID can be taken from the JAVA preferences, provided that the node has already been executed correctly. However, for a very first launch, we need to provide this data to the Node in a different way. One way is to use configuration files.

Using configuration files

java -cp "/run/lib/*"

The specifications for and config.dir are sufficient for the beginning. In the configuration directory a configuration file can be found, which contains the remaining information.
The name of the file does not matter.
All files in the directory will be read in.
Each file provides key-value pairs for a preference node.


# payload
node.description=Test 001

Using a JAVA preference import file uses the JAVA preferences to store settings.

The JAVA Preferences are hierarchically organized in nodes. The library allows to export and import complete subtrees into an XML file. exports the existing settings of a node to the storage directory at startup. We can modify this file for a new node and give it to the first startup via command line.

You can see a sample file here.

Here is the adapted command line.

java -cp "/run/lib/*"

Using a TCP preference server

A plugin called NY_ConfigurationProviderPlugIn is provided. This plugin has a directory where JAVA Preference configurations are located in XML format. It starts a TCP server and waits for incoming requests from starting nodes.

Nodes can request a configuration file at startup. They transmit the desired node ID and receive in return the XML file, which is imported by the kernel into the JAVA Preferences. After that, the node boots normally. Disadvantage: The TCP server must be reachable.

java -cp "/run/lib/*"

If the node has already been executed successfully once

If the node was already running successfully once, no further configurations are necessary. All settings are stored in the system in the JAVA Preferences. Only the node ID is required.

java -cp "/run/lib/*"
    de.sillysky.nyssr.impl.kernel.CKernel - Innovative Distributed System