failed to retrieve password hash for reserved user [elastic]
原创
©著作权归作者所有:来自51CTO博客作者freeAngus的原创作品,请联系作者获取转载授权,否则将追究法律责任
错误如下:
[2021-04-12T15: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有时候就会丢失分片。通常情况下,我们通过重新路由能够把分片找回来。但是出现这样的错误,丢失的分片,恰好是是我们es用于管理用户的索引 index [.security-7] 。
解决方案:我是直接重启了一下集群,就恢复了。