Elastic search is not using data path setting

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.

Welcome!

It all depends on how you are starting elasticsearch. You need to pass the path.config setting to the runtime so elasticsearch will know where the config files are stored.

But in production, you probably don't want to run multiple nodes on the same machine anyway.

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

I have modified path config in service file.but elasticsearch is not taking that. Port alone it's taking rest of the fields it taken from config file 1

Share what you did.

But anyway, if it's for test, I'd just start from the command line.

https://stackoverflow.com/questions/67042135/elastic-search-is-not-using-data-path-setting

Please refer the above link.

I did.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.