# How to add new node to clusters on different machines

**URL:** <https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309>\
**Category:** Elasticsearch\
**Created:** [January 11, 2013, 5:40am UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309 "2013-01-11T05:40:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fei\_Yao](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@Fei\_Yao](https://discuss.elastic.co/u/Fei_Yao)\
**Post date:** [January 11, 2013, 5:40am UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/1 "2013-01-11T05:40:53Z")

</div>

How to add 2 shards/replica on two different boxes? I couldn't find any  
good examples of doing it. Please point me the right direction or show me  
some code.

Thanks in advance  
Fei

--

---

<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:** [January 11, 2013, 8:33am UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/2 "2013-01-11T08:33:32Z")

</div>

Hey,

I'm afraid I did not understand your question.

In your title, you ask for "adding a new node". Just run a new instance of ES on  
your new machine (on the same network) and ES will use it to spread shards.  
In your comment, you ask to add 2shards/replica.  
If you want to create a new index, just create it using the create index API:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

[http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)  
If you want to modify an existing index, just use the index update settings API:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

[http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)  
but note that you can't change the shard number once the index has been created.  
But, you can use aliases to answer to that need.

If I didn't answer to your question, could you please clarify what you are  
after?

HTH  
David.

Le 11 janvier 2013 à 06:40, Fei Yao [mail2fei@gmail.com](mailto:mail2fei@gmail.com) a écrit :

> How to add 2 shards/replica on two different boxes? I couldn't find any good  
> examples of doing it. Please point me the right direction or show me some  
> code.
> 
> Thanks in advance  
> Fei
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![Fei\_Yao](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@Fei\_Yao](https://discuss.elastic.co/u/Fei_Yao)\
**Post date:** [January 11, 2013, 6:42pm UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/3 "2013-01-11T18:42:07Z")

</div>

David,  
First of all, I'm very new to the ES. I thought when I start a new instance  
of ES on machine A, then I start another instance of ES on machine B.  
Through some configuration B should know A's IP address. Such as when you  
try to make a replset of MongoDB there is a config file you need to specify  
all the ip address of the nodes which compose this cluster. Is this the  
same with ES?

So, in other words. If I just run ./elasticsearch -f on machine A, then run  
./elasticsearch -f on machine B. Through some black magic A and B's  
elasticsearch instance automatically clustered? I saw some document on  
elasticsearch's website. But I cannot find some example of how to cluster  
elasticsearch on different boxes.

I hope I explain it well this time.  
Thanks

On Friday, January 11, 2013 3:33:32 AM UTC-5, David Pilato wrote:

> Hey,
> 
> I'm afraid I did not understand your question.
> 
> In your title, you ask for "adding a new node". Just run a new instance  
> of ES on your new machine (on the same network) and ES will use it to  
> spread shards.  
> In your comment, you ask to add 2shards/replica.  
> If you want to create a new index, just create it using the create index  
> API:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)  
> If you want to modify an existing index, just use the index update  
> settings API:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)  
> but note that you can't change the shard number once the index has been  
> created.  
> But, you can use aliases to answer to that need.
> 
> If I didn't answer to your question, could you please clarify what you  
> are after?
> 
> HTH  
> David.
> 
> Le 11 janvier 2013 à 06:40, Fei Yao \<[mail...@gmail.com](mailto:mail...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> How to add 2 shards/replica on two different boxes? I couldn't find any  
> good examples of doing it. Please point me the right direction or show me  
> some code.
> 
> Thanks in advance  
> Fei
> 
> --
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [January 11, 2013, 6:50pm UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/4 "2013-01-11T18:50:51Z")

</div>

Fei,

Look into Elasticsearch's discovery module, primarily Zen Discovery:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

Nodes can find each other either by multicast or unicast (explicit IPs need  
to be defined, similar to MongoDB). Both are disabled by default.

--  
Ivan

On Fri, Jan 11, 2013 at 10:42 AM, Fei Yao [mail2fei@gmail.com](mailto:mail2fei@gmail.com) wrote:

> David,  
> First of all, I'm very new to the ES. I thought when I start a new  
> instance of ES on machine A, then I start another instance of ES on machine  
> B. Through some configuration B should know A's IP address. Such as when  
> you try to make a replset of MongoDB there is a config file you need to  
> specify all the ip address of the nodes which compose this cluster. Is this  
> the same with ES?
> 
> So, in other words. If I just run ./elasticsearch -f on machine A, then  
> run ./elasticsearch -f on machine B. Through some black magic A and B's  
> elasticsearch instance automatically clustered? I saw some document on  
> elasticsearch's website. But I cannot find some example of how to cluster  
> elasticsearch on different boxes.
> 
> I hope I explain it well this time.  
> Thanks
> 
> On Friday, January 11, 2013 3:33:32 AM UTC-5, David Pilato wrote:
> 
> > Hey,
> > 
> > I'm afraid I did not understand your question.
> > 
> > In your title, you ask for "adding a new node". Just run a new instance  
> > of ES on your new machine (on the same network) and ES will use it to  
> > spread shards.  
> > In your comment, you ask to add 2shards/replica.  
> > If you want to create a new index, just create it using the create index  
> > API: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/api/admin-)\*\*  
> > indices-create-index.html[http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)  
> > If you want to modify an existing index, just use the index update  
> > settings API: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/api/admin-)\*\*  
> > indices-update-settings.html[http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)  
> > but note that you can't change the shard number once the index has been  
> > created.  
> > But, you can use aliases to answer to that need.
> > 
> > If I didn't answer to your question, could you please clarify what you  
> > are after?
> > 
> > HTH  
> > David.
> > 
> > Le 11 janvier 2013 à 06:40, Fei Yao [mail...@gmail.com](mailto:mail...@gmail.com) a écrit :
> > 
> > How to add 2 shards/replica on two different boxes? I couldn't find any  
> > good examples of doing it. Please point me the right direction or show me  
> > some code.
> > 
> > Thanks in advance  
> > Fei
> > 
> > --
> > 
> > --  
> > David Pilato  
> > [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Fei\_Yao](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@Fei\_Yao](https://discuss.elastic.co/u/Fei_Yao)\
**Post date:** [January 11, 2013, 7:35pm UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/5 "2013-01-11T19:35:14Z")

</div>

Ivan,  
Wonderful, thanks for your help. I think I'm heading to the right direction.

Thanks

On Friday, January 11, 2013 1:50:51 PM UTC-5, Ivan Brusic wrote:

> Fei,
> 
> Look into Elasticsearch's discovery module, primarily Zen Discovery:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/modules/discovery/index.html)
> 
> Nodes can find each other either by multicast or unicast (explicit IPs  
> need to be defined, similar to MongoDB). Both are disabled by default.
> 
> --  
> Ivan
> 
> On Fri, Jan 11, 2013 at 10:42 AM, Fei Yao \<[mail...@gmail.com](mailto:mail...@gmail.com) \<javascript:\>
> 
> > wrote:
> 
> > David,  
> > First of all, I'm very new to the ES. I thought when I start a new  
> > instance of ES on machine A, then I start another instance of ES on machine  
> > B. Through some configuration B should know A's IP address. Such as when  
> > you try to make a replset of MongoDB there is a config file you need to  
> > specify all the ip address of the nodes which compose this cluster. Is this  
> > the same with ES?
> > 
> > So, in other words. If I just run ./elasticsearch -f on machine A, then  
> > run ./elasticsearch -f on machine B. Through some black magic A and B's  
> > elasticsearch instance automatically clustered? I saw some document on  
> > elasticsearch's website. But I cannot find some example of how to cluster  
> > elasticsearch on different boxes.
> > 
> > I hope I explain it well this time.  
> > Thanks
> > 
> > On Friday, January 11, 2013 3:33:32 AM UTC-5, David Pilato wrote:
> > 
> > > Hey,
> > > 
> > > I'm afraid I did not understand your question.
> > > 
> > > In your title, you ask for "adding a new node". Just run a new instance  
> > > of ES on your new machine (on the same network) and ES will use it to  
> > > spread shards.  
> > > In your comment, you ask to add 2shards/replica.  
> > > If you want to create a new index, just create it using the create  
> > > index API: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/api/admin-)\*\*  
> > > indices-create-index.html[http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html)  
> > > If you want to modify an existing index, just use the index update  
> > > settings API: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/**guide/reference/api/admin-)\*  
> > > \*indices-update-settings.html[http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html](http://www.elasticsearch.org/guide/reference/api/admin-indices-update-settings.html)  
> > > but note that you can't change the shard number once the index has been  
> > > created.  
> > > But, you can use aliases to answer to that need.
> > > 
> > > If I didn't answer to your question, could you please clarify what you  
> > > are after?
> > > 
> > > HTH  
> > > David.
> > > 
> > > Le 11 janvier 2013 à 06:40, Fei Yao [mail...@gmail.com](mailto:mail...@gmail.com) a écrit :
> > > 
> > > How to add 2 shards/replica on two different boxes? I couldn't find any  
> > > good examples of doing it. Please point me the right direction or show me  
> > > some code.
> > > 
> > > Thanks in advance  
> > > Fei
> > > 
> > > --
> > > 
> > > --  
> > > David Pilato  
> > > [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> > > [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > --

--

---

<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:** [July 6, 2017, 2:56am UTC](https://discuss.elastic.co/t/how-to-add-new-node-to-clusters-on-different-machines/10309/6 "2017-07-06T02:56:50Z")

</div>


