1、安装docker compose
- 我们可以从 Github 上下载它的二进制包来使用,最新发行的版本地址:
https://github.com/docker/compose/releases
sudo curl -L "https://github.com/docker/compose/releases/download/v2.6.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- 将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose
- 创建软链:
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
- 测试是否安装成功:
$ docker-compose version
2、安装GPU驱动
已安装好的朋友,这步可以跳过
sudo apt install --no-install-recommends nvidia-headless-545 nvidia-utils-545
3、下载安装milvus
1.Download milvus-standalone-docker-compose-gpu.yml
wget https://github.com/milvus-io/milvus/releases/download/v2.4.0-rc.1/milvus-standalone-docker-compose-gpu.yml -O docker-compose.yml
大家根据自己的硬件配置,使用单GPU,还是使用多GPU都可以。在docker-compose.yml文件中更改。
单GPU:
...
standalone:
gpu:
initMemSize: 0
maxMemSize: 1024
...
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: ["gpu"]
device_ids: ["0"]
...
多GPU:
...
standalone:
gpu:
initMemSize: 0
maxMemSize: 1024
...
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: ["gpu"]
device_ids: ['0', '1']
...
2.Start Milvus
在docker-compose.yml路径下,
sudo docker compose up -d
或
sudo docker-compose up -d
启动后会显示:
Creating milvus-etcd … done
Creating milvus-minio … done
Creating milvus-standalone … done
3.验证安装
Milvus 单机版启动后,将有三个 docker 容器在运行,包括 Milvus 单机版服务及其两个依赖项。
sudo docker ps
Name Command State Ports
--------------------------------------------------------------------------------------------------------------------
milvus-etcd etcd -advertise-client-url ... Up 2379/tcp, 2380/tcp
milvus-minio /usr/bin/docker-entrypoint ... Up (healthy) 9000/tcp
milvus-standalone /tini -- milvus run standalone Up 0.0.0.0:19530->19530/tcp, 0.0.0.0:9091->9091/tcp
4.Stop Milvus
关闭Milvus standalone:
sudo docker compose down
在关闭Milvus后删除数据:文章来源:https://www.toymoban.com/news/detail-853646.html
sudo rm -rf volumes
参考链接:https://milvus.io/docs/install_standalone-docker-compose-gpu.md文章来源地址https://www.toymoban.com/news/detail-853646.html
到了这里,关于服务器上部署GPU版的milvus向量数据库的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!