Milvus概述

Milvus创建于2019年,唯一的目标是:存储、索引和管理由深度神经网络和其他机器学习(ML)模型生成的大量嵌入向量embedding vectors

NOTE:embedding vectors是对非结构化数据的特征抽象,比如电子邮件、物联网传感器数据、Instagram照片、蛋白质结构等等。现代嵌入技术用于将非结构化数据转换为嵌入向量,从数学上讲,嵌入向量是浮点数或二进制数的数组。

设计原理

image-20241119111601731.png

环境需求

测试主机IP 192.168.10.201
docker-compose版本 2.18.1
docker版本 24.0.2
向量数据库版本 2.4.15
minio版本 RELEASE.2023-03-20T20-16-18Z
attu版本 2.4

单机部署

安装部署

1. 编写 docker-compose.yaml 文件
2. docker-compose up -d
3. docker安装milvus的dashboard客户端连接工具 
   docker run --name=attu --restart=always -p 8000:3000 -d -e HOST_URL=http://192.168.10.210:8000 -e MILVUS_URL=192.168.10.210:19530 swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/zilliz/attu:v2.4
4.访问attu

image-20241119112826915.png

docker-compose.yml

version: '3.5'

services:
  etcd:
    container_name: milvus-etcd
    image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/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: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/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: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/milvusdb/milvus:v2.4.15
    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

特别鸣谢

感谢渡渡鸟镜像站提供的国内免费的高速镜像