步骤
- 确保支持本地认证,在elasticsearch.yml中
- 创建基于本地问价认证的超级管理员
./elasticsearch-users useradd 用户名 -p 用户密码 -r superuser(这个是用户角色)
- 通过刚才创建的用户重置
elastic
的密码
POST /_security/user/<username>/_password
{
"password" : "s3cr3t"
}
关于ES的用户角色
superuser
Grants full access to the cluster, including all indices and data. A user with the superuser role can also manage users and roles and impersonate any other user in the system. Due to the permissive nature of this role, take extra care when assigning it to a user.