0
点赞
收藏
分享

微信扫一扫

Milvus报错[ERROR][SERVER][TakeToEUse milvus.has_collection to verify whether the collection exists

求索大伟 2022-04-26 阅读 54
人工智能

报错

[2022-04-25 23:07:20,681][ERROR][SERVER][TakeToExecute][reqsched_thread] Request failed with code: Error code(30100): Collection xxx does not exist. Use milvus.has_collection to verify whether the collection exists. You also can check whether the collection name exists.

解决方案

删除的时候一定是先删除索引,再删除集合,顺序反了会报错

创建的时候一定是后创建索引,先创建集合,顺序反了会报错

    def insert_ini(self, collection_name, vectors, ids=None, partition_tag=None):
        try:
            if self.has_collection(collection_name):
                self.client.drop_index(collection_name)
                self.client.drop_collection(collection_name)
            self.creat_collection(collection_name)
            self.create_index(collection_name)
            print('collection info: {}'.format(self.client.get_collection_info(collection_name)[1]))
            self.create_partition(collection_name, partition_tag)
            if vectors != -1:
                status, ids = self.client.insert(
                    collection_name=collection_name,
                    records=vectors,
                    ids=ids,
                    partition_tag=partition_tag)
                self.client.flush([collection_name])
                print(
                    'Insert {} entities, there are {} entities after insert data.'.
                    format(
                        len(ids), self.client.count_entities(collection_name)[1]))
                return status, ids
            else:
                return -1, ids
        except Exception as e:
            print("Milvus insert error:", e)

整体弄完后,一定要去组件的后台查看日志,看是否有异常

单机版

 cd /home/$USER/milvus/logs

无报错日志才算彻底正常

cat milvus-22-04-25-22:22-error.log

在这里插入图片描述

mishards集群版

进相应的节点,查看日志文件,一样挨个做检查。

 	kubectl get pods

    kubectl exec -it milvus-release-mishards-767dc476bf-fxz8v -- /bin/bash

    kubectl exec -it milvus-release-readonly-6cb6c5bcd9-9m4c5 -- /bin/bash
    kubectl exec -it milvus-release-readonly-6cb6c5bcd9-mzrh6 -- /bin/bash

    kubectl exec -it milvus-release-writable-7776777fcc-dsdmv -- /bin/bash
举报

相关推荐

0 条评论