# Data path for multiple nodes on single server

**URL:** <https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569>\
**Category:** Elasticsearch\
**Created:** [February 15, 2019, 11:23am UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569 "2019-02-15T11:23:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SPR0STO](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@SPR0STO](https://discuss.elastic.co/u/SPR0STO)\
**Post date:** [February 15, 2019, 11:23am UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/1 "2019-02-15T11:23:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 15, 2019, 11:52am UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/2 "2019-02-15T11:52:44Z")

</div>

> [@SPR0STO](#):
>
> How need to be done by BestPractise?

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.

---

<div class="post-metadata">

**Author:** ![SPR0STO](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@SPR0STO](https://discuss.elastic.co/u/SPR0STO)\
**Post date:** [February 15, 2019, 12:23pm UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/3 "2019-02-15T12:23:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 15, 2019, 12:40pm UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/4 "2019-02-15T12:40:36Z")

</div>

Have a look at

- `node.max_local_storage_nodes`: [https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-node.html#max-local-storage-nodes](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/modules-node.html#max-local-storage-nodes)
- `cluster.routing.allocation.same_shard.host`: [https://www.elastic.co/guide/en/elasticsearch/reference/6.6/shards-allocation.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/shards-allocation.html)

HTH

---

<div class="post-metadata">

**Author:** ![SPR0STO](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@SPR0STO](https://discuss.elastic.co/u/SPR0STO)\
**Post date:** [February 15, 2019, 1:02pm UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/5 "2019-02-15T13:02:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 15, 2019, 1:54pm UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/6 "2019-02-15T13:54:01Z")

</div>

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

Like starting elasticsearch with:

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 15, 2019, 1:54pm UTC](https://discuss.elastic.co/t/data-path-for-multiple-nodes-on-single-server/168569/7 "2019-03-15T13:54:04Z")

</div>

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