我正在使用 fabric8 kubernetes 插件进行 elasticsearch 2.1 集群发现。在启动过程中,我的 ES 由于以下错误而失败:
[2015-12-15 00:30:28,049][WARN ][io.fabric8.elasticsearch.discovery.kubernetes.KubernetesUnicastHostsProvider] [Freakmaster] Exception caught during discovery: access denied ("java.io.FilePermission" "/home/elasticsearch/.kube/config" "read")
java.security.AccessControlException: access denied ("java.io.FilePermission" "/home/elasticsearch/.kube/config" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at sun.nio.fs.UnixPath.checkRead(UnixPath.java:795)
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:49)
at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:144)
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
at java.nio.file.Files.readAttributes(Files.java:1737)
at java.nio.file.Files.isRegularFile(Files.java:2229)
at io.fabric8.kubernetes.client.Config.tryKubeConfig(Config.java:236)
at io.fabric8.kubernetes.client.Config.<init>(Config.java:106)
at io.fabric8.kubernetes.client.ConfigBuilder.<init>(ConfigBuilder.java:17)
at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:37)
at io.fabric8.kubernetes.client.DefaultKubernetesClient.<init>(DefaultKubernetesClient.java:82)
at io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIServiceImpl.client(KubernetesAPIServiceImpl.java:49)
at io.fabric8.elasticsearch.cloud.kubernetes.KubernetesAPIServiceImpl.endpoints(KubernetesAPIServiceImpl.java:35)
at io.fabric8.elasticsearch.discovery.kubernetes.KubernetesUnicastHostsProvider.buildDynamicNodes(KubernetesUnicastHostsProvider.java:99)
at org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing.sendPings(UnicastZenPing.java:335)
at org.elasticsearch.discovery.zen.ping.unicast.UnicastZenPing$2$1.doRun(UnicastZenPing.java:253)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
如您所见,由于某种原因,配置假定 /home/elasticsearch 作为安装位置。我的 ES 实际上是在 /opt/elasticsearch 设置的。我什至通过了 path.home 配置参数并设置了 HOME env var。但错误仍然存在。
非常感谢任何帮助/建议。