作者:若我倆有了愛 | 来源:互联网 | 2023-06-05 14:59
Elasticsearch示例版本:7.9.2一、设置密码1.需要在配置文件中开启x-pack验证,修改config目录下面的elasticsearch.yml文件
Elasticsearch示例版本:7.9.2
一、设置密码
1.需要在配置文件中开启x-pack验证, 修改config目录下面的elasticsearch.yml文件,在里面添加如下内容,并重启es.
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
2,进入es的安装根目录bin下,E:\software\es\elasticsearch-7.9.2\bin
执行设置用户名和密码的命令,这里需要为4个用户分别设置密码,elastic, kibana, logstash_system,beats_system
elasticsearch-setup-passwords interactive
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]
3:将kibana.yml添加:
elasticsearch.username: "elastic"
elasticsearch.password: "xxxx"
4,重启即可。
5,修改密码时,将第一步配置删除,然后重启es,将.security-7的索引删除即可。
然后重新1-4步骤。