Hello !
After some tests on preproduction with rpm, i begin to configure production environment.
Problem : Elasticsearch doesn't work in root user + It's not a service (source : tar.gz)
Currently context : Elasticsearch 5.5 with source .tar.gz
I want create a service for elasticsearch. So i have editer under " /etc/systemd/system/multi-user.target.wants/elasticsearch.service" :
[Unit]
Description=Elasticsearch
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/elasticsearch
WorkingDirectory=/opt/elasticsearch
User=elasticsearch
Group=elasticsearch
ExecStartPre=/opt/elasticsearch/bin/elasticsearch-systemd-pre-exec
ExecStart=/opt/elasticsearch/bin/elasticsearch \
-p /var/run/elasticsearch/elasticsearch.pid \
--quiet \
-Edefault.path.logs=/opt/elasticsearch/logs \
-Edefault.path.data=/elasticsearch-data \
-Edefault.path.conf=/opt/elasticsearch/config
StandardError=inherit
LimitNOFILE=65536
LimitMEMLOCK=infinity
TimeoutStopSec=0
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
So when i start it, when i show service's status i see :
Active: failed (Result: exit-code) since Wed 2017-07-26 11:17:34 CEST; 17min ago
Docs: http://www.elastic.co
Process: 5177 ExecStart=/opt/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet -Edefault.path.logs=/opt/elasticsearch/logs -Edefault.path.data=/elasticsearch-data -Edefault.path.conf=/opt/elasticsearch/config (code=exited, status=1/FAILURE)
Process: 5174 ExecStartPre=/opt/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
Main PID: 5177 (code=exited, status=1/FAILURE)