📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-7.15

简而言之,当用户尝试调整Elasticsearch索引大小但没有必要的权限时,就会发生此错误。Elasticsearch具有一项安全功能,将某些操作限制为具有特定角色的用户。要解决此问题,您可以授予用户必要的权限,或者使用已经具有所需权限的用户执行调整大小操作。或者,您可以禁用安全功能,但不建议这样做,因为这可能会使您的Elasticsearch集群暴露于潜在威胁之下。

日志上下文 #

日志"Resize requests are not allowed for users when"的类名是 ResizeRequestInterceptor.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入了解上下文的人使用:

indicesAccessControl.getIndexPermissions(request.getSourceIndex());
 if (indexAccessControl != null) {
 final boolean fls = indexAccessControl.getFieldPermissions().hasFieldLevelSecurity();
 final boolean dls = indexAccessControl.getDocumentPermissions().hasDocumentLevelPermissions();
 if ((fls || dls) && licenseChecker.get()) {
 listener.onFailure(new ElasticsearchSecurityException("Resize requests are not allowed for users when " +
 "field or document level security is enabled on the source index"; RestStatus.BAD_REQUEST));
 return;
 }
 }