无法在Elasticsearch 6.x中运行set-password(密钥库密码不正确)

问题描述 投票:1回答:1

我正在建立一个6.1.2 Windows群集并拥有黄金许可证。这是集群中的第一台计算机,因此我使用密码生成了CA证书并将其放在ES_HOME配置目录中。

elasticsearch.yml文件中的相关键:

xpack.ssl.keystore.path:elastic-stack-test-ca.p12

xpack.ssl.truststore.path:elastic-stack-test-ca.p12

xpack.security.transport.ssl.enabled:true

xpack.security.transport.ssl.verification_mode:证书

xpack.security.http.ssl.enabled:true

我已经浏览了文档,目前正在尝试完成Elasticsearch安装的step 7

不幸的是,这个命令“Elasticsearch \ _6.1.2 \ bin \ x-pack \ setup-passwords auto”正在抛出异常。

例外:

Exception in thread "main" ElasticsearchException[failed to initialize a TrustManagerFactory]; nested: IOException[keystore password was incorrect]; nested: UnrecoverableKeyException[failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded];
at org.elasticsearch.xpack.ssl.StoreTrustConfig.createTrustManager(StoreTrustConfig.java:61)
at org.elasticsearch.xpack.ssl.SSLService.createSslContext(SSLService.java:408)
at org.elasticsearch.xpack.ssl.SSLService.loadSSLConfigurations(SSLService.java:444)
at org.elasticsearch.xpack.ssl.SSLService.(SSLService.java:87)
at org.elasticsearch.xpack.security.authc.esnative.tool.CommandLineHttpClient.postURL(CommandLineHttpClient.java:91)
at org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool$SetupCommand.checkElasticKeystorePasswordValid(SetupPasswordTool.java:278)
at org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool$AutoSetup.execute(SetupPasswordTool.java:127)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:75)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.xpack.security.authc.esnative.tool.SetupPasswordTool.main(SetupPasswordTool.java:105)
Caused by: java.io.IOException: keystore password was incorrect
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:2059)
at java.security.KeyStore.load(KeyStore.java:1445)
at org.elasticsearch.xpack.ssl.CertUtils.readKeyStore(CertUtils.java:230)
at org.elasticsearch.xpack.ssl.CertUtils.trustManager(CertUtils.java:221)
at org.elasticsearch.xpack.ssl.StoreTrustConfig.createTrustManager(StoreTrustConfig.java:59)

我没有在Set Passwords命令中看到您传递密钥库密码的任何地方。

希望有人可以对我可能做错的事情或我接下来的步骤有所了解。此错误阻止我安装Kibana和Logstash。

谢谢你,斯蒂芬

elasticsearch elasticsearch-x-pack
1个回答
0
投票

经过深入研究后发现,我的JAVA HOME指向9.x版本,一旦我将HOME更改为兼容版本,8在这种情况下,所有内容都按照文档记录。

© www.soinside.com 2019 - 2024. All rights reserved.