The log file /var/log/elasticsearch/elasticsearch.log
says
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) [elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) [elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) [elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) [elasticsearch-cli-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) [elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) [elasticsearch-7.8.0.jar:7.8.0]
[2020-07-23T00:26:08,270][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [df-aiprod001] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.8.0.jar:7.8.0]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:111) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.8.0.jar:7.8.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.8.0.jar:7.8.0]
... 6 more
But I guess that is from the direct start using sudo. Syslog outputs the following
Jul 23 00:37:37 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:37Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:37 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:37Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:40 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:40Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:40 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:40Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:42 SERVER1 systemd[1]: Starting Elasticsearch...
Jul 23 00:37:42 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:42Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:42 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:42Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: Exception in thread "main" java.lang.RuntimeException: starting java failed with [1]
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: output:
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: [0.001s][error][logging] Error opening log file '/var/log/elasticsearch/gc.log': Permission denied
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: [0.001s][error][logging] Initialization of output 'file=/var/log/elasticsearch/gc.log' using options 'filecount=32,filesize=64m' failed.
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: error:
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: OpenJDK 64-Bit Server VM warning: Ignoring option UseConcMarkSweepGC; support was removed in 14.0
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: OpenJDK 64-Bit Server VM warning: Ignoring option CMSInitiatingOccupancyFraction; support was removed in 14.0
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: OpenJDK 64-Bit Server VM warning: Ignoring option UseCMSInitiatingOccupancyOnly; support was removed in 14.0
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details.
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: Error: Could not create the Java Virtual Machine.
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: Error: A fatal exception has occurred. Program will exit.
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: #011at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:126)
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: #011at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: #011at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: #011at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:137)
Jul 23 00:37:43 SERVER1 systemd-entrypoint[21213]: #011at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
Jul 23 00:37:43 SERVER1 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 23 00:37:43 SERVER1 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Jul 23 00:37:43 SERVER1 systemd[1]: Failed to start Elasticsearch.
Jul 23 00:37:45 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:45Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:45 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:45Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:47 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:47Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:47 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:47Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:50 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:50Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:50 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:50Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","monitoring"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","monitoring"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","plugins","licensing"],"pid":1139,"message":"License information could not be obtained from Elasticsearch due to Error: No Li$
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","data"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","data"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","plugins","licensing"],"pid":1139,"message":"License information could not be obtained from Elasticsearch due to Error: No Li$
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:52 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:52Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:55 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:55Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:55 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:55Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:37:57 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:57Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:37:57 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:37:57Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:00 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:00Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:38:00 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:00Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:02 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:02Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:38:02 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:02Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:05 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:05Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:38:05 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:05Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:07 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:07Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:38:07 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:07Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:10 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:10Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
Jul 23 00:38:10 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:10Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"No living connections"}
Jul 23 00:38:12 SERVER1 kibana[1139]: {"type":"log","@timestamp":"2020-07-22T22:38:12Z","tags":["warning","elasticsearch","admin"],"pid":1139,"message":"Unable to revive connection: http://localhost:9200/"}
It looks like the kibana error occurs every fews seconds all day long.