Tutorial 2 - Naming nodes

Before you begin

Make sure you have created the nodes one and two during the previous tutorial. If not, see section Tutorial 1 - Creating nodes.

About this task

The name of the node is collected from the first of the listed sources available:

  1. A sys.config file that already exists before the node is created.
  2. A command-line argument. See Step 4.
  3. An environment variable. See Tip on environment variables.
  4. Default value that is collected based on the name of the directory and the host name of your machine.
Important: If SPARKL finds a sys.config file in the directory before creating a node there, SPARKL does not generate the license file, the configuration database and the logs directory. Therefore, it is recommended to let SPARKL create the sys.config during auto-configuration, and edit this file later on, if necessary.

Procedure

  1. Check if node two is running.
    • If not running, delete it.
      rm -rf two
    • If running, stop it before deleting.
  2. Recreate node two - but this time give it a host name too.
    mkdir two@127.0.0.1
    (cd two@127.0.0.1 && sse start)
    Note: By default, the node takes the host name of your machine.
  3. Create a new directory and name it three.
  4. Use the -node argument when starting the node to give it a name different from the directory's name.
    (cd three && sse start -node 3@sparkl.com)
    You have created a node in directory three, but the node itself is named three@sparkl.com.
    Tip: You can also use Linux environment variables to name the nodes, for example: export NODE=3@sparkl.com.

Results

By now you should:
  • Be familiar with the alternative methods to name nodes
  • Have the following SPARKL nodes:
    • one@[machine-host].local running in the one folder
    • two@127.0.0.1 running in the two folder
    • 3@sparkl.com running in the three folder

What to do next

Tutorial 3 - Creating clusters shows you how to create clusters of nodes.