it says : [ ok ] Starting elasticsearch (via systemctl): elasticsearch.service. .
But I can't find the progress (ps -ef | grep elasticsearch prints nothing) and the directory/var/log/elasticsearch only has a gc.log.0.current log without any error message.
I followed your suggestion, sudo journalctl -u elasticsearch.service prints many Errors :
elasticsearch[5572]: 2018-10-17 14:12:37,074 main ERROR RollingFileManager (/usr/share/elasticsearch/logs/elasticse
at java.io.FileOutputStream.open0(Native Method)
......
elasticsearch[5572]: 2018-10-17 14:12:37,091 main ERROR Could not create plugin of type class org.apache.logging.lo
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.j
......
Error messages make a hit of permission problem.
After changing the owner of /var/logs/elasticsearch and /usr/share/elasticsearch to elastcisearch:elasticsearch, new error messages are logged in /usr/share/elasticsearch as follow:
java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:298) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:122) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) [elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) [elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) [elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) [elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) [elasticsearch-cli-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-cli-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) [elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) [elasticsearch-6.4.2.jar:6.4.2]
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_181]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_181]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_181]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0_181]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_181]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_181]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_181]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:412) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:68) ~[elasticsearch-6.4.2.jar:6.4.2]
... 12 more
[2018-10-17T17:07:23,171][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.4.2.jar:6.4.2]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-6.4.2.jar:6.4.2]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:70) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:298) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:122) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.4.2.jar:6.4.2]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:1.8.0_181]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:1.8.0_181]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:1.8.0_181]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:1.8.0_181]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_181]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_181]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_181]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:412) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:68) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:298) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:253) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Security.configure(Security.java:122) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:208) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) ~[elasticsearch-6.4.2.jar:6.4.2]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-6.4.2.jar:6.4.2]
... 6 more
I want to provide more information about how I install the ES:
I first install ES (sudo apt install default-jdk && sudo apt install elasticsearch), and the ES version is 1.. .
Then, I remove the ES with sudo apt remove elasticsearch and sudo apt autoremove, and manually install the current ES6.4.2 with the deb file.
Well it definitely looks like your install has gone badly - but unless you're going to wipe the whole box and start again, the only suggestion I have is to keep trying to start the service and then fix up the permissions as you run into them.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.