使用docker-compose安装Milvus向量数据库及Attu可视化连接工具

服务器需要安装docker-compose

如何没有安装可以参考这篇博客

https://www.cnblogs.com/likecoke/p/17596918.html

1、创建宿主机上存储的目录
mkdir -p /home/milvus/db
mkdir -p /home/milvus/conf
mkdir -p /home/milvus/etcd
2、下载milvus官网的docker-compose.yml文件
wget https://github.com/milvus-io/milvus/releases/download/v2.2.11/milvus-standalone-docker-compose.yml -O docker-compose.yml
milvus官网链接:https://milvus.io/docs/install_standalone-docker.md
3、修改默认的docker-compose.yml文件配置

vim docker-compose.yml

version: '3.5'

services:
etcd:
container_name: milvus-etcd
image: quay.io/coreos/etcd:v3.5.5
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- /home/milvus/etcd:/etcd
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd

minio:
container_name: milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
volumes:
- /home/milvus/minio:/minio_data
command: minio server /minio_data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3

standalone:
container_name: milvus-standalone
image: milvusdb/milvus:v2.2.11
command: ["milvus", "run", "standalone"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
volumes:
- /home/milvus/db:/var/lib/milvus
ports:
- "19530:19530"
- "9091:9091"
depends_on:
- "etcd"
- "minio"

networks:
default:
name: milvus

注意:需确保宿主机的19530和9091端口没有被占用
如果被占用了 则需修改下端口号 19530和9091

4、启动milvus
docker-compose up -d
5、查看是否启动成功
docker ps

可以看到这三个容器已经成功启动
6、安装Attu
Attu为Milvus的一个高效的开源管理工具且为可视化
docker run -p 8001:3000 -e MILVUS_URL=192.168.1.56:19530 zilliz/attu:v2.2.6
注意:192.168.1.56替换成自己的服务器IP
Attu的官网docker安装链接:https://github.com/zilliztech/attu/blob/main/doc/zh-CN/attu_install-docker.md
7、访问attu
http://192.168.1.56:8001
注意:192.168.1.56替换成自己的服务器IP
输入用户名:minioadmin
输入密码:minioadmin
然后点击Connect

 部署成功

 

posted @ 2023-08-22 16:23  宝英姐姐  阅读(4189)  评论(0编辑  收藏  举报