杂记 | 在Linux上使用Docker-compose安装单机版Milvus向量数据库并配置访问控制和可视化面板(Attu)
# 安装Docker和Docker-compose
sudo apt-update
sudo apt install -y docker.io docker-compose
# 创建milvus文件夹并进入
mkdir -p milvus && cd milvus
# 创建docker-compose.yml文件并编辑
nano docker-compose.yml
# 以下是docker-compose.yml文件的内容
version: '3.2'
services:
milvus:
image: milvusdb/milvus:2.0.0-cpu-dind
container_name: milvus
ports:
- "19530:19530"
- "19121:19121"
command:
- --config_file
- /home/$USER/milvus/conf/server_config.yaml
volumes:
- $PWD/conf:/home/$USER/milvus/conf
- $PWD/logs:/home/$USER/milvus/logs
- $PWD/dbs:/home/$USER/milvus/dbs
environment:
- MILVUS_DB_PATH=/home/$USER/milvus/dbs
- MILVUS_LOG_PATH=/home/$USER/milvus/logs
- MILVUS_CONFIG_PATH=/home/$USER/milvus/conf
depends_on:
zookeeper:
condition: service_healthy
etcd:
condition: service_healthy
# Uncomment and configure these services if you want to use external dependencies
# zookeeper:
# image: zookeeper:3.7
# container_name: zookeeper
# ports:
# - "2181:2181"
# etcd:
# image: quay.io/coreos/etcd:v3.5.0
# container_name: etcd
# command:
# - /usr/local/bin/etcd
# - -advertise-client-urls
# - http://0.0.0.0:2379
# - -listen-client-urls
# - http://0.0.0.0:2379
# ports:
# - "2379:2379"
# - "2380:2380"
# 创建配置文件夹和文件
mkdir -p conf
nano conf/server_config.yaml
# 以下是server_config.yaml文件的内容
general:
time_zone: UTC+8
meta_uri: etcd://localhost:2379/milvus
db_config:
primary_path: /home/$USER/milvus/dbs
secondary_path: ""
storage:
type: MinIO
minio:
address: localhost:9000
access_key_id: minioadmin
secret_access_key: minioadmin
bucket_name: milvus_bucket
network:
server_port: 19530
http_port: 19121
# 启动Milvus服务
docker-compose up -d
# 检查服务状态
docker-compose ps
这个脚本展示了如何使用Docker-compose在单机上快速部署Milvus服务。它包括了下载Milvus Docker镜像、配置端口映射、环境变量设置、挂
评论已关闭