Elasticsearch: If I set discovery.zen.ping.multicast.enabled: False, elasticsearch fails to listen on 9200 & 9300 when starting.

Created on 1 Feb 2017  路  6Comments  路  Source: elastic/elasticsearch

node info:

# hostnamectl status
   Static hostname: s-ut-elastic-1
         Icon name: computer-server
           Chassis: server
        Machine ID: 1ab7251ca70947c18adc673e013e1633
           Boot ID: 5916a99b4ec548ea87e4f8ad07018035
  Operating System: CentOS Linux 7 (Core)
       CPE OS Name: cpe:/o:centos:centos:7
            Kernel: Linux 3.10.0-514.6.1.el7.x86_64
      Architecture: x86-64

Problem:
I currently only have 1 node in the cluster (still setting up).

Here is my elasticsearch.yml (with the offending lines commented):

cluster.name: es_cluster_draper_ut
node.name: s-ut-elastic-1.stc.local
bootstrap.memory_lock: true
network.host: 0.0.0.0
#discovery.zen.ping.multicast.enabled: False
#discovery.zen.ping.unicast.hosts: ['10.1.0.20']

If I start ES, netstat confirms java is listening on 9200 and 9300:

# netstat -plant
Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1002/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1878/master
tcp        0      0 0.0.0.0:5666            0.0.0.0:*               LISTEN      998/nrpe
tcp        0      0 10.1.0.20:22            10.1.2.16:47797         ESTABLISHED 2573/sshd: rich.a [
tcp        0      0 10.1.0.20:55826         10.1.10.10:4505         ESTABLISHED 1396/python
tcp6       0      0 :::9200                 :::*                    LISTEN      6774/java
tcp6       0      0 :::9300                 :::*                    LISTEN      6774/java
tcp6       0      0 :::22                   :::*                    LISTEN      1002/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      1878/master
tcp6       0      0 :::5666                 :::*                    LISTEN      998/nrpe
tcp6       0      0 127.0.0.1:48070         127.0.0.1:9300          TIME_WAIT   -
tcp6       0      0 ::1:36436               ::1:9300                TIME_WAIT   -

and curl results:

# curl -XGET 'localhost:9200/?pretty'
{
  "name" : "s-ut-elastic-1.stc.local",
  "cluster_name" : "es_cluster_draper_ut",
  "cluster_uuid" : "Xf7jgC6UQPi8xFSvSW8ukw",
  "version" : {
    "number" : "5.2.0",
    "build_hash" : "24e05b9",
    "build_date" : "2017-01-24T19:52:35.800Z",
    "build_snapshot" : false,
    "lucene_version" : "6.4.0"
  },
  "tagline" : "You Know, for Search"
}

If I uncomment the 2 lines in my elasticsearch.yml file, and restart elasticsearch, the server never starts listening on 9200 or 9300. Also, I get the following in /var/log/messages:

Jan 31 14:21:57 s-ut-elastic-1 systemd: Starting Elasticsearch...
Jan 31 14:21:57 s-ut-elastic-1 systemd: Started Elasticsearch.
Jan 31 14:22:09 s-ut-elastic-1 systemd: elasticsearch.service: main process exited, code=exited, status=1/FAILURE
Jan 31 14:22:09 s-ut-elastic-1 systemd: Unit elasticsearch.service entered failed state.
Jan 31 14:22:09 s-ut-elastic-1 systemd: elasticsearch.service failed.

This is ES 5.2.0 with java-1.8.0-openjdk installed. The only change that I have made other than to the elasticsearch.yml file is, I added a file to /etc/systemd/elasticsearch/service.d/elasticsearch.conf:

[Service]
LimitMEMLOCK=infinity

which was according to this document.

Most helpful comment

Ah, OK, I I keep the line:

discovery.zen.ping.unicast.hosts: <hosts>

and only remove

discovery.zen.ping.multicast.enabled: False

Thanks!

All 6 comments

The setting discovery.zen.ping.multicast.enabled is not valid in Elasticsearch 5.x, multicast was relegated to a plugin in the 2.x series where it was deprecated, and then removed as a plugin in 5.x. Without this plugin, the setting doesn't exist and Elasticsearch will refuse to start if you try to use a setting that does not exist. If you check your Elasticsearch logs, you should see:

[2017-02-01T12:39:50,405][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [discovery.zen.ping.multicast.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.0.jar:5.2.0]
Caused by: java.lang.IllegalArgumentException: unknown setting [discovery.zen.ping.multicast.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings
    at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:276) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.common.settings.AbstractScopedSettings.validate(AbstractScopedSettings.java:244) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.common.settings.SettingsModule.<init>(SettingsModule.java:138) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.node.Node.<init>(Node.java:328) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.node.Node.<init>(Node.java:232) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:241) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.0.jar:5.2.0]
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.0.jar:5.2.0]

I see. How do 5.x clusters form without multicast being enabled? In other words, is there a replacement setting?

How do 5.x clusters form without multicast being enabled?

They use unicast discovery.

Ah, OK, I I keep the line:

discovery.zen.ping.unicast.hosts: <hosts>

and only remove

discovery.zen.ping.multicast.enabled: False

Thanks!

You're welcome.

Thanks you very much !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brwe picture brwe  路  3Comments

dawi picture dawi  路  3Comments

malpani picture malpani  路  3Comments

ttaranov picture ttaranov  路  3Comments

clintongormley picture clintongormley  路  3Comments