Elasticsearch systemd 设置

Elasticsearch systemd 设置

我正在 CentOS 7.7 上配置 Elasticsearch 2.3.3(是的,已经过时了)。我们在 CentOS 6 上使用 InitV 脚本运行它。我遵循了此规格创建systemd脚本并从当前弹性源

/etc/systemd/system/elastic.service

[Unit]
Description=Elasticsearch
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
RuntimeDirectory=elastics
WorkingDirectory=/opt/app/elastic/default/
ExecStart=/opt/app/elastic/default/bin/systemd-entrypoint -d -p ${PID_DIR}/elasticsearch.pid 
StandardOutput=journal
StandardError=inherit
TimeoutStopSec=0
KillSignal=SIGTERM
KillMode=process
SendSIGKILL=no
SuccessExitStatus=143

当我启动该服务时,它说失败,但实际上该进程已启动并正在运行:

-- Subject: Unit elastic.service has begun start-up
-- Defined-By: systemd
-- Unit elastic.service has begun starting up.
May 20 14:14:31 SE1 systemd[1]: Failed to start Elasticsearch.
-- Subject: Unit elastic.service has failed
-- Defined-By: systemd
-- Unit elastic.service has failed.
-- The result is failed.
May 20 14:14:31 SE1 systemd[1]: Unit elastic.service entered failed state.
May 20 14:14:31 SE1 systemd[1]: elastic.service failed.
May 20 14:14:31 SE1 polkitd[761]: Unregistered Authentication Agent for unix-process:20886:44881306     (system bus name :1.23878, object path /org/free

#cat /opt/data/elastic/work/elasticsearch.pid
20903
# ps lww 20903
F   UID    PID   PPID PRI  NI    VSZ   RSS WCHAN  STAT TTY        TIME COMMAND
0   606  20903      1  20   0 4692828 274460 futex_ Sl ?          0:09 /bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/opt/app/elastic/default -cp /opt/app/elastic/default/lib/elasticsearch-2.3.3.jar:/opt/app/elastic/default/lib/* org.elasticsearch.bootstrap.Elasticsearch start -d -p /opt/data/elastic/work/elasticsearch.pid

我该如何解决这个问题?停止也不起作用。谢谢

相关内容