linux启动es时突然报错HTTPS is required in order to use the API key service

  • A+
所属分类:系统文档

es的xpack错误

linux启动es时突然报错HTTPS is required in order to use the API key service:

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch. bootstrap check failure [1] of [1]: HTTPS is required in order to use the API key service; please enable HTTPS using the [xpack.security.http.ssl.enabled] setting or disable the API key service using the [xpack.security.authc.api_key.enabled] setting ERROR: Elasticsearch did not exit normally - check the logs at /test/elasticsearch-7.14.0/logs/elasticsearch.log 2021-09-07T17:35:00,423[o.e.n.Node ] [192.168.135.123] stopping ... 2021-09-07T17:35:00,442[o.e.n.Node ] [192.168.135.123] stopped 2021-09-07T17:35:00,442[o.e.n.Node ] [192.168.135.123] closing ... 2021-09-07T17:35:00,463[o.e.n.Node ] [192.168.135.123] closed

意思是使用API密匙服务需要HTTPS,需要使用他说的方法启动HTTPS

我的配置如下:

配置在config的elasticsearch.yml文件里面

按照提示说的方法后

重新启动es会报以下错误

2021-09-07T17:45:20,225[o.e.b.ElasticsearchUncaughtExceptionHandler] [192.168.135.123] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: a key must be provided to run as a server. the key should be configured using the [xpack.security.http.ssl.key] or [xpack.security.http.ssl.keystore.path] setting 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]

意思是需要配置密匙或者配置路径

然后报出了密匙错误的错误

2021-09-07T17:54:56,281[o.e.b.ElasticsearchUncaughtExceptionHandler] [192.168.135.123] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: ElasticsearchSecurityException[failed to load SSL configuration [xpack.security.http.ssl]]; nested: ElasticsearchException[failed to create trust manager]; nested: ElasticsearchException[failed to initialize SSL TrustManager]; nested: IOException[keystore password was incorrect]; nested: UnrecoverableKeyException[failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.];

最后的解决方式

删除这一条配置

这个是开启API服务的,不清楚为什么打开就会报那种错误

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin