# Elasticsearch cluster, Master-Slave relationship and querying

**URL:** <https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115>\
**Category:** Elasticsearch\
**Created:** [August 26, 2015, 2:26pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115 "2015-08-26T14:26:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya\_Patel](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@Aditya\_Patel](https://discuss.elastic.co/u/Aditya_Patel)\
**Post date:** [August 26, 2015, 2:26pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115/1 "2015-08-26T14:26:43Z")

</div>

Hi

Initially, i was running elasticsearch on a single machine on a rackspace. In the config file, i had  
in the beginning written

```
network.host: localhost

```

Later when i had to run elasticsearch server on two machines , i had to change it to

```
network.host: 123.23.44.23 (basically current ip address of machine) 

```

I changed

```
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["123.23.44.23","104.23.44.23"]

```

Now i have two questions:

1. I have configured one master and one non-master. Since i have changed my network.host. Should i always post to master ip address. Can i still maintain localhost as my posting ip.
2. I am also using kibana to visualize the data, since i have changed the network.host. I changed it in the kibana.yml [I had put ip address of master] file as well and restarted it. It stopped working give me an 502 bad gateway error.

Can anybody give me another to expose my two machines apart from changing network.host property or rectify the above two problems?

I am quite new to elasticsearch cluster, i tried going through other discussion forums but couldn't find relevant information

Thanks!

---

<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:** [August 28, 2015, 3:36am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115/2 "2015-08-28T03:36:30Z")

</div>

1. Doesn't matter.
2. You can still use localhost here.

---

<div class="post-metadata">

**Author:** ![Aditya\_Patel](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@Aditya\_Patel](https://discuss.elastic.co/u/Aditya_Patel)\
**Post date:** [August 28, 2015, 4:49am UTC](https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115/3 "2015-08-28T04:49:40Z")

</div>

Hi Mark,

Thanks for the reply. It wasn't working when i was setting

```
elasticsearch_url: "http://localhost:9200"

```

in kibana.yml.

The only way i could get it work was to change the master in elasticsearch config file:

```
network.host: 123.23.44.23 -> network.host: localhost and adding transport.host:123.23.44.23

```

This way i could expose the ip of machine for other node to discover and form the cluster.

Rest all i kept the same.

Let me know what you think about it.

---

<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 5, 2017, 11:53pm UTC](https://discuss.elastic.co/t/elasticsearch-cluster-master-slave-relationship-and-querying/28115/4 "2017-07-05T23:53:22Z")

</div>


