# Point to any machine in the cluster?

**URL:** <https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595>\
**Category:** Elasticsearch\
**Created:** [June 11, 2020, 12:49am UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595 "2020-06-11T00:49:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pszm](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@pszm](https://discuss.elastic.co/u/pszm)\
**Post date:** [June 11, 2020, 12:49am UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595/1 "2020-06-11T00:49:15Z")

</div>

I am sure this is a basic question but I just don't see it answered in any clear way.  
We are running a Ruby on Rails 5 app using the elasticsearch-rails gem. We have a cluster of 3 machines for ElasticSearch.

Can we point the 'elasticsearch url' at any of these 3 machines? If I am reading things right there is no concept of master and slave, so, in theory we can use any of them.

Really this is part of a larger question of what is a cluster and what good is it! Our 2nd and 3rd machines in the cluster seem to have almost no CPU/IO activity while our 1st machine (the one pointed to) is getting hit quite hard. We were hoping to someone spread all the load.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 14, 2020, 11:49pm UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595/2 "2020-06-14T23:49:47Z")

</div>

> [@pszm](#):
>
> Can we point the 'elasticsearch url' at any of these 3 machines?

Yes, that's correct.

---

<div class="post-metadata">

**Author:** ![wangqinghuan](https://avatars.discourse-cdn.com/v4/letter/w/d26b3c/32.png) [@wangqinghuan](https://discuss.elastic.co/u/wangqinghuan)\
**Post date:** [June 15, 2020, 2:17am UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595/3 "2020-06-15T02:17:11Z")

</div>

Do you use Rest client ? You can point the 'elasticsearch url' at all of machines to spread load.

---

<div class="post-metadata">

**Author:** ![pszm](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@pszm](https://discuss.elastic.co/u/pszm)\
**Post date:** [June 15, 2020, 5:03am UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595/4 "2020-06-15T05:03:18Z")

</div>

Thanks, that is what I ended up doing:

```auto
Elasticsearch::Model.client = Elasticsearch::Client.new hosts: [machine1_ip, machine2_ip],
                                                          transport_options: { request: { timeout: 5 } }

```

---

<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 13, 2020, 5:03am UTC](https://discuss.elastic.co/t/point-to-any-machine-in-the-cluster/236595/5 "2020-07-13T05:03:22Z")

</div>

Closed on July 13, 2020, 5:03am UTC

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