Skip to content

Instantly share code, notes, and snippets.

@jessejlt
Created May 14, 2012 19:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessejlt/2695724 to your computer and use it in GitHub Desktop.
Save jessejlt/2695724 to your computer and use it in GitHub Desktop.
ElasticSearch zen unicast discovery

Goal

I currently have a single machine running an ElasticSearch instance that already contains data and some index configurations. I have brought a new node online (a Linux VM) and would like to create a cluster between the master and said new node.

Issue

The new Linux node can't seem to establish a connection to my master. The log says

[2012-05-14 11:46:59,891][WARN ][discovery.zen.ping.unicast] [media-node1] failed to send ping to [[#zen_unicast_1#][inet[/153.32.228.250:9300]]]
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[/153.32.228.250:9300]][discovery/zen/unicast] request_id [0] timed out after [3752ms]
	at org.elasticsearch.transport.TransportService$TimeoutHandler.run(TransportService.java:347)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
	at java.lang.Thread.run(Thread.java:679)

Not reachable?

The log seems to indicate that the specified machine might not be reachable, or at least not on the specified port, so from the same Linux node I tried pinging the machine to get its cluster state:

curl -XGET http://153.32.228.250:9200/_cluster/nodes | python -m json.tool
{
    "cluster_name": "elasticsearch_media", 
    "nodes": {
        "qUxSLpXNTNyO9jlq9OBf4w": {
            "attributes": {
                "master": "true"
            }, 
            "http": {
                "bound_address": "inet[/0.0.0.0:9200]", 
                "publish_address": "inet[/153.32.228.250:9200]"
            }, 
            "http_address": "inet[/153.32.228.250:9200]", 
            "jvm": {
                "mem": {
                    "heap_init": "256mb", 
                    "heap_init_in_bytes": 268435456, 
                    "heap_max": "1011.2mb", 
                    "heap_max_in_bytes": 1060372480, 
                    "non_heap_init": "23.1mb", 
                    "non_heap_init_in_bytes": 24317952, 
                    "non_heap_max": "130mb", 
                    "non_heap_max_in_bytes": 136314880
                }, 
                "pid": 83978, 
                "start_time": 1337019720794, 
                "version": "1.6.0_31", 
                "vm_name": "Java HotSpot(TM) 64-Bit Server VM", 
                "vm_vendor": "Apple Inc.", 
                "vm_version": "20.6-b01-415"
            }, 
            "name": "media-dev", 
            "network": {
                "refresh_interval": 5000
            }, 
            "os": {
                "refresh_interval": 1000
            }, 
            "process": {
                "id": 83978, 
                "max_file_descriptors": 150000, 
                "refresh_interval": 1000
            }, 
            "transport": {
                "bound_address": "inet[/0.0.0.0:9300]", 
                "publish_address": "inet[/153.32.228.250:9300]"
            }, 
            "transport_address": "inet[/153.32.228.250:9300]"
        }
    }
}

So it at least looks like the master node is reachable by the slave node and is listening on the correct port.

cluster.name: elasticsearch_media
node.name: "media-dev"
node.master: true
node.data: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["153.32.228.250[9300-9400]", "10.122.234.19[9300-9400]"]
cluster.name: elasticsearch_media
node.name: "media-slave1"
node.master: true
node.data: true
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["153.32.228.250[9300-9400]", "10.122.234.19[9300-9400]"]
@syllogismos
Copy link

were you able to make this work? this gist is from 2012.. What did you find and how did you fix it? 😥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment