我正在使用弹性操作符启动3个弹性节点,我试图为这些实例设置自动快照。
我遵循这个文档
我缩小了服务帐户密钥的json,创建了一个名为gcs.client.default.credentials_file的文件,没有文件扩展名,并将该文件添加到kubernetes secrets中。
并增加了secureSettings。将secret name字段添加到弹性集群的规格中,并将secret name添加到其中,即gcs-credentials
但是我在日志上得到这个错误
{"@timestamp":"2022-12-26T18:45:40.037Z", "log.level":"ERROR", "message":"fatal exception while booting Elasticsearch", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"main","log.logger":"org.elasticsearch.bootstrap.Elasticsearch","elasticsearch.node.name":"elasticsearch-cluster-es-node-1","elasticsearch.cluster.name":"elasticsearch-cluster","error.type":"java.lang.IllegalStateException","error.message":"failed to load plugin class [org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin]","error.stack_trace":"java.lang.IllegalStateException: failed to load plugin class [org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin]ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:607)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.loadBundle(PluginsService.java:482)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.loadBundles(PluginsService.java:290)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:159)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.lambda$getPluginsServiceCtor$14(PluginsService.java:634)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.node.Node.<init>(Node.java:406)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.node.Node.<init>(Node.java:316)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.bootstrap.Elasticsearch$2.<init>(Elasticsearch.java:214)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.bootstrap.Elasticsearch.initPhase3(Elasticsearch.java:214)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:67)nCaused by: java.lang.reflect.InvocationTargetExceptionntat java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:79)ntat java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)ntat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:484)ntat org.elasticsearch.server@8.5.0/org.elasticsearch.plugins.PluginsService.loadPlugin(PluginsService.java:600)nt... 9 morenCaused by: java.lang.IllegalArgumentException: failed to load GCS client credentials from [gcs.client.default.credentials_file]ntat org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.loadCredential(GoogleCloudStorageClientSettings.java:265)ntat org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.getClientSettings(GoogleCloudStorageClientSettings.java:221)ntat org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.load(GoogleCloudStorageClientSettings.java:209)ntat org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin.reload(GoogleCloudStoragePlugin.java:88)ntat org.elasticsearch.repositories.gcs.GoogleCloudStoragePlugin.<init>(GoogleCloudStoragePlugin.java:36)ntat java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)nt... 12 morenCaused by: java.io.IOException: Invalid PKCS#8 data.ntat com.google.auth.oauth2.ServiceAccountCredentials.privateKeyFromPkcs8(ServiceAccountCredentials.java:496)ntat com.google.auth.oauth2.ServiceAccountCredentials.fromPkcs8(ServiceAccountCredentials.java:474)ntat com.google.auth.oauth2.ServiceAccountCredentials.fromJson(ServiceAccountCredentials.java:212)ntat com.google.auth.oauth2.ServiceAccountCredentials.fromStream(ServiceAccountCredentials.java:548)ntat com.google.auth.oauth2.ServiceAccountCredentials.fromStream(ServiceAccountCredentials.java:520)ntat org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.lambda$loadCredential$13(GoogleCloudStorageClientSettings.java:257)ntat java.base/java.security.AccessController.doPrivileged(AccessController.java:569)ntat org.elasticsearch.repositories.gcs.SocketAccess.doPrivilegedIOException(SocketAccess.java:33)ntat org.elasticsearch.repositories.gcs.GoogleCloudStorageClientSettings.loadCredential(GoogleCloudStorageClientSettings.java:256)nt... 17 moren"}
ERROR: Elasticsearch did not exit normally - check the logs at /usr/share/elasticsearch/logs/elasticsearch-cluster.log
尝试将以下几行添加到您的配置中(在每个Elasticsearch上):
elasticsearch01:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
...
ulimits:
memlock:
soft: -1
hard: -1
也可以在Elasticsearch上查看此链接以获取更详细的信息。