Configuring Elasticsearch Cluster
Before you start, ensure that the Elasticsearch is not started after API Gateway installation.
To configure an Elasticsearch cluster 1. If you have started API Gateway before setting up the Elasticsearch cluster configuration, perform the following step before proceeding on to configuration:
Log off and exit from
API Gateway.
delete the nodes folder from the <Installation Location>\InternalDataStore\data folder.
Make the necessary cluster configuration and start
API Gateway.
Start Elasticsearch.
A node is created in the Elasticsearch cluster.
2. Open elasticsearch.yml from SAG_root/InternalDataStore/config/elasticsearch.yml in any node that you want to cluster.
The following configuration is a sample of how the configuration appears initially.
cluster.name:"SAG_EventDataStore"
node.name: node1
path.logs: SAG_root\InternalDataStore/logs
network.host:0.0.0.0
http.port:9240
discovery.seed_hosts: ["node1:9340"]
transport.tcp.port:9340
path.repo:['SAG_root\InternalDataStore/archives']
cluster.initial_master_nodes:["node1"]
3. Provide the name of the cluster in the cluster.name property.
Nodes with same cluster names form a cluster. That is, if there are three nodes in the cluster, the value in the cluster.name property must be same across all three nodes. In other words, Elasticsearch forms a cluster with nodes that have the same cluster.name.
For example,
cluster.name:"SAG_EventDataStore"
4. Provide the names of all participating nodes, as seen in the node.name property, and the ports they use, as seen in the http.port property, in the discovery.seed_hosts property in the following format:
host_name:port_name
If there are three nodes in the cluster, the value in the discovery.seed_hosts property will be like the example given here:
discovery.seed_hosts: ["node1:9340","node2:9340","node3":"9340"]
The names of all nodes appear in the cluster.initial_master_nodes property. The node name displayed in this property is same as seen in the node.name property.
Sample configuration of a node is as follows:
cluster.name:"SAG_EventDataStore"
node.name: node1
path.logs: SAG_root\InternalDataStore/logs
network.host:0.0.0.0
http.port:9240
discovery.seed_hosts: ["hostname1:9340","hostname2:9340","hostname3:9340"]
transport.tcp.port:9340
path.repo:['SAG_root\InternalDataStore/archives']
cluster.initial_master_nodes:["node1","node2","node3"]
The specified nodes are clustered.