Failed start elasticsearch after install

Hi,

I've an error message after "sudo systemctl start elasticsearch" :

Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xe" for details.

systemctl status :

elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sun 2023-05-21 19:35:16 CEST; 14s ago
       Docs: https://www.elastic.co
    Process: 4138 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/>
   Main PID: 4138 (code=exited, status=1/FAILURE)
        CPU: 1.555s

mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         at com.fasterxml.jackson.core.json.JsonReadContext._checkDup(JsonReadContext.java:>
mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         at com.fasterxml.jackson.core.json.JsonReadContext.setCurrentName(JsonReadContext.>
mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:471)
mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         at com.fasterxml.jackson.core.JsonParser.nextFieldName(JsonParser.java:1065)
mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         at org.elasticsearch.xcontent.provider.json.JsonXContentParser.nextFieldName(JsonX>
mai 21 19:35:16 vm-elk systemd-entrypoint[4138]:         ... 10 more
mai 21 19:35:16 vm-elk systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
mai 21 19:35:16 vm-elk systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
mai 21 19:35:16 vm-elk systemd[1]: Failed to start Elasticsearch.
mai 21 19:35:16 vm-elk systemd[1]: elasticsearch.service: Consumed 1.555s CPU time.

journalctl -xe :

mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.node.InternalSettingsPreparer.prepareEnvironment(InternalSett>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.common.cli.EnvironmentAwareCommand.createEnv(EnvironmentAware>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCo>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.cli.Command.main(Command.java:50)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]: Caused by: org.elasticsearch.xcontent.XContentParseException: [109:29] Duplicate field 'cl>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:  at [Source: (ByteArrayInputStream); line: 109, column: 29]
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.xcontent.provider.json.JsonXContentParser.newXContentParseExc>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.xcontent.provider.json.JsonXContentParser.nextFieldName(JsonX>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:755)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:723)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         ... 7 more
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]: Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'cluster.initial>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:  at [Source: (ByteArrayInputStream); line: 109, column: 29]
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at com.fasterxml.jackson.core.json.JsonReadContext._checkDup(JsonReadContext.java:>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at com.fasterxml.jackson.core.json.JsonReadContext.setCurrentName(JsonReadContext.>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:471)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at com.fasterxml.jackson.core.JsonParser.nextFieldName(JsonParser.java:1065)
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         at org.elasticsearch.xcontent.provider.json.JsonXContentParser.nextFieldName(JsonX>
mai 21 19:46:43 vm-elk systemd-entrypoint[4184]:         ... 10 more
mai 21 19:46:43 vm-elk systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ An ExecStart= process belonging to unit elasticsearch.service has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 1.
mai 21 19:46:43 vm-elk systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
mai 21 19:46:43 vm-elk systemd[1]: Failed to start Elasticsearch.
░░ Subject: L'unité (unit) elasticsearch.service a échoué
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ L'unité (unit) elasticsearch.service a échoué, avec le résultat failed.
mai 21 19:46:43 vm-elk systemd[1]: elasticsearch.service: Consumed 1.546s CPU time.
░░ Subject: Ressources consommées durant l'éxécution de l'unité (unit)
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ L'unité (unit) elasticsearch.service s'est arrêtée et a consommé les ressources indiquées.

Sorry, something lines in Frensh ...

Duplicate field 'cluster.initial

You have duplicate field. Check cluster.initial_master_nodes in elasticsearch.yml

Thx.

I've only on node

cluster.initial_master_nodes: ["node-1"]

My bad .. sorry.

I've a another line "cluster.initial_master_nodes" in #Enable encryption and mutual authentication between cluster nodes.

"#" fix the problem, elasticsearch is run.

1 Like

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