cluster.name: my-cluster
node.name: master-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 172.31.82.55
http.port: 9200
discovery.seed_hosts: ["172.31.82.55", "172.31.86.217"]
cluster.initial_master_nodes: ["master-1", "master-2"]
but when I restart the elasticsearch it gives me an error
Job for elasticsearch.service failed because the control process exited with error code.
See "systemctl status elasticsearch.service" and "journalctl -xeu elasticsearch.service" for details.
my instance size is cpu:4 and ram : 8 gb
systemctl status elasticserch
^C
root@ip-172-31-82-55:/var/log/elasticsearch# systemctl status elasticsearch.service
× elasticsearch.service - Elasticsearch
Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-06-04 09:07:17 UTC; 3min 12s ago
Docs: https://www.elastic.co
Process: 1728 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 1728 (code=exited, status=1/FAILURE)
CPU: 28.882s
journalctl -xeu elasticsearch.service
See "systemctl status elasticsearch.service" and "journalctl -xeu elasticsearch.service" for details.
root@ip-172-31-82-55:/etc/elasticsearch# journalctl -xeu elasticsearch.service
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:727)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1229)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: ... 7 more
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: Caused by: com.fasterxml.jackson.core.JsonParseException: Duplicate field 'cluster.initial_master_nodes'
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at [Source: (ByteArrayInputStream); line: 109, column: 29]
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at com.fasterxml.jackson.core.json.JsonReadContext._checkDup(JsonReadContext.java:243)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at com.fasterxml.jackson.core.json.JsonReadContext.setCurrentName(JsonReadContext.java:237)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:482)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at com.fasterxml.jackson.core.JsonParser.nextFieldName(JsonParser.java:1091)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: at org.elasticsearch.xcontent.provider.json.JsonXContentParser.nextFieldName(JsonXContentParser.java:69)
Jun 04 08:57:00 ip-172-31-82-55 systemd-entrypoint[1671]: ... 10 more
Jun 04 08:57:00 ip-172-31-82-55 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ An ExecStart= process belonging to unit elasticsearch.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jun 04 08:57:00 ip-172-31-82-55 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Jun 04 08:57:00 ip-172-31-82-55 systemd[1]: Failed to start Elasticsearch.
░░ Subject: A start job for unit elasticsearch.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit elasticsearch.service has finished with a failure.
░░
░░ The job identifier is 1578 and the job result is failed.
Jun 04 08:57:00 ip-172-31-82-55 systemd[1]: elasticsearch.service: Consumed 2.014s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit elasticsearch.service completed and consumed the indicated resources.
Jun 04 09:07:02 ip-172-31-82-55 systemd[1]: Starting Elasticsearch...
░░ Subject: A start job for unit elasticsearch.service has begun execution
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit elasticsearch.service has begun execution.
░░
░░ The job identifier is 1744.
Jun 04 09:07:17 ip-172-31-82-55 systemd-entrypoint[1728]: ERROR: Elasticsearch did not exit normally - check the logs at /var/log/elasticsearch/my-cluster.log
Jun 04 09:07:17 ip-172-31-82-55 systemd-entrypoint[1728]: ERROR: Elasticsearch exited unexpectedly
Jun 04 09:07:17 ip-172-31-82-55 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ An ExecStart= process belonging to unit elasticsearch.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Jun 04 09:07:17 ip-172-31-82-55 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit elasticsearch.service has entered the 'failed' state with result 'exit-code'.
Jun 04 09:07:17 ip-172-31-82-55 systemd[1]: Failed to start Elasticsearch.
░░ Subject: A start job for unit elasticsearch.service has failed
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ A start job for unit elasticsearch.service has finished with a failure.
░░
░░ The job identifier is 1744 and the job result is failed.
Jun 04 09:07:17 ip-172-31-82-55 systemd[1]: elasticsearch.service: Consumed 28.882s CPU time.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: Enterprise open source support | Ubuntu
░░
░░ The unit elasticsearch.service completed and consumed the indicated resources.
root@ip-172-31-82-55:/var/log/elasticsearch# tail -f elasticsearch.log
[2023-06-04T08:45:06,042][INFO ][o.e.n.Node ] [ip-172-31-82-55] stopping ...
[2023-06-04T08:45:06,043][INFO ][o.e.c.f.AbstractFileWatchingService] [ip-172-31-82-55] shutting down watcher thread
[2023-06-04T08:45:06,044][INFO ][o.e.c.f.AbstractFileWatchingService] [ip-172-31-82-55] watcher service stopped
[2023-06-04T08:45:06,046][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [ip-172-31-82-55] [controller/860] [Main.cc@176] ML controller exiting
[2023-06-04T08:45:06,046][INFO ][o.e.x.m.p.NativeController] [ip-172-31-82-55] Native controller process has stopped - no new native processes can be started
[2023-06-04T08:45:06,048][INFO ][o.e.x.w.WatcherService ] [ip-172-31-82-55] stopping watch service, reason [shutdown initiated]
[2023-06-04T08:45:06,049][INFO ][o.e.x.w.WatcherLifeCycleService] [ip-172-31-82-55] watcher has stopped and shutdown
[2023-06-04T08:45:06,353][INFO ][o.e.n.Node ] [ip-172-31-82-55] stopped
[2023-06-04T08:45:06,354][INFO ][o.e.n.Node ] [ip-172-31-82-55] closing ...
[2023-06-04T08:45:06,375][INFO ][o.e.n.Node ] [ip-172-31-82-55] closed