Skip to content

使用docker方式部署milvus standalone模式,如何修改minio为外部S3? #273

Description

@bozai111

目前尝试了两种,修改minio为外部存储的方案,均失败了,数据都写入到了/var/lib/milvus目录下

第一种方式:
1、修改user.yaml

cat << EOF > user.yaml
# Extra config to override default milvus.yaml
minio:
  address: xxxx-xx-xx.xxxx.xx:90
  port: 90
  bucketName: xxxx-xxx-xxx
  rootPath: milvus/project-in-test
  useSSL: false
  region: in
  cloudProvider: gcp
  accessKeyID: xxxx
  secretAccessKey: xxxxxx
  storageType: s3

common:
  storageType: s3
EOF

2、重启milvus
bash standalone_embed.sh restart

可以观察到容器内的user.yaml内确实也生效了,但是文件还是写入到了本地/var/lib/milvus目录下

第二种方式:
1、cp容器内的milvus.yaml文件,修改minio部分,注释掉localStorage部分

root@319ced9f08e6:/milvus/configs# cat milvus.yaml |grep -v '#'|grep -w minio: -C 10
  data:
  auth:

metastore:
  snapshot:

tikv:
  ssl:

minio:
  address: xxx-xx-xx.xxx.xx:90
  port: 90 
  accessKeyID: xxxxx
  secretAccessKey: xxxxx
  ssl:
  bucketName: xxx-xxx-2025
  rootPath: milvus/project-in-test
  useIAM: false
  cloudProvider: gcp
  gcpCredentialJSON:

#localStorage:
  # Local path to where vector data are stored during a search or a query to avoid repetitve access to MinIO or S3 service.
  # Caution: Changing this parameter after using Milvus for a period of time will affect your access to old data.
  # It is recommended to change this parameter before starting Milvus for the first time.
  #path: /var/lib/milvus/data/

2、修改standalone_embed.sh脚本,添加milvus.yaml映射

sudo docker run -d \
      --name milvus-standalone \
      --security-opt seccomp:unconfined \
      -e ETCD_USE_EMBED=true \
      -e ETCD_DATA_DIR=/var/lib/milvus/etcd \
      -e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \
      -e COMMON_STORAGETYPE=local \
      -e DEPLOY_MODE=STANDALONE \
      -v $(pwd)/volumes/milvus:/var/lib/milvus \
      -v $(pwd)/embedEtcd.yaml:/milvus/configs/embedEtcd.yaml \
      -v $(pwd)/user.yaml:/milvus/configs/user.yaml \
      **-v $(pwd)/milvus.yaml:/milvus/configs/milvus.yaml \**
      -p 19530:19530 \
      -p 9091:9091 \
      -p 2379:2379 \
      --health-cmd="curl -f http://localhost:9091/healthz" \
      --health-interval=30s \
      --health-start-period=90s \
      --health-timeout=20s \
      --health-retries=3 \
      milvusdb/milvus:v2.6.7 \
      milvus run standalone  1> /dev/null

3、启动milvus
bash standalone_embed.sh restart

4、观察数据文件依然落到了/var/lib/milvus下面

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions