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

版本: 7-7

简而言之,当您使用 Elasticsearch 的试用许可证但未显式启用安全功能时,就会出现此错误。Elasticsearch 要求试用许可证必须启用安全功能,以确保数据保护。要解决此问题,您可以在 elasticsearch.yml 配置文件中将 “xpack.security.enabled” 设置为 true 来启用安全功能。此外,请确保配置内置用户(如 elastic、kibana 等)并为节点间通信配置 TLS/SSL,以实现安全设置。

日志上下文 #

日志 “Security must be explicitly enabled when using a trial license.” 的类名是 SecurityActionFilter.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

} catch (Exception e) {
 listener.onFailure(e);
 }
 } else if (SECURITY_ACTION_MATCHER.test(action)) {
 if (licenseState.isSecurityDisabledByTrialLicense()) {
 listener.onFailure(new ElasticsearchException("Security must be explicitly enabled when using a trial 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));
 }