需求
设置ElasticSearch的用户名和密码,禁止非法用户访问。
程序版本
elasticsearch-6.5.1
kibana-6.5.1-linux-x86_64
流程
1. 无验证模式下启动es
2. 生成license
curl -H “Content-Type:application/json” -XPOST http://${ip}:9200/_xpack/license/start_trial?acknowledge=true
3. 修改elasticsearch.yml配置文件
xpack.security.enabled: true
http.cors.enabled: true
http.cors.allow-origin: “*”
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
4. 重启ES
5. 设置初始密码
执行./elasticsearch-setup-passwords auto,出现以下内容:
Your cluster health is currently RED.
This means that some cluster data is unavailable and your cluster is not fully functional.
It is recommended that you resolve the issues with y

本文档详细介绍了如何在Elasticsearch 6.5.1版本中设置用户名和密码,以保护集群免受非法访问。首先在无验证模式下启动ES,然后生成license,接着启用安全配置并重启服务。通过`elasticsearch-setup-passwords`命令随机生成并设置默认用户的密码,包括elastic用户。之后,使用curl命令修改elastic用户密码,并在Kibana的配置文件中添加用户名和密码。最后,验证登录Kibana时,使用新设置的凭证能成功访问。
最低0.47元/天 解锁文章
951

被折叠的 条评论
为什么被折叠?



