6. Cluster setup

6.1. Cluster setup

Apache Karaf relies on Apache Karaf Cellar, which in turn uses Hazelcast to discover and configure its cluster.You just need to install multiple context servers on the same network, and then (optionally) change the Hazelcast configuration in the following file :

  1. etc/hazelcast.xml

All nodes on the same network, sharing the same cluster name will be part of the same cluster.

For the actual ElasticSearch configuration however, this must be done using the following file:

  1. etc/org.apache.unomi.persistence.elasticsearch.cfg

Depending on the cluster size, you will want to adjust the following parameters to make sure your setup is optimal interms of performance and safety.

6.1.1. 2 nodes configuration

One node dedicated to context server, 1 node for elasticsearch storage.

Node A :

  1. numberOfReplicas=0
  2. monthlyIndex.numberOfReplicas=0

Node B :

  1. numberOfReplicas=0
  2. monthlyIndex.numberOfReplicas=0

6.1.2. 3 nodes configuration

One node dedicated to context server, 2 nodes for elasticsearch storage with fault-tolerance

Node A :

  1. numberOfReplicas=1
  2. monthlyIndex.numberOfReplicas=1

Node B :

  1. numberOfReplicas=1
  2. monthlyIndex.numberOfReplicas=1

Node C :

  1. numberOfReplicas=1
  2. monthlyIndex.numberOfReplicas=1