Multi-node / one instance

Overview

The plan assumes that one instance of JLupin Platform works on each clustered node. Such configuration is suitable for:

  • UAT environments, where business continuity mechanisms are tested (before going into production)
  • non-complex production environments (one layer)

Two nodes

Usually at least two instances of each microservice are running to fulfill the reliability requirements, in two nodes deployment plan all microservices from first node should be also run on the second one, as show on the following four nodes example:

Figure 6. JLupin Platform in multi-node configuration.

Each instance, on each node should be prepared according to the single node / single instance deployment plan instructions. In order to create clustered JLupin environment the following commands should be executed (using JLupin CLI Console):

@node1_1

> node peer add node2_1 10.0.0.2

@node2_1

> node peer add node1_1 10.0.0.1

and update discoveryHost in edge.conf to external IP address (by default it's set to 127.0.0.1 - localhost, which is wrong for multi-node implementations)

edge.conf@node1_1

[...]
http {

  include mime.types;
  include dict.conf;
  [...]

  # JLupin Module Initialization: BEGIN

  init_by_lua_block {
    require "jlupin"

    -- Discovery process --
    discoveryHost = "10.0.0.1"
    discoveryPort = "9098"              
    [...]

edge.conf@node2_1

[...]
http {

  include mime.types;
  include dict.conf;
  [...]

  # JLupin Module Initialization: BEGIN

  init_by_lua_block {
    require "jlupin"

    -- Discovery process --
    discoveryHost = "10.0.0.2"
    discoveryPort = "9098"              
    [...]

As you see the only thing that you need to do is to show JLupin that others JLupin nodes work in the environment, then "the magic" happens ;)

Four nodes and more

Two nodes act as a classical cluster - two instances of each service brokers (microservice) provide their functionalities in reliable manner. But sometimes you need:

  • more then two instances of microservice per node (especially on production),
  • more capacity, added horizontally by additional nodes, not by additional resources (CPU, RAM, HDD)

Sometimes you need to have plenty of nodes, where microservices are simply deployed with desired number of instances, when you don't' need to know where it operates and how it works... the only thing is important - to access services easily with appropriate level of reliability. Like on the following picture:

Figure 7. JLupin Platform in multi-node configuration (four nodes).

The only thing you need to do is to "cluster" this instances by executing the following tasks (using JLupin CLI Console):

@node1_1

> node peer add node2_1 10.0.0.2
> node peer add node3_1 10.0.0.3
> node peer add node4_1 10.0.0.4

@node2_1

> node peer add node1_1 10.0.0.1
> node peer add node3_1 10.0.0.3
> node peer add node4_1 10.0.0.4

@node3_1

> node peer add node1_1 10.0.0.1
> node peer add node2_1 10.0.0.2
> node peer add node4_1 10.0.0.4

@node4_1

> node peer add node1_1 10.0.0.1
> node peer add node2_1 10.0.0.2
> node peer add node3_1 10.0.0.3

and change discoveryHost appropriately as shown in the previous chapter.