elasticsearch helm 图表(来自 elastic 或 bitnami)不适用于 k3s
elasticsearch helm charts (from elastic or bitnami) don't work with k3s
大家好
一周以来,我一直在尝试在最新的 k3s v1.21.3+k3s1 上旋转弹性集群,但没有成功。 bitnami/elasticsearch 和 elastic elastic/elasticsearch 都不起作用,尽管有不同的错误。
问题是我已经尝试在绝对干净的 VM 上在 k3s 中旋转弹性集群:
- Ubuntu 20.04
- Ubuntu 21.04
- Debian 10.10
- 从 1 个内核 cpu、4Gb RAM 和 30Gb 存储到 4 cpu、16Gb 和 60Gb 存储(起初我以为我可能是需求问题)
- 从 1 个节点到具有 3 个节点的完整 k3s 集群
同时,我第一次在 minikube 中尝试这两个图表时,它们的跨度就像一个魅力。所有配置始终默认。请帮助,我失去了希望...
这是 bitnami/elasticsearch 图表中主 pod 的错误日志:
[38;5;6melasticsearch [38;5;5m15:02:56.59 [0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0m[1mWelcome to the Bitnami elasticsearch container[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-elasticsearch[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-elasticsearch/issues[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0m
[38;5;6melasticsearch [38;5;5m15:02:56.61 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch setup **
[38;5;6melasticsearch [38;5;5m15:02:56.65 [0m[38;5;2mINFO [0m ==> Configuring/Initializing Elasticsearch...
ls: cannot open directory '/bitnami/elasticsearch/data': Permission denied
[38;5;6melasticsearch [38;5;5m15:02:56.72 [0m[38;5;2mINFO [0m ==> Setting default configuration
[38;5;6melasticsearch [38;5;5m15:02:56.76 [0m[38;5;2mINFO [0m ==> Configuring Elasticsearch cluster settings...
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[38;5;6melasticsearch [38;5;5m15:03:10.86 [0m[38;5;2mINFO [0m ==> ** Elasticsearch setup finished! **
[38;5;6melasticsearch [38;5;5m15:03:10.91 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch **
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2021-08-26T15:03:20,716][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [elasticsearch-1629989764-master-0] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.14.0.jar:7.14.0]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /bitnami/elasticsearch/data
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313) ~[?:?]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]
... 6 more
uncaught exception in thread [main]
java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
Likely root cause: java.nio.file.AccessDeniedException: /bitnami/elasticsearch/data
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155)
at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
at org.elasticsearch.cli.Command.main(Command.java:79)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at /opt/bitnami/elasticsearch/logs/elastic.log
这是 elastic/elasticsearch 图表中主 pod 的错误日志:
{"type": "server", "timestamp": "2021-08-26T14:42:43,598Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-2", "message": "uncaught exception in thread [main]",
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.14.0.jar:7.14.0]",
"Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)",
"at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]",
"... 6 more",
"Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data",
"at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]",
"at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313) ~[?:?]",
"at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]",
"... 6 more"] }
uncaught exception in thread [main]
java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155)
at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
at org.elasticsearch.cli.Command.main(Command.java:79)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at /usr/share/elasticsearch/logs/elasticsearch.log
bitnami/elasticsearch 图表中主 pod 的错误日志,volumePermissions.enabled 设置为 true
[38;5;6melasticsearch [38;5;5m09:29:07.85 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch **
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:15,892Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[transport.tcp.port] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
[2021-08-27T09:29:16,900][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] version[7.14.0], pid[1], build[default/tar/dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1/2021-07-29T20:49:32.864135063Z], OS[Linux/5.11.0-31-generic/amd64], JVM[BellSoft/OpenJDK 64-Bit Server VM/11.0.12/11.0.12+7-LTS]
[2021-08-27T09:29:16,900][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] JVM home [/opt/bitnami/java], using bundled JDK [false]
[2021-08-27T09:29:16,903][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=ALL-UNNAMED, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-11225315085643140958, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Xms128m, -Xmx128m, -XX:MaxDirectMemorySize=67108864, -Des.path.home=/opt/bitnami/elasticsearch, -Des.path.conf=/opt/bitnami/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,359Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[gateway.recover_after_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,369Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[discovery.zen.minimum_master_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,371Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[gateway.expected_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
[2021-08-27T09:29:38,041][INFO ][o.e.x.s.a.s.FileRolesStore] [elasticsearch-1630056078-master-0] parsed [0] roles from file [/opt/bitnami/elasticsearch/config/roles.yml]
[2021-08-27T09:29:39,856][INFO ][o.e.i.g.DatabaseRegistry ] [elasticsearch-1630056078-master-0] initialized database registry, using geoip-databases directory [/tmp/elasticsearch-11225315085643140958/geoip-databases/T5RcvZGLRleO990MCvjsPA]
[2021-08-27T09:29:42,077][INFO ][o.e.t.NettyAllocator ] [elasticsearch-1630056078-master-0] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=false, g1gc_region_size=0b, heap_size=123.7mb}]
[2021-08-27T09:29:42,373][INFO ][o.e.d.DiscoveryModule ] [elasticsearch-1630056078-master-0] using discovery type [zen] and seed hosts providers [settings]
[2021-08-27T09:29:43,423][INFO ][o.e.g.DanglingIndicesState] [elasticsearch-1630056078-master-0] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2021-08-27T09:29:44,313][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] initialized
[2021-08-27T09:29:44,319][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] starting ...
[2021-08-27T09:29:45,354][INFO ][o.e.b.BootstrapChecks ] [elasticsearch-1630056078-master-0] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2021-08-27T09:29:50,393][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:29:50,394][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:29:50,394][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:30:05,390][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:05,435][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] failed to resolve host [elasticsearch-1630056078-master.default.svc.cluster.local]
java.net.UnknownHostException: elasticsearch-1630056078-master.default.svc.cluster.local
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) ~[?:?]
at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:883) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1509) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1368) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1302) ~[?:?]
at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:563) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:505) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:967) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists[=12=](SeedHostsResolver.java:133) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
[2021-08-27T09:30:15,395][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:20,552][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:30:20,552][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:30:20,553][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:30:25,398][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:35,403][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:35,580][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] failed to resolve host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
java.net.UnknownHostException: elasticsearch-1630056078-coordinating-only.default.svc.cluster.local
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1509) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1368) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1302) ~[?:?]
at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:563) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:505) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:967) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists[=12=](SeedHostsResolver.java:133) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
[2021-08-27T09:30:55,417][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:31:04,380][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] stopping ...
虽然“更改k3s版本”本身并不能解决问题,但这个问题似乎与特定的v1.21.3+k3s1
版本有关。我已经在这些上尝试了 bitnami/elasticsearch
图表的默认安装:
v1.18.20-k3s1: OK
v1.19.14-k3s1: OK
v1.20.10+k3s1: OK
v1.21.3-k3s1: KO
v1.21.4-k3s1: OK
v1.22.1-rc1-k3s1: OK
我的猜测是它与这个问题有关:[Backport 1.21] Cannot write data to local PVC
大家好
一周以来,我一直在尝试在最新的 k3s v1.21.3+k3s1 上旋转弹性集群,但没有成功。 bitnami/elasticsearch 和 elastic elastic/elasticsearch 都不起作用,尽管有不同的错误。
问题是我已经尝试在绝对干净的 VM 上在 k3s 中旋转弹性集群:
- Ubuntu 20.04
- Ubuntu 21.04
- Debian 10.10
- 从 1 个内核 cpu、4Gb RAM 和 30Gb 存储到 4 cpu、16Gb 和 60Gb 存储(起初我以为我可能是需求问题)
- 从 1 个节点到具有 3 个节点的完整 k3s 集群
同时,我第一次在 minikube 中尝试这两个图表时,它们的跨度就像一个魅力。所有配置始终默认。请帮助,我失去了希望...
这是 bitnami/elasticsearch 图表中主 pod 的错误日志:
[38;5;6melasticsearch [38;5;5m15:02:56.59 [0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0m[1mWelcome to the Bitnami elasticsearch container[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-elasticsearch[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-elasticsearch/issues[0m
[38;5;6melasticsearch [38;5;5m15:02:56.60 [0m
[38;5;6melasticsearch [38;5;5m15:02:56.61 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch setup **
[38;5;6melasticsearch [38;5;5m15:02:56.65 [0m[38;5;2mINFO [0m ==> Configuring/Initializing Elasticsearch...
ls: cannot open directory '/bitnami/elasticsearch/data': Permission denied
[38;5;6melasticsearch [38;5;5m15:02:56.72 [0m[38;5;2mINFO [0m ==> Setting default configuration
[38;5;6melasticsearch [38;5;5m15:02:56.76 [0m[38;5;2mINFO [0m ==> Configuring Elasticsearch cluster settings...
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[38;5;6melasticsearch [38;5;5m15:03:10.86 [0m[38;5;2mINFO [0m ==> ** Elasticsearch setup finished! **
[38;5;6melasticsearch [38;5;5m15:03:10.91 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch **
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2021-08-26T15:03:20,716][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [elasticsearch-1629989764-master-0] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.14.0.jar:7.14.0]
at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.14.0.jar:7.14.0]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /bitnami/elasticsearch/data
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313) ~[?:?]
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]
... 6 more
uncaught exception in thread [main]
java.lang.IllegalStateException: Unable to access 'path.data' (/bitnami/elasticsearch/data)
Likely root cause: java.nio.file.AccessDeniedException: /bitnami/elasticsearch/data
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
at java.base/sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155)
at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
at org.elasticsearch.cli.Command.main(Command.java:79)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at /opt/bitnami/elasticsearch/logs/elastic.log
这是 elastic/elasticsearch 图表中主 pod 的错误日志:
{"type": "server", "timestamp": "2021-08-26T14:42:43,598Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-2", "message": "uncaught exception in thread [main]",
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116) ~[elasticsearch-cli-7.14.0.jar:7.14.0]",
"at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.14.0.jar:7.14.0]",
"Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)",
"at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]",
"... 6 more",
"Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data",
"at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]",
"at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313) ~[?:?]",
"at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.14.0.jar:7.14.0]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-7.14.0.jar:7.14.0]",
"... 6 more"] }
uncaught exception in thread [main]
java.lang.IllegalStateException: Unable to access 'path.data' (/usr/share/elasticsearch/data)
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:313)
at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296)
at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59)
at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208)
at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155)
at org.elasticsearch.bootstrap.Security.configure(Security.java:105)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
at org.elasticsearch.cli.Command.main(Command.java:79)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
For complete error details, refer to the log at /usr/share/elasticsearch/logs/elasticsearch.log
bitnami/elasticsearch 图表中主 pod 的错误日志,volumePermissions.enabled 设置为 true
[38;5;6melasticsearch [38;5;5m09:29:07.85 [0m[38;5;2mINFO [0m ==> ** Starting Elasticsearch **
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:15,892Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[transport.tcp.port] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
[2021-08-27T09:29:16,900][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] version[7.14.0], pid[1], build[default/tar/dd5a0a2acaa2045ff9624f3729fc8a6f40835aa1/2021-07-29T20:49:32.864135063Z], OS[Linux/5.11.0-31-generic/amd64], JVM[BellSoft/OpenJDK 64-Bit Server VM/11.0.12/11.0.12+7-LTS]
[2021-08-27T09:29:16,900][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] JVM home [/opt/bitnami/java], using bundled JDK [false]
[2021-08-27T09:29:16,903][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=ALL-UNNAMED, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.io.tmpdir=/tmp/elasticsearch-11225315085643140958, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Xms128m, -Xmx128m, -XX:MaxDirectMemorySize=67108864, -Des.path.home=/opt/bitnami/elasticsearch, -Des.path.conf=/opt/bitnami/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,359Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[gateway.recover_after_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,369Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[discovery.zen.minimum_master_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
{"type": "deprecation.elasticsearch", "timestamp": "2021-08-27T09:29:32,371Z", "level": "DEPRECATION", "component": "o.e.d.c.s.Settings", "cluster.name": "elastic", "node.name": "elasticsearch-1630056078-master-0", "message": "[gateway.expected_nodes] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." }
[2021-08-27T09:29:38,041][INFO ][o.e.x.s.a.s.FileRolesStore] [elasticsearch-1630056078-master-0] parsed [0] roles from file [/opt/bitnami/elasticsearch/config/roles.yml]
[2021-08-27T09:29:39,856][INFO ][o.e.i.g.DatabaseRegistry ] [elasticsearch-1630056078-master-0] initialized database registry, using geoip-databases directory [/tmp/elasticsearch-11225315085643140958/geoip-databases/T5RcvZGLRleO990MCvjsPA]
[2021-08-27T09:29:42,077][INFO ][o.e.t.NettyAllocator ] [elasticsearch-1630056078-master-0] creating NettyAllocator with the following configs: [name=unpooled, suggested_max_allocation_size=1mb, factors={es.unsafe.use_unpooled_allocator=null, g1gc_enabled=false, g1gc_region_size=0b, heap_size=123.7mb}]
[2021-08-27T09:29:42,373][INFO ][o.e.d.DiscoveryModule ] [elasticsearch-1630056078-master-0] using discovery type [zen] and seed hosts providers [settings]
[2021-08-27T09:29:43,423][INFO ][o.e.g.DanglingIndicesState] [elasticsearch-1630056078-master-0] gateway.auto_import_dangling_indices is disabled, dangling indices will not be automatically detected or imported and must be managed manually
[2021-08-27T09:29:44,313][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] initialized
[2021-08-27T09:29:44,319][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] starting ...
[2021-08-27T09:29:45,354][INFO ][o.e.b.BootstrapChecks ] [elasticsearch-1630056078-master-0] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2021-08-27T09:29:50,393][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:29:50,394][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:29:50,394][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5054ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:30:05,390][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:05,435][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] failed to resolve host [elasticsearch-1630056078-master.default.svc.cluster.local]
java.net.UnknownHostException: elasticsearch-1630056078-master.default.svc.cluster.local
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) ~[?:?]
at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:883) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1509) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1368) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1302) ~[?:?]
at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:563) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:505) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:967) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists[=12=](SeedHostsResolver.java:133) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
[2021-08-27T09:30:15,395][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:20,552][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:30:20,552][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:30:20,553][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5s/5091ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:30:25,398][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:35,403][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:35,580][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] failed to resolve host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
java.net.UnknownHostException: elasticsearch-1630056078-coordinating-only.default.svc.cluster.local
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:797) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1509) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1368) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1302) ~[?:?]
at org.elasticsearch.transport.TcpTransport.parse(TcpTransport.java:563) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TcpTransport.addressesFromString(TcpTransport.java:505) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.transport.TransportService.addressesFromString(TransportService.java:967) ~[elasticsearch-7.14.0.jar:7.14.0]
at org.elasticsearch.discovery.SeedHostsResolver.lambda$resolveHostsLists[=12=](SeedHostsResolver.java:133) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) ~[elasticsearch-7.14.0.jar:7.14.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:829) [?:?]
[2021-08-27T09:30:55,417][WARN ][o.e.c.c.ClusterFormationFailureHelper] [elasticsearch-1630056078-master-0] master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [elasticsearch-1630056078-master-0, elasticsearch-1630056078-master-1, elasticsearch-1630056078-master-2] to bootstrap a cluster: have discovered [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}]; discovery will continue using [] from hosts providers and [{elasticsearch-1630056078-master-0}{T5RcvZGLRleO990MCvjsPA}{eoQgmlhCQzK29BLWrUGe_Q}{10.42.1.54}{10.42.1.54:9300}{mr}] from last-known cluster state; node term 0, last-accepted version 0 in term 0
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:30:55,634][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [4.8s/4857ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-master.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-coordinating-only.default.svc.cluster.local]
[2021-08-27T09:31:00,654][WARN ][o.e.d.SeedHostsResolver ] [elasticsearch-1630056078-master-0] timed out after [5.1s/5116ms] ([discovery.seed_resolver.timeout]=[5s]) resolving host [elasticsearch-1630056078-data.default.svc.cluster.local]
[2021-08-27T09:31:04,380][INFO ][o.e.n.Node ] [elasticsearch-1630056078-master-0] stopping ...
虽然“更改k3s版本”本身并不能解决问题,但这个问题似乎与特定的v1.21.3+k3s1
版本有关。我已经在这些上尝试了 bitnami/elasticsearch
图表的默认安装:
v1.18.20-k3s1: OK
v1.19.14-k3s1: OK
v1.20.10+k3s1: OK
v1.21.3-k3s1: KO
v1.21.4-k3s1: OK
v1.22.1-rc1-k3s1: OK
我的猜测是它与这个问题有关:[Backport 1.21] Cannot write data to local PVC