How to Install and Run Milvus Vector Database with Docker Compose
This guide introduces Milvus, an open‑source vector database for AI workloads, outlines its key features and common use cases, and provides step‑by‑step Docker‑Compose commands to set up Milvus, its storage backend MinIO, and the Attu management UI.
Milvus Vector Database Overview
Milvus is an open‑source vector database designed for large‑scale vector data storage, retrieval, and analysis. It is widely used in machine‑learning, artificial‑intelligence, computer‑vision, and natural‑language‑processing scenarios where efficient similarity search is required. Official documentation: https://milvus.io/docs/zh
Key Features
Efficient vector search: Supports multiple high‑performance indexing algorithms (both memory‑based and disk‑based) for fast processing of massive vector datasets.
Flexible data model: Allows storage of structured and unstructured data in various formats.
High concurrency handling: Capable of serving many simultaneous queries, suitable for real‑time applications.
Scalability: Horizontal scaling by adding nodes to accommodate larger data volumes and query loads.
Multi‑language SDKs: Provides client libraries for Python, Java, Go, and C++.
Machine‑learning framework integration: Can be integrated with TensorFlow, PyTorch, and other AI frameworks.
Multiple index types: Offers IVF, HNSW, ANNOY, etc., letting users choose the optimal index for their workload.
Various storage backends: Supports local disk and cloud storage options.
Typical Use Cases
Image and video retrieval: Similarity search in computer‑vision applications.
Natural‑language processing: Text‑embedding retrieval and analysis.
Recommendation systems: Personalized recommendations via vector similarity.
Bioinformatics: Gene and protein vector analysis.
Installation Steps
Prepare host directories for Etcd, Milvus, and MinIO:
mkdir -p /zpaas/volumes/etcd
mkdir -p /zpaas/volumes/milvus
mkdir -p /zpaas/volumes/minio
chmod 700 /zpaas/volumes/etcdCreate a docker-compose-milvus.yml file with the following services:
version: '3.5'
services:
etcd:
container_name: milvus-etcd
image: hub-nj.iwhalecloud.com/zcm_k8s/etcd:3.5.6-0
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- /zpaas/volumes/etcd:/etcd
ports:
- "3379:3379"
command: etcd -advertise-client-urls=http://127.0.0.1:3379 -listen-client-urls http://0.0.0.0:3379 --data-dir /etcd
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 5s
timeout: 3s
retries: 10
minio:
container_name: milvus-minio
image: hub-nj.iwhalecloud.com/public/minio:RELEASE.2023-03-20T20-16-18Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
ports:
- "9001:9001"
- "9000:9000"
volumes:
- /zpaas/volumes/minio:/minio_data
command: minio server /minio_data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 10
standalone:
container_name: milvus-standalone
image: hub-nj.iwhalecloud.com/public/milvus:v2.4.5
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:3379
MINIO_ADDRESS: minio:9000
volumes:
- /zpaas/volumes/milvus:/var/lib/milvus
ports:
- "19530:19530"
- "9091:9091"
depends_on:
- etcd
- minio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 30s
start_period: 90s
timeout: 20s
retries: 3
networks:
default:
name: milvusStart the services:
docker-compose -f docker-compose-milvus.yml up -dVerify that the containers are running: docker ps -a | grep milvus Example output shows the Milvus, MinIO, and Etcd containers with their health status and port mappings.
Attu Management UI Installation
Attu is a graphical management tool for Milvus. Deploy it with Docker:
docker run -d \
--name=attu \
-p 8000:3000 \
-e MILVUS_URL=10.10.194.210:19530 \
hub-nj.iwhalecloud.com/public/attu:v2.3.9Access the UI at http://x.x.x.x:8000.
MinIO Access
Default credentials are minioadmin / minioadmin. The web console is reachable at http://x.x.x.x:9001.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
