根据https://blog.csdn/fen_fen/article/details/123265132 来配置“内置用户,使用用户名密码访问”

因配置:xpack.security.transport.ssl.enabled: true 后,重启es时报错:

出现问题:

Caused by: javax.ssl.SSLHandshakeException: No available authentication scheme

解决办法:

参考:
https://www.elastic.co/guide/en/elasticsearch/reference/6.3/configuring-tls.html#node-certificates

总体意思是TCP通信,使用ssl加密通信。

第1步:在ES的根目录生成CA证书

bin/elasticsearch-certutil ca

Please enter the desired output file [elastic-stack-ca.p12]:              
Enter password for elastic-stack-ca.p12 : 

1、提示输出文件,默认即可

2、提示输入密码,不输入直接回车

第2步:使用第一步生成的证书,产生p12密钥

bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12

Enter password for CA (elastic-stack-ca.p12) 

输入上面定义的密码:

Please enter the desired output file [elastic-certificates.p12]:

输入文件,默认即可

Enter password for elastic-certificates.p12 :

不输入,直接回车

查看生成文件

第3步:两步操作: 

1、将这两个文件拷贝到config/certs目录,没有则新创建

2、配置elasticsearch.yml

xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: certs/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: certs/elastic-certificates.p12

 

第4步:重启ES

更多推荐

ES7.14,遇到No available authentication scheme的解决办法