首先确保系统已经安装上了docker
然后去https://github.com/docker/compose/releases/
下载安装docker-compose
跟随自己下系统和服务器情况下载
上传到服务器
bash
mv docker-compose-linux-aarch64 docker-compose
chmod +x docker-compose
2.dockr-compose命令
bash
docker-compose up
用于部署一个 Compose 应用
默认情况下该命令会读取名为 docker-compose.yml 或 docker-compose.yaml 的文件
当然用户也可以使用 -f 指定其他文件名。通常情况下,会使用 -d 参数令应用在后台启动
bash
docker-compose stop
停止 Compose 应用相关的所有容器,但不会删除它们
被停止的应用可以很容易地通过 docker-compose restart 命令重新启动
bash
docker-compose rm
用于删除已停止的 Compose 应用
它会删除容器和网络,但是不会删除卷和镜像
bash
docker-compose restart
重启已停止的 Compose 应用
bash
docker-compose ps
用于列出 Compose 应用中的各个容器
输出内容包括当前状态、容器运行的命令以及网络端口
bash
docker-compose down
停止并删除运行中的 Compose 应用
bash
1、创建宿主机上存储的目录
mkdir -p /data/milvus/db
mkdir -p /data/milvus/conf
mkdir -p /data/milvus/etcd
milvus官网链接:https://milvus.io/docs/install_standalone-docker.md
1、下载YAML文件github地址:https://github.com/milvus-io/milvus/releases/
下载milvus-standalone-docker-compose.yml并手动或使用以下命令将其保存为docker-compose.yml。
bash
wget https://github.com/milvus-io/milvus/releases/download/v2.4.17/milvus-standalone-docker-compose.yml -O docker-compose.yml
下载不了的docker-compose.yml使用以下的也是可以的
bash
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:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/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
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 30s
timeout: 20s
retries: 3
minio:
container_name: milvus-minio
image: minio/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
ports:
- "9001:9001"
- "9000:9000"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
command: minio server /minio_data --console-address ":9001"
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.4.17
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
ports:
- "19530:19530"
- "9091:9091"
depends_on:
- "etcd"
- "minio"
networks:
default:
name: milvus
如果minio镜像拉去不到请去找能下载的
x86
bash
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/etcd:v3.5.5
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/minio:RELEASE.2023-03-20T20-16-18Z
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/milvus:v2.4.17
arm架构
bash
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/linux_arm64_etcd:v3.5.5
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/linux_arm64_minio:RELEASE.2023-03-20T20-16-18Z
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/linux_arm64_milvus:v2.4.17
然后docker tag 改成自己对应的镜像名字即可运行啦。
bash
docker tag registry.cn-hangzhou.aliyuncs.com/qiluo-images/etcd:v3.5.5 coreos/etcd:v3.5.5
docker tag registry.cn-hangzhou.aliyuncs.com/qiluo-images/minio:RELEASE.2023-03-20T20-16-18Z minio/minio:RELEASE.2023-03-20T20-16-18Z
docker tag registry.cn-hangzhou.aliyuncs.com/qiluo-images/milvus:v2.4.17 milvusdb/milvus:v2.4.17
2、启动Milvus
在与docker-compose.yml文件相同的目录中,通过运行以下命令启动Milvus:
bash
sudo docker-compose up -d
检查容器是否已启动并正在运行:
bash
sudo docker-compose ps
3、停止Milvus
要停止Milvus单机版,运行:
bash
sudo docker-compose down
要在停止Milvus后删除数据,运行:
bash
sudo rm -rf volumes
安装Milvus可视化工具Attu
Attu是Milvus的一个高效的开源管理工具
拉取镜像:
x86
版本
bash
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/attu:latest
arm
版本
bash
docker pull registry.cn-hangzhou.aliyuncs.com/qiluo-images/linux_arm64_attu:latest
以下代码安装Attu镜像并运行:
bash
docker run -p 8000:3000 -e MILVUS_URL=IP地址:19530 registry.cn-hangzhou.aliyuncs.com/qiluo-images/attu:latest
启动docker后,在浏览器中访问http://你的IP地址:8000,然后单击"连接"以进入Attu服务。同时还支持TLS连接、用户名和密码
向量数据库管理工具下载地址
bash
https://zilliz.com.cn/attu
https://docs.zilliz.com.cn/docs/quick-start
https://zilliz.com.cn/
下载外部链接工具https://github.com/zilliztech/attu/releases
此时你就部署完成了