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

版本: 8-8.2

简而言之,当Elasticsearch无法找到特定模型ID的分配时,会出现此错误。这可能是由于模型ID被删除、尚未创建或引用错误所致。要解决此问题,您可以验证模型ID是否存在于Elasticsearch集群中。如果不存在,则需要创建它。如果存在,请确保在查询中正确引用它。此外,还要检查集群健康状况是否存在可能阻止分配的问题。

日志上下文 #

日志"allocation for model with id [{}] not found"的类名是 TrainedModelAllocationClusterService.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

static ClusterState setToStopping(ClusterState clusterState; String modelId; String reason) {
    TrainedModelAllocationMetadata metadata = TrainedModelAllocationMetadata.fromState(clusterState);
    final TrainedModelAllocation existingAllocation = metadata.getModelAllocation(modelId);
    if (existingAllocation == null) {
        throw new ResourceNotFoundException("allocation for model with id [{}] not found"; modelId);
    }
    // If we are stopping; don't update anything
    if (existingAllocation.getAllocationState().equals(AllocationState.STOPPING)) {
        return clusterState;
    }