How to config discovery.zen.ping.unicast.hosts in command agruments

So, as the title, here's what i have tried:
./elasticsearch -E cluster.name=my_cluster -E node.name=node_master -E http.port=9200 -E discovery.zen.ping.unicast.hosts=["127.0.0.1:9201-9209"]

the reason for this is i want to setup 2 node in one machine and i really want to config it as command agrument, not in config file. i have work with this error for hours.

and here is the result:
java.net.UnknownHostException: 127.0.0.1:9201-9209: invalid IPv6 address at java.net.InetAddress.getAllByName(InetAddress.java:1169) ~[?:1.8.0_121] at java.net.InetAddress.getAllByName(InetAddress.java:1126) ~[?:1.8.0_121] at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:897) ~[elasticsear at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:852) at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.j at org.elasticsearch.discovery.zen.UnicastZenPing.lambda$null$0(UnicastZenPing.java:21 at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_121] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.ru at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?: at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]

please anyone show me what i'm missing?
Thanks so much.

There are a few issues with the value 127.0.0.1:9201-9209:

  1. There is no need to set the unicast hosts for localhost. Elasticsearch will properly find locally running nodes.
  2. The value does not accepts port ranges. Actually you should not be specifying any port at all in unicast hosts setting.
  3. The port range 9200 is for http connection. For transportation connection the default range is 9300.

So just remove the discovery.zen.ping.unicast.hosts and it will start (and also connect to other locally running nodes)

removing discovery.zen.ping.unicast.hosts solves my problem!
Thank you thiago.

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