![AWS EC2 上的 Elasticsearch 安装失败](https://linux22.com/image/223538/AWS%20EC2%20%E4%B8%8A%E7%9A%84%20Elasticsearch%20%E5%AE%89%E8%A3%85%E5%A4%B1%E8%B4%A5.png)
我正在尝试在 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我不确定我是否做错了什么?任何人都可以提供任何提示。