# Running Elastic Local in Cluster Mode

**URL:** <https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825>\
**Category:** Elasticsearch\
**Created:** [November 22, 2016, 8:22am UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825 "2016-11-22T08:22:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiouser](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jiouser](https://discuss.elastic.co/u/jiouser)\
**Post date:** [November 22, 2016, 8:22am UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825/1 "2016-11-22T08:22:24Z")

</div>

I am running Elastic in Local mode. That is to say, Elastic is running in the same JVM as my process. So the concept of Node and Client is not their.

Elastic is able to create and read the indexes it it creating on my local directory.  
I wish to have multiple instances of Elastic each one in local mode but in cluster mode. I.e. Each will have its own data directory but the data will be replicated and the nodes will be in cluster.

I tried with two processes on same machine, but each one of them is running as master node and not going into the cluster.

Can you possibly help.

---

<div class="post-metadata">

**Author:** ![mainec](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mainec/32/5557_2.png) [@mainec](https://discuss.elastic.co/u/mainec)\
**Post date:** [November 22, 2016, 11:29am UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825/2 "2016-11-22T11:29:22Z")

</div>

You might want to check out this previous post:

> [@Can I run multiple Elasticsearch nodes on the same machine?](https://discuss.elastic.co/t/can-i-run-multiple-elasticsearch-nodes-on-the-same-machine/67):
>
> We generally recommend scaling horizontally by adding small/medium machines. But we do have a few customers with big machines (eg. 512 RAM, 256 cores, etc..) who have deployed multiple Elasticsearch nodes per big machine. There are some caveats and recommendations if you choose this deployment architecture: Max heap size for each node instance should be \< 32Gb. This is because a heap size above 32Gb will actually be counterproductive for the JVM will stop compressing pointers ([https://wikis…](https://wikis.oracle.com/display/HotSpotInternals/CompressedOops)

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 22, 2016, 11:36am UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825/3 "2016-11-22T11:36:17Z")

</div>

[This blog post](https://www.elastic.co/blog/elasticsearch-the-server) may also be of interest.

---

<div class="post-metadata">

**Author:** ![jiouser](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jiouser](https://discuss.elastic.co/u/jiouser)\
**Post date:** [November 22, 2016, 12:13pm UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825/4 "2016-11-22T12:13:31Z")

</div>

Hello. Thanks for the reply. However, the post describes how to run multiple instances of ES on same machine. What problem I am facing is  
a. Run ES in embedded mode as 2 separate processes. (Running)  
b. Each having same cluster name (Running)  
c. Each should connect to the given cluster name. (NOT HAPPENING)  
d. There should be only 1 master. (Now, since both of them are not going into cluster, each is running as cluster)

One ES is launched from IDE and another from command prompt. Both have different data directories. But the data is neither getting replicated nor the ES is running in cluster.

We are talking only about running ES in embedded mode (local) for both the instances.

ANy help in this regard would be useful

---

<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:** [December 20, 2016, 12:13pm UTC](https://discuss.elastic.co/t/running-elastic-local-in-cluster-mode/66825/5 "2016-12-20T12:13:45Z")

</div>

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