wxywb / history_rag

865 stars 113 forks source link

Exception has occurred: MilvusException <MilvusException: (code=2, message=Fail connecting to server on localhost:19530, illegal connection params or server unavailable)> #65

Closed flash201524 closed 7 months ago

flash201524 commented 7 months ago

Exception has occurred: MilvusException <MilvusException: (code=2, message=Fail connecting to server on localhost:19530, illegal connection params or server unavailable)> 这个怎么解决

flash201524 commented 7 months ago

我怀疑是环境配置有问题,但是明明是按照流程来的啊

flash201524 commented 7 months ago
 ___  ___   _____         _   _   _   _____   _____   _____   _____   __    __ 
/   |/   | |  _  \       | | | | | | /  ___/ |_   _| /  _  \ |  _  \  \ \  / / 

/ /| /| | | || | | || | | | | | | | | | | | | || | \ \/ /
/ / |
/ | | | / | | | | _ \ | | | | | | | / \ /
/ / | | | | \ \ | | | | | |
| | | | | || | | | \ \ / /
/
/ || || _\ || || || /____/ || _____/ || _\ /_/


(rag) 选择[milvus|pipeline]方案 (rag) milvus (rag) milvus模式已选择 1.使用build data/history_24/baihuasanguozhi.txt来进行知识库构建。 2.已有索引可以使用ask进行提问, -d参数以debug模式进入。 3.删除已有索引可以使用remove baihuasanguozhi.txt。 (rag) build data/tripitaka Failed to create new connection using: f4f144bc27834423a1ffbffa457ecca7 Traceback (most recent call last): File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/main.py", line 39, in cli.main() File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 430, in main run() File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher/../../debugpy/../debugpy/server/cli.py", line 284, in run_file runpy.run_path(target, run_name="main") File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "/Users/a11/.vscode/extensions/ms-python.python-2023.14.0/pythonFiles/lib/python/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "/Users/a11/Library/CloudStorage/OneDrive-个人/history_rag-master/cli.py", line 120, in cli.run() File "/Users/a11/Library/CloudStorage/OneDrive-个人/history_rag-master/cli.py", line 53, in run self.parse_input(command_text) File "/Users/a11/Library/CloudStorage/OneDrive-个人/history_rag-master/cli.py", line 65, in parse_input self.build_index(path=commands[1], overwrite=False) File "/Users/a11/Library/CloudStorage/OneDrive-个人/history_rag-master/cli.py", line 92, in build_index self._executor.build_index(path, overwrite) File "/Users/a11/Library/CloudStorage/OneDrive-个人/history_rag-master/executor.py", line 159, in build_index vector_store = MilvusVectorStore( File "/Users/a11/Library/Python/3.9/lib/python/site-packages/llama_index/vector_stores/milvus.py", line 137, in init self.milvusclient = MilvusClient( File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/milvus_client/milvus_client.py", line 53, in init self._using = self._create_connection( File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/milvus_client/milvus_client.py", line 639, in _create_connection raise ex from ex File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/milvus_client/milvus_client.py", line 636, in _create_connection connections.connect(using, user, password, db_name, token, uri=uri, kwargs) File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/orm/connections.py", line 420, in connect connect_milvus(kwargs, user=user, password=password, token=token, db_name=db_name) File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/orm/connections.py", line 371, in connect_milvus gh._wait_for_channel_ready(timeout=timeout) File "/Users/a11/Library/Python/3.9/lib/python/site-packages/pymilvus/client/grpc_handler.py", line 146, in _wait_for_channel_ready raise MilvusException( pymilvus.exceptions.MilvusException: <MilvusException: (code=2, message=Fail connecting to server on localhost:19530, illegal connection params or server unavailable)>

flash201524 commented 7 months ago

TERMINAL a11@Steve-Jobs-Macbook-Air ~ % docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a11@Steve-Jobs-Macbook-Air ~ %

wxywb commented 7 months ago

很明显,你的milvus启动失败了

flash201524 commented 7 months ago

很明显,你的milvus启动失败了

那怎么解决啊😭我是小白不懂这些

wxywb commented 7 months ago

正常启动的话你docker ps会有etcd milvus minio等组件,你不会跳过启动milvus这一步了吧

flash201524 commented 7 months ago

正常启动的话你docker ps会有etcd milvus minio等组件,你不会跳过启动milvus这一步了吧

启动milvus是步骤2吗?我现在发现可能之前没有完全搞好? 所以每次电脑重启都要重复步骤2吗?还是不用

flash201524 commented 7 months ago

但是在Windows我也遇到了同样的问题,然后那个步骤2我是做了的

flash201524 commented 7 months ago

正常启动milvus之后好像可以了,不过这个build时间一般要多久啊,又看不到进度的

wxywb commented 7 months ago

正常启动milvus之后好像可以了,不过这个build时间一般要多久啊,又看不到进度的

看你的机器,我用的NVIDIA GeForce RTX 2080 Ti,三国数据大概要5分钟,24史用了两个小时,如果用cpu会很慢,如果实在没显卡,可以使用pipeline.

flash201524 commented 7 months ago

正常启动milvus之后好像可以了,不过这个build时间一般要多久啊,又看不到进度的

看你的机器,我用的NVIDIA GeForce RTX 2080 Ti,三国数据大概要5分钟,24史用了两个小时,如果用cpu会很慢,如果实在没显卡,可以使用pipeline.

我windows是RTX 3060,但是看了一下资源管理器好像没有用显卡

wxywb commented 7 months ago

正常应该用的,看一下你的pytorch是不是有问题,

python

Python 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import torch torch.zeros(5).cuda()

tensor([0., 0., 0., 0., 0.], device='cuda:0')

flash201524 commented 7 months ago

正常应该用的,看一下你的pytorch是不是有问题,

python

Python 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import torch torch.zeros(5).cuda()

tensor([0., 0., 0., 0., 0.], device='cuda:0')

Traceback (most recent call last): File "", line 1, in File "E:\software\Anaconda\Lib\site-packages\torch\cuda__init__.py", line 293, in _lazy_init raise AssertionError("Torch not compiled with CUDA enabled") AssertionError: Torch not compiled with CUDA enabled

好奇怪,我明明是装的CUDA版的啊 conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

flash201524 commented 7 months ago

重装了一下搞定了