Ubuntu24.04安装Milvus

Title Ubuntu24.04安装Milvus
Framework Ubuntu
User wy8817399@vip.qq.com
Id 57
Created 2/24/26, 4:25 PM
Modified 9/5/26, 2:02 PM
Published Yes
Content

1、创建目录并下载docker的yml文件

sudo mkdir /Milvus && cd /Milvus
wget https://github.com/milvus-io/milvus/releases/download/v2.6.11/milvus-standalone-docker-compose.yml -O docker-compose.yml

 

2、根据服务器的实际情况修改yml文件

services:
  etcd:
    container_name: milvus-etcd
    image: quay.io/coreos/etcd:v3.5.25
    restart: unless-stopped
    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://etcd: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
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - timeless

  minio:
    container_name: milvus-minio
    image: minio/minio:RELEASE.2024-12-18T13-15-44Z
    restart: unless-stopped
    environment:
      MINIO_ROOT_USER: minioadmin          # ← 改密码改这里(连同 standalone 两行共 4 处一起改)
      MINIO_ROOT_PASSWORD: minioadmin      # ← 密码至少 8 位
    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
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - timeless

  standalone:
    container_name: milvus-standalone
    image: milvusdb/milvus:v2.6.11
    restart: unless-stopped
    command: ["milvus", "run", "standalone"]
    security_opt:
      - seccomp:unconfined
    environment:
      ETCD_ENDPOINTS: etcd:2379
      MINIO_ADDRESS: minio:9000
      # ↓ 这两行是官方默认没有的(默认值恰好是 minioadmin)。
      #   显式写出是为了:你改了上面 MinIO 密码时,把这两行改成一样的值即可
      MINIO_ACCESSKEYID: minioadmin
      MINIO_SECRETACCESSKEY: minioadmin
      COMMON_SECURITY_AUTHORIZATIONENABLED: "true"   # Milvus 鉴权:默认账号 root / Milvus,登录后立即改密
      MQ_TYPE: woodpecker
    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"
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - timeless

  # ---------- Attu 管理界面(非官方自带,不需要可整段删除) ----------
  attu:
    container_name: milvus-attu
    image: zilliz/attu:v2.6
    restart: unless-stopped
    environment:
      MILVUS_URL: milvus-standalone:19530   # 容器间互访用容器名,不是 localhost
    ports:
      - "8888:3000"   # 浏览器访问 http://服务器IP:8888
    depends_on:
      - "standalone"
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - timeless

networks:
  timeless:
    name: timeless
    driver: bridge

 

3、启动docker

docker compse up -d

 

4、浏览器访问

http://192.168.20.143:8888

 

5、默认帐号密码

#默认ATTU的帐号密码,进去后需要立即改
默认帐号:root
默认密码:Milvus
默认端口:19530