0

I have two computers A(192.168.0.224) and B(192.168.0.123) and there is a ES server on each computer. Config file elasticsearch.yml on A:

cluster.name: elasticssearch
node.name: node-1

network.host: 0.0.0.0


discovery.zen.ping.unicast.hosts: 192.168.0.224:9200,192.168.0.123:9200


index.analysis.analyzer.default.type: ik

script.engine.groovy.inline.update: on 
script.engine.groovy.inline.search: on 

index.mapper.dynamic : false

Config file elasticsearch.yml on B:

cluster.name: elasticssearch
node.name: node-2

network.host: 0.0.0.0


discovery.zen.ping.unicast.hosts: 192.168.0.224:9200,192.168.0.123:9200


index.analysis.analyzer.default.type: ik

script.engine.groovy.inline.update: on 
script.engine.groovy.inline.search: on 

index.mapper.dynamic : false

I start ES server and get the error information:

    [2016-08-01 10:05:42,683][WARN ][discovery.zen.ping.unicast] [node-2] failed to send ping to [{#zen_unicast_2#}{192.168.0.224}{192.168.0.224:9200}]
ReceiveTimeoutTransportException[[][192.168.0.224:9200][internal:discovery/zen/unicast] request_id [1] timed out after [3750ms]]
    at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:679)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

how to run elasticsearch server on different computers correctly?

1 Answer 1

2

The discovery.zen.ping.unicast.hosts property needs a slight tweak, i.e. you need to specify the TCP port (defaults to 9300) and not the HTTP port 9200:

discovery.zen.ping.unicast.hosts: 192.168.0.224:9300,192.168.0.123:9300

You can also leave out the port so that it takes the default TCP port (9300) and you don't have to worry about it:

discovery.zen.ping.unicast.hosts: 192.168.0.224,192.168.0.123
Sign up to request clarification or add additional context in comments.

5 Comments

Thank you for helping me out again!Show respect for you!
If want to add a third machine C(192.168.0.173) to the cluster,I need to update the config file again:discovery.zen.ping.unicast.hosts: 192.168.0.224,192.168.0.123,192.168.0.173.I want to know if there is a way to to achieve that if a new machine added without updating the config file?
Ideally, discovery.zen.ping.unicast.hosts only needs to have the list of master nodes, not data nodes. So you can have one or more permanent master nodes and use their IPs in the config of all data nodes. When you add a new data node, you simply need to start your new node without modifying the existing ones.
If the master nodes dead,can node data be selected to master node?
At all times, there must always be at least one master node available, if you have a single master-eligible node and it dies, your cluster dies. You can have two master-eligible nodes, but you run the risk of suffering from "split brain". Ideally, you should have 3 master-eligible nodes to make sure that your cluster can run safely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.