版本: 6.8-7.15
简而言之,当Elasticsearch被配置为使用需要安全性功能,但安全性未显式启用时,会出现此错误。这可能是由于elasticsearch.yml文件中缺少或配置不正确导致的。要解决此问题,您可以通过在elasticsearch.yml文件中将’xpack.security.enabled’设置为true来启用安全性。此外,确保许可证支持安全功能。如果不支持,您可能需要升级Elasticsearch许可证。另外,检查Elasticsearch版本是否支持安全性,因为旧版本可能没有此功能。
日志上下文 #
日志"Security must be explicitly enabled when using a [“类名称是 SecurityActionFilter.java。 我们从Elasticsearch源代码中提取以下内容,供那些寻求深入上下文的人使用:
} catch (Exception e) {
listener.onFailure(e);
}
} else if (SECURITY_ACTION_MATCHER.test(action)) {
if (licenseState.isSecurityEnabled() == false) {
listener.onFailure(new ElasticsearchException("Security must be explicitly enabled when using a [" +
licenseState.getOperationMode().description() + "] license. " +
"Enable security by setting [xpack.security.enabled] to [true] in the elasticsearch.yml file " +
"and restart the node."));
} else {
listener.onFailure(LicenseUtils.newComplianceException(XPackField.SECURITY));





