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

适用版本: 8.8-8.9

此错误发生的原因是在 Elasticsearch 中设置了次要端点(secondary endpoint),但没有设置主要端点(primary endpoint)。Elasticsearch 需要主要端点才能正常运行,只有在已经配置主要端点的情况下,才能设置次要端点。

要解决此问题,请确保在设置次要端点之前先设置主要端点。或者,如果次要端点不是必需的,可以将其移除。同时,请检查您的配置文件或设置,确保主要端点已正确定义且可访问。

日志上下文 #

日志 “A primary endpoint is required when setting a secondary endpoint” 的类名是 AzureStorageSettings.java。我们从 Elasticsearch 源代码中提取了以下内容,以供那些需要深入了解上下文的用户参考:

if (hasEndpointSuffix && hasSecondaryEndpoint) {
 throw new SettingsException("Both an endpoint suffix as well as a secondary endpoint were set");
 }  if (hasEndpoint == false && hasSecondaryEndpoint) {
 throw new SettingsException("A primary endpoint is required when setting a secondary endpoint");
 }  if (hasEndpointSuffix) {
 connectionStringBuilder.append(";EndpointSuffix=").append(endpointSuffix);
 }