OpenSearch Zoning Configuration

Configuring zoning in OpenSearch: YML/nomad templates, node attributes, Consul keys, and restart.

2 min read Updated SS

Zoning in OpenSearch is a technique used to segregate and distribute data, which helps reduce data overload and prevent data breakage. Within the HEAL software, OpenSearch is split into three primary zones:

  • KPI zones: The KPI data is stored in KPI nodes.
  • JIM zones: The JIM data is stored in JIM nodes.
  • Txn zones: Transaction data is stored in Txn nodes.

In each zoning, there is one YML file as follows:

  • SA
opensearch-sncl-cordinator-node1.yml.tpl
opensearch-sncl-jim-node1.yml.tpl
opensearch-sncl-kpi-node1.yml.tpl
opensearch-sncl-master-node1.yml.tpl
opensearch-sncl-txn-node1.yml.tpl
  • HA
opensearch-kpi-node1.yml.tpl
opensearch-kpi-node2.yml.tpl
opensearch-kpi-node3.yml.tpl
opensearch-kpi-node4.yml.tpl
opensearch-kpi-node5.yml.tpl
opensearch-kpi-node6.yml.tpl

Follow the steps below to perform the zoning in OpenSearch:

1. Nomad File:

a. Each node has a specific nomad file as below:

  • SA
opensearch-cordinator-node1.nomad
opensearch-jim-node1.nomad
opensearch-kpi-node1.nomad
opensearch-master-node1.nomad
opensearch-txn-node1.nomad
  • HA
opensearch-kpi-node1.nomad
opensearch-jim-node2.nomad
opensearch-txn-node3.nomad
opensearch-kpi-node4.nomad
opensearch-jim-node5.nomad
opensearch-txn-node6.nomad
opensearch-kpi-node7.nomad
opensearch-jim-node8.nomad
opensearch-txn-node9.nomad

b. Navigate to the nomad file and ensure the template section is present as per the nodes, as below:

template {
     source    =         "/opt/Heal/Appsone_Service/opensearch/config/opensearch-sncl-cordinator-
node1.yml.tpl"
         destination = "local/opensearch.yml"
         change_mode = "restart"
     }
  • Ensure this section is present in all the nomad files.

2. Set up six nodes across two zones: Six nodes need to be configured to distribute the data across two zones (HEAL and JIM). Three nodes will be allocated for each zone. This can be achieved by adding the following lines to the Opensearch*.yml.tpl file:

  • For KPI data on the other 3 nodes.
node.attr.zone: heal
  • For JIM data on the other 3 nodes.
node.attr.zone: jim
  • For Txn data on the other 3 nodes.
node.attr.zone: Txn

Adding these lines to the configuration file ensures that data is stored according to their respective zones, thus achieving the desired zoning setup.

3. To finalize the zoning setup, make the following changes to the Opensearch*.yml.tpl file:

  • Remove unnecessary attributes:

Locate and delete the following attributes, as they are not required for this specific zoning setup:

cluster.routing.allocation.awareness.attributes
cluster.routing.allocation.awareness.force.zone.values key
  • Verify the consul keys.
service/opensearch/username/eum:healadmin
service/opensearch/username/jim:healadmin
service/opensearch/username/kpi:healadmin
service/opensearch/username/misc:healadmin
service/opensearch/username/txn:healadmin
service/opensearch/password/encrypted:<base64-password>
service/opensearch/password/encrypted/eum:<base64-password>
service/opensearch/password/encrypted/jim:<base64-password>
service/opensearch/password/encrypted/kpi:<base64-password>
service/opensearch/password/encrypted/misc:<base64-password>
service/opensearch/password/encrypted/txn:<base64-password>
service/opensearch/node1/hostname:opensearch-node1.example
service/opensearch/node1/ip:192.0.2.8
service/opensearch/node2/hostname:opensearch-node1.example
service/opensearch/node2/ip:192.0.2.8
service/opensearch/node3/hostname:opensearch-node1.example
service/opensearch/node3/ip:192.0.2.8
service/opensearch/nodes:192.0.2.8:9211
service/opensearch/nodes/eum:192.0.2.8:9211
service/opensearch/nodes/jaeger:https://192.0.2.8:9211
service/opensearch/nodes/jim:192.0.2.8:9211
service/opensearch/nodes/kpi:192.0.2.8:9211
service/opensearch/nodes/misc:192.0.2.8:9211
service/opensearch/nodes/txn:192.0.2.8:9211
service/opensearch/nodesarray:"192.0.2.8:9310","192.0.2.8:9311","192.0.2.8:93
00","192.0.2.8:9350","192.0.2.8:9325"
service/opensearch/password:<password>
service/opensearch/index/triggered/reports:heal_reports
service/opensearch/port:9200
service/opensearch/port/cordinator/http:9211
service/opensearch/port/cordinator/transport:9311
service/opensearch/port/jim/http:9250
service/opensearch/port/jim/transport:9350
service/opensearch/port/kpi/http:9200
service/opensearch/port/kpi/transport:9300
service/opensearch/port/master/http:9210
service/opensearch/port/master/transport:9310
service/opensearch/port/txn/http:9225
service/opensearch/port/txn/transport:9325
service/opensearch/master/nodesarray:"192.0.2.8:9310"
service/opensearch/nodesarray:"192.0.2.8:9310","192.0.2.8:9311","192.0.2.8:93
00","192.0.2.8:9350","192.0.2.8:9325"

Note:

Your content goes here

  • 9200 are data ports for KPI and transaction data.
  • 9300 are master/nodesarray port and nodesarray port.
  • 9250 are data ports for JIM.
  • 9350 are nodesarray ports.

Ensuring the correctness of these keys helps maintain the integrity of your zoning setup and prevents potential issues.

4. Restart OpenSearch:

After making the required modifications to the Opensearch*.yml.tpl file and confirming the Consul keys' accuracy, restart OpenSearch to apply the changes effectively. This restart initializes the zoning configuration, allowing OpenSearch to distribute and store data in the specified zones (HEAL and JIM).