# Help me set up a multi-server environment

**URL:** <https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 9:11am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292 "2020-03-12T09:11:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jw.lee](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jw.lee](https://discuss.elastic.co/u/jw.lee)\
**Post date:** [March 12, 2020, 9:11am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/1 "2020-03-12T09:11:55Z")

</div>

I want to connect 3 external PCs.  
Three internal devices tested have been connected correctly.  
I want to set it to communicate with an external PC.

Testing Elasticsearch.yml on the internal network

--------------------- pc1 ----------------  
cluster.name: "test-cluster"  
node.name: "master"  
node.master: true  
node.data: false  
transport.tcp.port: 9300  
http.port: 9200  
discovery.seed\_hosts: ["192.168.0.x1:9300","192.168.0.x2:9301","192.168.0.x3:9302"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0  
--------------------- pc2 ----------------  
cluster.name: "test-cluster"  
node.name: "data1"  
node.master: false  
node.data: true  
transport.tcp.port: 9301  
http.port: 9201  
discovery.seed\_hosts: ["192.168.0.x1:9300","192.168.0.x2:9301","192.168.0.x3:9302"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0  
--------------------- pc3 ----------------  
cluster.name: "test-cluster"  
node.name: "data2"  
node.master: false  
node.data: true  
transport.tcp.port: 9302  
http.port: 9202  
discovery.seed\_hosts: ["192.168.0.x1:9300","192.168.0.x2:9301","192.168.0.x3:9302"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0

This works very well.

* * *

but,  
I want an external network connection, not an internal network connection.  
218.xxx.xxx.xxx  
Open port: 9200, 9300,5601  
182.xxx.xxx.1  
Open port: 9211,9212  
182.xxx.xxx.2  
Open port: 9311,9312

elasticsearch.yml  
--------------------- 218.xxx.xxx.xxx----------------  
cluster.name: "test-cluster"  
node.name: "master"  
node.master: true  
node.data: false  
transport.tcp.port: 9300  
http.port: 9200  
discovery.seed\_hosts: ["218.xxx.xxx.xxx:9300","182.xxx.xxx.1:9311","182.xxx.xxx.2:9312"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0  
--------------------- 182.xxx.xxx.1----------------  
cluster.name: "test-cluster"  
node.name: "data1"  
node.master: false  
node.data: true  
transport.tcp.port: 9311  
http.port: 9211  
discovery.seed\_hosts: ["218.xxx.xxx.xxx:9300","182.xxx.xxx.1:9311","182.xxx.xxx.2:9312"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0  
--------------------- 182.xxx.xxx.2----------------  
cluster.name: "test-cluster"  
node.name: "data2"  
node.master: false  
node.data: true  
transport.tcp.port: 9312  
http.port: 9212  
discovery.seed\_hosts: ["218.xxx.xxx.xxx:9300","182.xxx.xxx.1:9311","182.xxx.xxx.2:9312"]  
cluster.initial\_master\_nodes: ["master"]  
network.host: 0.0.0.0

The process is running on each PC.  
218.xxx.xxx.xxx Search 182.xxx:9211 on Google on PC  
The Json format information screen that appears when executed is displayed.  
However, when I index it, I get a warning message.  
"master not discovered yet"

There is no port forwarding problem.  
Please let me know if there are any settings I have missed.

---

<div class="post-metadata">

**Author:** ![wifi](https://avatars.discourse-cdn.com/v4/letter/w/f05b48/32.png) [@wifi](https://discuss.elastic.co/u/wifi)\
**Post date:** [March 12, 2020, 9:35am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/2 "2020-03-12T09:35:56Z")

</div>

Try the following config on each node:

--------------------- 182.xxx.xxx.2----------------  
cluster.name: "test-cluster"  
node.name: "data2"  
node.master: false  
node.data: true  
transport.tcp.port: 9312  
http.port: 9212  
discovery.seed\_hosts: ["218.xxx.xxx.xxx:9300","182.xxx.xxx.1:9311","182.xxx.xxx.2:9312"]  
cluster.initial\_master\_nodes: [" **218.xxx.xxx.xxx**"]  
network.host: **182.xxx.xxx.2**

**WARNING: it is not encouraged to expose elasticsearch nodes directly over the internet**

---

<div class="post-metadata">

**Author:** ![jw.lee](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jw.lee](https://discuss.elastic.co/u/jw.lee)\
**Post date:** [March 12, 2020, 9:42am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/3 "2020-03-12T09:42:23Z")

</div>

Thank you for your reply.  
Thanks for the warning.  
All of the above information is false information.

182.xxx.1 / 2 These two PCs are a vm environment.

network.host:ip:port

Can you write like this?

---

<div class="post-metadata">

**Author:** ![wifi](https://avatars.discourse-cdn.com/v4/letter/w/f05b48/32.png) [@wifi](https://discuss.elastic.co/u/wifi)\
**Post date:** [March 12, 2020, 9:44am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/4 "2020-03-12T09:44:34Z")

</div>

I don't understand, maybe the docs help you:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/network.host.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/network.host.html)

[https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-discovery-bootstrap-cluster.html](https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-discovery-bootstrap-cluster.html)

---

<div class="post-metadata">

**Author:** ![jw.lee](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jw.lee](https://discuss.elastic.co/u/jw.lee)\
**Post date:** [March 12, 2020, 10:01am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/5 "2020-03-12T10:01:38Z")

</div>

Thanks for the kind answer.  
However, the link has already been confirmed. I didn't understand the link.

My question is wrong.  
182.xxx.1  
182.xxx.2 \<\< ip was recorded incorrectly.

182.xxx.1 VM 10.0.2.15-docker-172.17.0.2 Port: 9211, 9311  
182.xxx.1 VM 10.0.2.16-docker-172.17.0.2 Port: 9212, 9312

It is like this.

network.host: ??

How should I use it?

---

<div class="post-metadata">

**Author:** ![wifi](https://avatars.discourse-cdn.com/v4/letter/w/f05b48/32.png) [@wifi](https://discuss.elastic.co/u/wifi)\
**Post date:** [March 12, 2020, 10:29am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/6 "2020-03-12T10:29:21Z")

</div>

In this setting you can either write down the IP of the server or FQDN

IP:

```
network.host: 182.xxx.1

```

or FQDN:

```
network.host: my_server.my_domain.com
```

---

<div class="post-metadata">

**Author:** ![jw.lee](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jw.lee](https://discuss.elastic.co/u/jw.lee)\
**Post date:** [March 19, 2020, 8:39am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/7 "2020-03-19T08:39:41Z")

</div>

I solved it by adding 'network.publish\_host:'.  
Thank you so much

---

<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:** [April 16, 2020, 8:39am UTC](https://discuss.elastic.co/t/help-me-set-up-a-multi-server-environment/223292/8 "2020-04-16T08:39:48Z")

</div>

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