1、需要在配置文件中开启x-pack验证:修改config目录下面的elasticsearch.yml文件,在里面添加如下内容
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
2、重启es
3、进入es的安装根目录bin下找到elasticsearch-setup-passwords、并执行如下命令
elasticsearch-setup-passwords interactive
4、执行elasticsearch-setup-passwords interactive命令后,这里需要为4个用户分别设置密码,elastic, kibana, logstash_system,beats_system
Enter password for [elastic]:
Reenter password for [elastic]:
Enter password for [kibana]:
Reenter password for [kibana]:
Enter password for [logstash_system]:
Reenter password for [logstash_system]:
Enter password for [beats_system]:
Reenter password for [beats_system]:
Changed password for user [kibana]
Changed password for user [logstash_system]
Changed password for user [beats_system]
Changed password for user [elastic]
5、设置完成,重启es即可生效
文章来源地址https://www.toymoban.com/news/detail-784756.html
文章来源:https://www.toymoban.com/news/detail-784756.html
到了这里,关于elasticsearch设置用户名和密码的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!