AWS EC2 の Elasticsearch インストールに失敗する

AWS EC2 の Elasticsearch インストールに失敗する

aws ec2インスタンス(ubuntu)でelasticsearchを実行しようとしています。次のコマンドを実行しましたが、再起動に失敗しました。

root@ip-XXX-XX-XX-XXX:/usr/lib/systemd/system# sudo service elasticsearch start
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.

これを行うと、以下のsystemctl status elasticsearch.service 出力が返されます。

root@ip-XXX-XX-XX-XXX:/usr/lib/systemd/system# systemctl status elasticsearch
× elasticsearch.service - Elasticsearch
     Loaded: loaded (/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-08-15 23:21:15 UTC; 3min 18s ago
       Docs: https://www.elastic.co
    Process: 16934 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=217/USER)
   Main PID: 16934 (code=exited, status=217/USER)
        CPU: 1ms

Aug 15 23:21:15 ip-172-31-24-173 systemd[1]: Starting Elasticsearch...
Aug 15 23:21:15 ip-172-31-24-173 systemd[16934]: elasticsearch.service: Failed to determine user credentials: No such process
Aug 15 23:21:15 ip-172-31-24-173 systemd[16934]: elasticsearch.service: Failed at step USER spawning /usr/share/elasticsearch/bin/systemd-entrypoint: No such process
Aug 15 23:21:15 ip-172-31-24-173 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=217/USER
Aug 15 23:21:15 ip-172-31-24-173 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Aug 15 23:21:15 ip-172-31-24-173 systemd[1]: Failed to start Elasticsearch.

私のElasticsearchシステム構成は次のとおりです

root@ip-172-31-24-173:/usr/lib/systemd/system# more elasticsearch.service 
[Unit]
Description=Elasticsearch
Documentation=https://www.elastic.co
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
RuntimeDirectory=elasticsearch
PrivateTmp=true
Environment=ES_HOME=/usr/share/elasticsearch
Environment=ES_PATH_CONF=/etc/elasticsearch
Environment=PID_DIR=/var/run/elasticsearch
Environment=ES_SD_NOTIFY=true
EnvironmentFile=-/etc/sysconfig/elasticsearch

WorkingDirectory=/usr/share/elasticsearch

User=elasticsearch
Group=elasticsearch

ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet

# StandardOutput is configured to redirect to journalctl since
# some error messages may be logged in standard output before
# elasticsearch logging system is initialized. Elasticsearch
# stores its logs in /var/log/elasticsearch and does not use
# journalctl by default. If you also want to enable journalctl
# logging, you can simply remove the "quiet" option from ExecStart.
StandardOutput=journal
StandardError=inherit

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65535

# Specifies the maximum number of processes
LimitNPROC=4096

# Specifies the maximum size of virtual memory
LimitAS=infinity

# Specifies the maximum file size
LimitFSIZE=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0

# SIGTERM signal is used to stop the Java process
KillSignal=SIGTERM

# Send the signal only to the JVM rather than its control group
KillMode=process

# Java process is never killed
SendSIGKILL=no

# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143

# Allow a slow startup before the systemd notifier module kicks in to extend the timeout
TimeoutStartSec=75

[Install]
WantedBy=multi-user.target

# Built for packages-7.13.2 (packages)

私は言及したのと同じ手順に従いました。https://www.elastic.co/blog/running-elasticsearch-on-aws私が何か間違っているかどうかはわかりません。誰でもヒントを提供できますか?

ベストアンサー1

おすすめ記事