ES_PATH_CONF ignored

What the title says. I already tried commenting out the source line in /usr/share/elasticsearch/bin/elasticsearch-env.

My unit file:

[Unit]
Description=Elasticsearch %i Server
Documentation=https://www.elastic.co
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
RuntimeDirectory=elasticsearch
RuntimeDirectoryPreserve=yes
PrivateTmp=true
Environment=LOG_DIR=/var/log/elasticsearch/%i
Environment=DATA_DIR=/var/lib/elasticsearch/%i
Environment=WORK_DIR=/usr/share/elasticsearch/%i
Environment=ES_PATH_CONF=/etc/elasticsearch/%i
EnvironmentFile=-/etc/sysconfig/elasticsearch

WorkingDirectory=/usr/share/elasticsearch

User=elasticsearch
Group=elasticsearch

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

StandardOutput=journal
StandardError=inherit

LimitNOFILE=65535
LimitNPROC=4096
LimitAS=infinity
LimitFSIZE=infinity
TimeoutStopSec=0
KillSignal=SIGTERM
KillMode=process
SendSIGKILL=no
SuccessExitStatus=143
TimeoutStartSec=75

[Install]
WantedBy=multi-user.target

My /etc/sysconfig/elasticsearch:

ES_HOME=/usr/share/elasticsearch
PID_DIR=/var/run/elasticsearch
ES_STARTUP_SLEEP_TIME=5
ES_SD_NOTIFY=true

It still complains in /var/log/elasticsearch//elasticsearch.log about default config from /etc/elasticsearch/elasticsearch.yml:

org.elasticsearch.ElasticsearchSecurityException: invalid configuration for xpack.security.transport.ssl - [xpack.security.transport.ssl.enabled] is not set, but the following settings have been configured in elasticsearch.yml : [xpack.security.transport.ssl.keystore.secure_password,xpack.security.transport.ssl.truststore.secure_password]

What am I doing wrong?

What are you trying to do, and what OS/distribution are you trying to do it on, and (sorry if this sounds rude) why ?

( maybe what you are trying to do something which is actually straightforward but you've found a complicated way to do it )

1 Like

Thank you for your reply.
I'm trying to have SystemD manage multiple instances of Elasticsearch.
I just found out that I was wrong about Elasticsearch reading the default configuration file. The options it was complaining about in the log were cached in the keystore. When I cleared those, everything started working fine.

1 Like