I changed the configuration to elasticsearch.yml
Current part of the configuration:
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /es_certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /es_certs/elastic-certificates.p12
After rebooting elasticsearch I get:
● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2019-11-17 08:43:27 UTC; 2min 37s ago
Docs: http://www.elastic.co
Process: 2970 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 2970 (code=exited, status=1/FAILURE)
Logs:
Nov 17 06:25:02 icluster-node-d000 rsyslogd: [origin software="rsyslogd" swVersion="8.32.0" x-pid="1011" x-info="http://www.rsyslog.com"] rsyslogd was HUPed
Nov 17 06:47:01 icluster-node-d000 CRON[2808]: (root) CMD (test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ))
Nov 17 06:53:16 icluster-node-d000 systemd-timesyncd[678]: Timed out waiting for reply from 91.189.89.199:123 (ntp.ubuntu.com).
Nov 17 06:53:16 icluster-node-d000 systemd-timesyncd[678]: Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com).
Nov 17 07:17:01 icluster-node-d000 CRON[2823]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Nov 17 07:29:11 icluster-node-d000 systemd-timesyncd[678]: Timed out waiting for reply from 91.189.89.198:123 (ntp.ubuntu.com).
Nov 17 08:03:31 icluster-node-d000 systemd-timesyncd[678]: Timed out waiting for reply from 91.189.89.199:123 (ntp.ubuntu.com).
Nov 17 08:03:41 icluster-node-d000 systemd-timesyncd[678]: Timed out waiting for reply from 91.189.91.157:123 (ntp.ubuntu.com).
Nov 17 08:03:41 icluster-node-d000 systemd-timesyncd[678]: Synchronized to time server 91.189.89.198:123 (ntp.ubuntu.com).
Nov 17 08:17:01 icluster-node-d000 CRON[2829]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Nov 17 08:43:03 icluster-node-d000 systemd[1]: Created slice User Slice of icluster.
Nov 17 08:43:03 icluster-node-d000 systemd[1]: Starting User Manager for UID 1000...
Nov 17 08:43:03 icluster-node-d000 systemd[1]: Started Session 20 of user icluster.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Listening on GnuPG cryptographic agent and passphrase cache (access for web browsers).
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Listening on GnuPG network certificate management daemon.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Reached target Timers.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Listening on GnuPG cryptographic agent and passphrase cache.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Reached target Sockets.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Reached target Paths.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Reached target Basic System.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Reached target Default.
Nov 17 08:43:03 icluster-node-d000 systemd[2834]: Startup finished in 33ms.
Nov 17 08:43:03 icluster-node-d000 systemd[1]: Started User Manager for UID 1000.
Nov 17 08:43:24 icluster-node-d000 systemd[1]: Started Elasticsearch.
Nov 17 08:43:24 icluster-node-d000 elasticsearch[2970]: warning: Falling back to java on path. This behavior is deprecated. Specify JAVA_HOME
Nov 17 08:43:25 icluster-node-d000 elasticsearch[2970]: OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Nov 17 08:43:25 icluster-node-d000 elasticsearch[2970]: OpenJDK 64-Bit Server VM warning: UseAVX=2 is not supported on this CPU, setting it to UseAVX=0
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /etc/elasticsearch/certs/elastic.p12
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: Likely root cause: java.nio.file.AccessDeniedException: /etc/elasticsearch/certs/elastic.p12
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/java.nio.file.Files.readAttributes(Files.java:1763)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/java.nio.file.FileTreeWalker.getAttributes(FileTreeWalker.java:225)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:276)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at java.base/java.nio.file.Files.walkFileTree(Files.java:2760)
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: #011at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:218)
[...]
According to this information, elasticsearch starts with a different path:
Nov 17 08:43:27 icluster-node-d000 elasticsearch[2970]: Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /etc/elasticsearch/certs/elastic.p12
/etc/elasticsearch/certs/elastic.p12 is old path.
However, the current path in the configuration (yml file) is:
/es_certs/elastic-certificates.p12
Why is elasticsearch not loading the new path?
How to force path update?