服务器上部署GPU版的milvus向量数据库

服务器 0

1、安装docker compose

  1. 我们可以从 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
  1. 将可执行权限应用于二进制文件:
$ sudo chmod +x /usr/local/bin/docker-compose
  1. 创建软链:
 $ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
  1. 测试是否安装成功:
$ 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/tcpmilvus-minio        /usr/bin/docker-entrypoint ...   Up (healthy)   9000/tcpmilvus-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后删除数据:

sudo rm -rf  volumes

参考链接:https://milvus.io/docs/install_standalone-docker-compose-gpu.md

也许您对下面的内容还感兴趣: