Elasticsearch无法启动 - 权限问题

时间:2016-12-09 10:10:30

标签: java linux elasticsearch

我在装有CentOS 6的新机器上安装了elasticsearch-5.0。安装后没有安装。以下是我得到的错误 -

以下所有命令均以root身份发布

使用rpm文件使用以下命令执行安装

$# yum install elasticsearch-5.0.0.rpm

添加elasticsearch以在每次启动后启动

$# chkconfig --add elasticsearch

将elasticsearch作为服务启动

$# service elasticsearch start

从控制台输出

Starting elasticsearch: 2016-12-09 01:52:44,385 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch.log java.io.IOException: Permission denied
        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-12-09 01:52:44,390 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)
        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)
Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5ccddd20] unable to create manager for [/var/log/elasticsearch/elasticsearch.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@1ed1993a[pattern=/var/log/elasticsearch/elasticsearch-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n]]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
        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)
        ... 23 more

2016-12-09 01:52:44,402 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch_deprecation.log java.io.IOException: Permission denied
        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-12-09 01:52:44,403 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)
        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)
Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5ccddd20] unable to create manager for [/var/log/elasticsearch/elasticsearch_deprecation.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@4690b489[pattern=/var/log/elasticsearch/elasticsearch_deprecation-%i.log.gz, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[SizeBasedTriggeringPolicy(size=1073741824)]), strategy=DefaultRolloverStrategy(min=1, max=4), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n]]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
        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)
        ... 23 more

2016-12-09 01:52:44,408 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch_index_search_slowlog.log java.io.IOException: Permission denied
        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-12-09 01:52:44,409 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)
        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)
Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5ccddd20] unable to create manager for [/var/log/elasticsearch/elasticsearch_index_search_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@3c22fc4c[pattern=/var/log/elasticsearch/elasticsearch_index_search_slowlog-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n]]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
        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)
        ... 23 more

2016-12-09 01:52:44,414 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch_index_indexing_slowlog.log java.io.IOException: Permission denied
        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-12-09 01:52:44,415 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)
        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)
Caused by: java.lang.IllegalStateException: ManagerFactory [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory@5ccddd20] unable to create manager for [/var/log/elasticsearch/elasticsearch_index_indexing_slowlog.log] with data [org.apache.logging.log4j.core.appender.rolling.RollingFileManager$FactoryData@3aefe5e5[pattern=/var/log/elasticsearch/elasticsearch_index_indexing_slowlog-%d{yyyy-MM-dd}.log, append=true, bufferedIO=true, bufferSize=8192, policy=CompositeTriggeringPolicy(policies=[TimeBasedTriggeringPolicy(nextRolloverMillis=0, interval=1, modulate=true)]), strategy=DefaultRolloverStrategy(min=1, max=7), advertiseURI=null, layout=[%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n]]
        at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:75)
        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)
        ... 23 more

2016-12-09 01:52:44,880 main ERROR Null object returned for RollingFile in Appenders.
2016-12-09 01:52:44,880 main ERROR Null object returned for RollingFile in Appenders.
2016-12-09 01:52:44,880 main ERROR Null object returned for RollingFile in Appenders.
2016-12-09 01:52:44,881 main ERROR Null object returned for RollingFile in Appenders.
2016-12-09 01:52:44,881 main ERROR Unable to locate appender "rolling" for logger config "root"
2016-12-09 01:52:44,881 main ERROR Unable to locate appender "index_indexing_slowlog_rolling" for logger config "index.indexing.slowlog.index"
2016-12-09 01:52:44,882 main ERROR Unable to locate appender "index_search_slowlog_rolling" for logger config "index.search.slowlog"
2016-12-09 01:52:44,882 main ERROR Unable to locate appender "deprecation_rolling" for logger config "org.elasticsearch.deprecation"
                                                           [FAILED]

以下是为/ var / log / elasticsearch目录设置的权限

 drwxr-xr-x  2 elasticsearch elasticsearch    4096 Dec 09 10:40 elasticsearch

/ var / log / elasticsearch归elasticsearch所有:elasticsearch及其权限为755.感谢您解决此问题的建议或解答。

3 个答案:

答案 0 :(得分:1)

正如日志所示,似乎ElasticSearch没有对目录的写权限。

验证运行ElasticSearch的用户是否有权写入该文件夹/目录?

答案 1 :(得分:0)

您检查path.data权限,似乎您必须将其更改为777.

答案 2 :(得分:0)

使用以下选项键更新/etc/sysconfig/docker-

--selinux-enabled=false