I am trying to run 2 elastic search instances in single VM machine with the below configuration. Both are started successfully.
But both are using same data store I have given the different path in data store but its not reflecting.
If i changed the path in first node second node also using the same data path.
Os Version: CentOS Linux release 7.9.2009 (Core)
Elastic : 7.11.2 RPM Distribution
Node1
cluster.name: escluster
node.name: master-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["master-1"]
node.max_local_storage_nodes: 3
Node2
cluster.name: escluster
node.name: master-2
path.data: /var/lib/elasticsearch-node2
path.logs: /var/log/elasticsearch-node2
network.host: 0.0.0.0
http.port: 9201
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["master-1"]
node.max_local_storage_nodes: 3
Output of Node 1
curl 127.0.0.1:9200
{
"name" : "master-1",
"cluster_name" : "escluster",
"cluster_uuid" : "fneTaKDRTByzaiqzbql_PA",
"version" : {
"number" : "7.11.2",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "3e5a16cfec50876d20ea77b075070932c6464c7d",
"build_date" : "2021-03-06T05:54:38.141101Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Output of Node 2
curl 127.0.0.1:9201
{
"name" : "master-1",
"cluster_name" : "escluster",
"cluster_uuid" : "TJ9qOpdKQ1qTjedce3soOg",
"version" : {
"number" : "7.11.2",
"build_flavor" : "default",
"build_type" : "rpm",
"build_hash" : "3e5a16cfec50876d20ea77b075070932c6464c7d",
"build_date" : "2021-03-06T05:54:38.141101Z",
"build_snapshot" : false,
"lucene_version" : "8.7.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Output of Node 2 is generating New cluster UUID instead of using existing one and also the name is not changed. It should be master-2.
My Service File
Node 1
Environment=ES_PATH_CONF=/etc/elasticsearch-node2
Node 2
Environment=ES_PATH_CONF=/etc/elasticsearch
Why elastic serch is not using different path and name.
Its allowing to override port alone nothing else
Node 1
"path" : {
"data" : [
"/var/lib/elasticsearch-node2"
],
"logs" : "/var/log/elasticsearch-node2",
"home" : "/usr/share/elasticsearch"
}
Node 2
"path" : {
"data" : [
"/var/lib/elasticsearch-node2"
],
"logs" : "/var/log/elasticsearch-node2",
"home" : "/usr/share/elasticsearch"
},
Both are using same second node elasticsearch.xml configuration is overriding port alone. Other configurations are not overriding.
Kindly help me why elstic search is not using multiple data path in single machine.