es7.6.2 failed to retrieve password hash for reserved user [elastic]

报错信息
[2020-09-01T15:59:41,129][ERROR][o.e.x.s.a.e.ReservedRealm] [node-3] failed to retrieve password hash for reserved user [elastic]
org.elasticsearch.action.UnavailableShardsException: at least one primary shard for the index [.security-7] is unavailable
        at org.elasticsearch.xpack.security.support.SecurityIndexManager.getUnavailableReason(SecurityIndexManager.java:182) ~[x-pack-security-7.6.2.jar:7.6.2]
        at org.elasticsearch.xpack.security.authc.esnative.NativeUsersStore.getReservedUserInfo(NativeUsersStore.java:525) [x-pack-security-7.6.2.jar:7.6.2]
        at org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.getUserInfo(ReservedRealm.java:212) [x-pack-security-7.6.2.jar:7.6.2]
        at org.elasticsearch.xpack.security.authc.esnative.ReservedRealm.doAuthenticate(ReservedRealm.java:93) [x-pack-security-7.6.2.jar:7.6.2]
        at org.elasticsearch.xpack.security.authc.support.CachingUsernamePasswordRealm.authenticateWithCache(CachingUsernamePasswordRealm.java:167) [x-pack-security-7.6.2.jar:7.6.2]
        at org.elasticsearch.xpack.security.authc.support.Cach
es集群重置密码操作方法如下:
  1. 添加本地账户(所有master节点都要执行)
$ cd /data/work/elasticsearch-7.6.2_master/bin/
$ ./elasticsearch-users useradd tempuser -p tempuser -r superuser 
$ ./elasticsearch-users  list
tempuser       : superuser
  1. 执行重置elastic账户的密码
$ curl -XPUT -u tempuser:tempuser http://10.101.121.180:9200/_xpack/security/user/elastic/_password -H "Content-Type: application/json" -d '
{
 "password": "xxx"
}'
{} #执行成功
  1. 测试重置密码是否生效
$ curl  --user  elastic:xxx 'localhost:9200/_cat/health?v'
epoch      timestamp cluster       status node.total node.data shards   pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1598947985 08:13:05  cluster-7.6.2 yellow          6         3  24416 24142    0    0    23832             1                  -                 50.6%
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值