2017-01-31 45 views
1

Win10主機上的Centos VM guest虛擬機。試圖按照installation guide進行x-pack(並從training course開始逐步執​​行)。 ES和K運行良好,但是一旦安裝了x-pack插件,kibana將啓動(並且抱怨ES丟失 - 這很好),然後彈性搜索開始並立即失敗。它看起來像3一樣的錯誤,但在本地虛擬機中,而不是生產設置。這裏的日誌尾部:安裝x-pack會停止運行彈性搜索

[2017-01-31T16:52:03,191][ERROR][o.e.b.Bootstrap   ] Exception 
org.elasticsearch.ElasticsearchException: Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:384) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:336) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:132) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:294) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:229) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.Command.main(Command.java:62) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) [elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) [elasticsearch-5.1.1.jar:5.1.1] 
Caused by: java.lang.reflect.InvocationTargetException 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:373) ~[elasticsearch-5.1.1.jar:5.1.1] 
     ... 14 more 
Caused by: java.nio.file.AccessDeniedException: /etc/elasticsearch/x-pack/system_key 
     at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] 
     at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] 
     at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] 
     at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:?] 
     at java.nio.file.Files.newByteChannel(Files.java:361) ~[?:1.8.0_111] 
     at java.nio.file.Files.newByteChannel(Files.java:407) ~[?:1.8.0_111] 
     at java.nio.file.Files.readAllBytes(Files.java:3152) ~[?:1.8.0_111] 
     at org.elasticsearch.xpack.security.crypto.CryptoService.readSystemKey(CryptoService.java:160) ~[?:?] 
     at org.elasticsearch.xpack.security.crypto.CryptoService.<init>(CryptoService.java:112) ~[?:?] 
     at org.elasticsearch.xpack.security.Security.<init>(Security.java:191) ~[?:?] 
     at org.elasticsearch.xpack.XPackPlugin.<init>(XPackPlugin.java:193) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:373) ~[elasticsearch-5.1.1.jar:5.1.1] 
     ... 14 more 
[2017-01-31T16:52:03,215][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [elkmaster1] uncaught exception in thread [main] 
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]]; nested: InvocationTargetException; nested: AccessDeniedException[/etc/elasticsearch/x-pack/system_key]; 
     at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.cli.Command.main(Command.java:62) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.1.1.jar:5.1.1] 
Caused by: org.elasticsearch.ElasticsearchException: Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:384) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:336) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:132) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:294) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:229) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.1.jar:5.1.1] 
     ... 6 more 
Caused by: java.lang.reflect.InvocationTargetException 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:373) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:336) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:132) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:294) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:229) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.1.jar:5.1.1] 
     ... 6 more 
Caused by: java.nio.file.AccessDeniedException: /etc/elasticsearch/x-pack/system_key 
     at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?] 
     at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?] 
     at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?] 
     at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) ~[?:?] 
     at java.nio.file.Files.newByteChannel(Files.java:361) ~[?:1.8.0_111] 
     at java.nio.file.Files.newByteChannel(Files.java:407) ~[?:1.8.0_111] 
     at java.nio.file.Files.readAllBytes(Files.java:3152) ~[?:1.8.0_111] 
     at org.elasticsearch.xpack.security.crypto.CryptoService.readSystemKey(CryptoService.java:160) ~[?:?] 
     at org.elasticsearch.xpack.security.crypto.CryptoService.<init>(CryptoService.java:112) ~[?:?] 
     at org.elasticsearch.xpack.security.Security.<init>(Security.java:191) ~[?:?] 
     at org.elasticsearch.xpack.XPackPlugin.<init>(XPackPlugin.java:193) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] 
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:?] 
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] 
     at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_111] 
     at org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:373) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:336) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:132) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:294) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.node.Node.<init>(Node.java:229) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap$6.<init>(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.1.jar:5.1.1] 
     at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.1.jar:5.1.1] 
    ... 6 more 

回答

0

好因爲日誌包含

Caused by: java.nio.file.AccessDeniedException: 

問題可能是用戶權限。這個目錄的所有者是誰?

/etc/elasticsearch/x-pack 

ls -l /etc/elasticsearch/x-pack給你什麼輸出?

如果您具有sudo權限或具有root用戶訪問權限,則可以更改此目錄的所有權。

+0

謝謝!這是肯定的一步。 system_key文件是:-rw -------。 1 root root 128 Dec 9 16:29 system_key' so chmod 604 on the file to get read rights for elastic,and the service was able to start。默認的用戶帳戶尚未登錄,但生病進一步審查正確的權限。這當然有助於解決主要問題 –

+0

由於這是一個關鍵,最好使用'sudo chown elastic:elastic system.key'將所有權更改爲彈性。大多數安全程序檢查權限集。我會建議不要給別人一個閱讀權限。這應該適合你。 HTH – cinhtau

+0

瞭解,並會驗證。 chmod是爲了證明問題所在......然而,現在有了'太多的本地重定向',因此可能需要更改我的平臺以允許更多節點進行故障排除。 –

1

嘗試一下:

  1. 打開配置/ elasticsearch.yml文件
  2. 變化xpack配置行

xpack.security.enabled: false xpack.graph.enabled: false xpack.watcher.enabled: false

0

問題在於您用來安裝elasitcsearch和x-pack的用戶帳戶。確保您使用相同的帳戶並擁有正確的權限來執行此操作!

您可能想要使用chown授予訪問權限。