Elasticsearch 5.0 start up error


(Manoj) #1

Dear All,
I followed the Elasticsearch 5.0 installation steps provided in https://www.elastic.co/guide/en/elasticsearch/reference/5.0/_installation.html

On running the ./elasticsearch to start, I get the error as in Attachment. Cannot run as root user.
OS is RedHat: Linux ip-10-34-70-106 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 9 10:09:10 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux


(Christian Dahlqvist) #2

Elasticsearch does, as the error message indicates, not allow you to run it as root. Run it as a different user.


(Mark Walkom) #3

Also please don't post pictures of text, they are difficult to read and some people may not be even able to see them.


(Manoj) #4

Hi Thanks for suggestion. When I try to run as normal user I get below error.

$ cd elasticsearch-5.0.0/bin
$ ./elasticsearch
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms1024m
2016-10-28 03:55:04,765 main ERROR Unable to create file /etc/elasticsearch-5.0.0/logs/elasticsearch.log java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(Unknown Source)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:421)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:403)
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:73)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:81)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:103)
at org.apache.logging.log4j.core.appender.RollingFileAppender.createAppender(RollingFileAppender.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:132)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:918)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:858)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:850)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:479)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:219)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:231)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:249)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:116)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:83)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:249)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
at org.elasticsearch.cli.Command.main(Command.java:62)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73)

2016-10-28 03:55:04,771 main ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile. java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)


(Manoj) #5

Adding to this, earlier I used elasticsearch 2.4 and had no issue in installing it as root user. Now i face issue in installing as root/ other user.


(Christian Dahlqvist) #6

Looks like the non-root user may not have access to all the required directories.


(Manoj) #7

Hi, I manually created logs folder and re ran the ./elasticsearch. Now I get below error,

What can be the issue as its not allowing me to install as root/ any other user.

$ ./elasticsearch
Picked up _JAVA_OPTIONS: -Xmx2048m -Xms1024m
[2016-10-28T04:15:38,335][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.home' (/etc/elasticsearch-5.0.0/plugins)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:116) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:103) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:73) ~[elasticsearch-5.0.0.jar:5.0.0]
Caused by: java.lang.IllegalStateException: Unable to access 'path.home' (/etc/elasticsearch-5.0.0/plugins)
at org.elasticsearch.bootstrap.Security.addPath(Security.java:316) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:248) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:214) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:120) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:186) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112) ~[elasticsearch-5.0.0.jar:5.0.0]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /etc/elasticsearch-5.0.0/plugins
at sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[?:1.8.0_102]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:1.8.0_102]
at sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:1.8.0_102]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(Unknown Source) ~[?:1.8.0_102]
at java.nio.file.Files.createDirectory(Unknown Source) ~[?:1.8.0_102]
at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source) ~[?:1.8.0_102]
at java.nio.file.Files.createDirectories(Unknown Source) ~[?:1.8.0_102]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:358) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.addPath(Security.java:314) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:248) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:214) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:120) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:186) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:286) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:112) ~[elasticsearch-5.0.0.jar:5.0.0]
... 6 more


(system) #8