Data path for multiple nodes on single server


(Sergey) #1

Hello
I want to the up "Elasticsearch" cluster with multiply nodes (3 or more) on a single server.
Can I use for all of my data nodes one directory? :
path.data: /var/lib/elasticsearch

What risks at this case?
How need to be done by BestPractise?


(David Pilato) #2

This is not a best practice to run multiple nodes on the same physical machine.
You can do it if you have more than 64gb of RAM for example but unless you have that I'd not really do it unless I have a very good reason to do so.

Why do you want to do that?

To answer your question:

Can I use for all of my data nodes one directory?

Yes you can (it will require that you change another setting though) but I'd prefer having 3 different dirs, one per node instead.


(Sergey) #3

Thank you, David
My single server have 256 Gb of RAM

I noticed that the directory default structure
/var/lib/elasticsearch/nodes/0/
... as if hinting at such a possibility (perhaps not documented).

I want to prepare a script for automatic server deployment with the following cluster configuration:

  • one master node
  • three data nodes

(David Pilato) #4

Have a look at

HTH


(Sergey) #5

Thank you, David
You confirmed my hunch.
So, I can use, for example, the directory

path.data: /var/lib/elasticsearch-nodes
node.max_local_storage_nodes = 3 # or more

... for all my date nodes.
And the directory

path.data: /var/lib/elasticsearch
node.max_local_storage_nodes = 1

... for the master node?


(David Pilato) #6

Yes but as I said I feel more confortable with one data dir per node instead.

Like starting elasticsearch with:

bin/elasticsearch -Epath.data=/var/elasticsearch/data1 -Epath.logs=/var/logs/elasticsearch/node1
bin/elasticsearch -Epath.data=/var/elasticsearch/data2 -Epath.logs=/var/logs/elasticsearch/node2
bin/elasticsearch -Epath.data=/var/elasticsearch/data3 -Epath.logs=/var/logs/elasticsearch/node3

Something like this. But it's up to you.


(system) closed #7

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