当前位置:   article > 正文

[Elasticsearch] 给ES设置必须以用户名密码访问_es 设置密码

es 设置密码

一、elasticsearch.yml中设置

1、进入es的config目录中打开elasticsearch.yml

2、增加以下两项:

  1. xpack.security.enabled: true
  2. xpack.security.transport.ssl.enabled: true

二、重启es后使用elasticsearch-setup-passwords进行密码设置

1、在完成修改elasticsearch.yml后,重启es;

2、进入es的bin目录,敲入命令:

  1. ./elasticsearch-setup-passwords interactive #linux执行这个
  2. elasticsearch-setup-passwords interactive #windows执行这个

3、之后分别给elastic, kibana, logstash_system,beats_system等用户设置密码,具体如下例:

  1. [root@hecs-81986 bin]# ./elasticsearch-setup-passwords interactive
  2. Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
  3. You will be prompted to enter passwords as the process progresses.
  4. Please confirm that you would like to continue [y/N]y
  5. Enter password for [elastic]:
  6. passwords must be at least [6] characters long
  7. Try again.
  8. Enter password for [elastic]:
  9. Reenter password for [elastic]:
  10. Enter password for [apm_system]:
  11. Reenter password for [apm_system]:
  12. Enter password for [kibana_system]:
  13. Reenter password for [kibana_system]:
  14. Enter password for [logstash_system]:
  15. Reenter password for [logstash_system]:
  16. Enter password for [beats_system]:
  17. Reenter password for [beats_system]:
  18. Enter password for [remote_monitoring_user]:
  19. Reenter password for [remote_monitoring_user]:
  20. Changed password for user [apm_system]
  21. Changed password for user [kibana_system]
  22. Changed password for user [kibana]
  23. Changed password for user [logstash_system]
  24. Changed password for user [beats_system]
  25. Changed password for user [remote_monitoring_user]
  26. Changed password for user [elastic]

执行完毕之后,访问es节点就需要用户名密码了,如下:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/86714
推荐阅读
相关标签
  

闽ICP备14008679号