一台 milvus 干不完的活 ,需要多台来干活
干活的节点是 querynode
所以,需要多台机器来部署
只要两个文件
下面的问题,上面部署了一堆东西,我们称之为主节点
version: "3.5"
services:
etcd:
container_name: svddb-cluster-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
ports:
- "2379:2379"
- "12379:2379"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes-etcd/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
pulsar:
container_name: svddb-cluster-milvus-pulsar
image: apachepulsar/pulsar:2.8.2
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/pulsar:/pulsar/data
environment:
# bin/apply-config-from-env.py script will modify the configuration file based on the environment variables
# nettyMaxFrameSizeBytes must be calculated from maxMessageSize + 10240 (padding)
- nettyMaxFrameSizeBytes=104867840 # this is 104857600 + 10240 (padding)
- defaultRetentionTimeInMinutes=10080
- defaultRetentionSizeInMB=8192
# maxMessageSize is missing from standalone.conf, must use PULSAR_PREFIX_ to get it configured
- PULSAR_PREFIX_maxMessageSize=104857600
- PULSAR_GC=-XX:+UseG1GC
ports:
- "6650:6650"
command: |
/bin/bash -c \
"bin/apply-config-from-env.py conf/standalone.conf && \
exec bin/pulsar standalone --no-functions-worker --no-stream-storage"
minio:
container_name: svddb-cluster-milvus-minio
image: minio/minio:RELEASE.2022-03-17T06-34-49Z
environment:
MINIO_ACCESS_KEY: minioadmin
MINIO_SECRET_KEY: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes-minio/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
rootcoord:
container_name: svddb-cluster-milvus-rootcoord
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "rootcoord"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
ROOT_COORD_ADDRESS: rootcoord:53100
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-rootcoord:/var/lib/milvus
depends_on:
- "etcd"
- "pulsar"
- "minio"
proxy:
container_name: svddb-cluster-milvus-proxy
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "proxy"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-proxy:/var/lib/milvus
ports:
- "19530:19530"
- "9091:9091"
querycoord:
container_name: svddb-cluster-milvus-querycoord
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "querycoord"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
QUERY_COORD_ADDRESS: querycoord:19531
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-querycoord:/var/lib/milvus
ports:
- "19531:19531"
depends_on:
- "etcd"
- "pulsar"
- "minio"
querynode:
container_name: svddb-cluster-milvus-querynode
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "querynode"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-querynode:/var/lib/milvus
depends_on:
- "querycoord"
indexcoord:
container_name: svddb-cluster-milvus-indexcoord
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "indexcoord"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
INDEX_COORD_ADDRESS: indexcoord:31000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-indexcoord:/var/lib/milvus
ports:
- "31000:31000"
depends_on:
- "etcd"
- "pulsar"
- "minio"
indexnode:
container_name: svddb-cluster-milvus-indexnode
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "indexnode"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
INDEX_COORD_ADDRESS: indexcoord:31000
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-indexnode:/var/lib/milvus
depends_on:
- "indexcoord"
datacoord:
container_name: svddb-cluster-milvus-datacoord
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "datacoord"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
DATA_COORD_ADDRESS: datacoord:13333
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-datacoord:/var/lib/milvus
ports:
- "13333:13333"
depends_on:
- "etcd"
- "pulsar"
- "minio"
datanode:
container_name: svddb-cluster-milvus-datanode
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "datanode"]
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
PULSAR_ADDRESS: pulsar://pulsar:6650
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-datanode:/var/lib/milvus
depends_on:
- "datacoord"
zilliz_attu:
container_name: svddb-cluster-zilliz_attu
image: zilliz/attu:v2.2.7
restart: always
environment:
HOST_URL: http://0.0.0.0:8000
MILVUS_URL: proxy:19530
ports:
- "8000:3000"
networks:
default:
name: milvus
第二个文件,我们作为子节点,就是只部署 querynode
对于查询,datanode、indexnode 只会看戏,真正干活的是 querynode,所以需要水平扩展 querynode 就好了
version: "3.5"
services:
querynode-2:
network_mode: host
container_name: svddb-cluster-milvus-querynode-2
image: milvusdb/milvus:v2.2.9
command: ["milvus", "run", "querynode"]
environment:
ETCD_ENDPOINTS: 172.16.0.215:2379 # 把 ip 地址换成自己的
MINIO_ADDRESS: 172.16.0.215:9000 # 把 ip 地址换成自己的
PULSAR_ADDRESS: pulsar://172.16.0.215:6650 # 把第二个 pulsar 改成节点一的 ip 地址,第一个 pulsar 不要修改,因为第一个 pulsar 表示协议
QUERY_COORD_ADDRESS: 172.16.0.215:19531 # 把 ip 地址换成自己的
DATA_COORD_ADDRESS: 172.16.0.215:13333 # 把 ip 地址换成自己的
ROOT_COORD_ADDRESS: 172.16.0.215:53100 # 把 ip 地址换成自己的
INDEX_COORD_ADDRESS: 172.16.0.215:31000 # 把 ip 地址换成自己的
# ports:
# - "21123:21123"
volumes:
- ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/svddb-cluster-milvus-querynode-2:/var/lib/milvus
最后可以看到有 2 个 querynode
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。