跳到主要内容

使用 Docker Compose 或 Helm 配置对象存储

Milvus 默认使用 MinIO 进行对象存储,但也支持使用 Amazon Simple Storage Service (S3) 作为日志和索引文件的持久对象存储。本主题描述如何为 Milvus 配置 S3。如果您对 MinIO 满意,可以跳过本主题。

您可以使用 Docker Compose 或在 K8s 上配置 S3。

使用 Docker Compose 配置 S3

1. 配置 S3

MinIO 与 S3 兼容。要使用 Docker Compose 配置 S3,请在 milvus/configs 路径下的 milvus.yaml 文件中为 minio 部分提供您的值。

minio:
address: <your_s3_endpoint>
port: <your_s3_port>
accessKeyID: <your_s3_access_key_id>
secretAccessKey: <your_s3_secret_access_key>
useSSL: <true/false>
bucketName: "<your_bucket_name>"

更多信息请参见 MinIO/S3 配置

2. 优化 docker-compose.yaml

您还需要在 docker-compose.yaml 中移除 milvus 服务的 MINIO_ADDRESS 环境变量。默认情况下,milvus 将使用本地 minio 而不是外部 S3。

3. 运行 Milvus

运行以下命令启动使用 S3 配置的 Milvus。

docker compose up
Configurations only take effect after Milvus starts. See Start Milvus for more information.

在 K8s 上配置 S3

对于 K8s 上的 Milvus 集群,您可以在启动 Milvus 的同一命令中配置 S3。或者,您可以在启动 Milvus 之前使用 milvus-helm 仓库中 /charts/milvus 路径下的 values.yml 文件配置 S3。

下表列出了在 YAML 文件中配置 S3 的键。

KeyDescriptionValue
minio.enabledEnables or disables MinIO.true/false
externalS3.enabledEnables or disables S3.true/false
externalS3.hostThe endpoint to access S3.
externalS3.portThe port to access S3.
externalS3.rootPathThe root path of the S3 storage.An emtpy string by default.
externalS3.accessKeyThe access key ID for S3.
externalS3.secretKeyThe secret access key for S3.
externalS3.bucketNameThe name of the S3 bucket.
externalS3.useSSLWhether to use SSL when connectingThe values defaults to false

Using the YAML file

  1. Configure the minio section in the values.yaml file.
minio:
enabled: false
  1. Configure the externalS3 section using your values in the values.yaml file.
externalS3:
enabled: true
host: "<your_s3_endpoint>"
port: "<your_s3_port>"
accessKey: "<your_s3_access_key_id>"
secretKey: "<your_s3_secret_key>"
useSSL: <true/false>
bucketName: "<your_bucket_name>"
  1. After configuring the preceding sections and saving the values.yaml file, run the following command to install Milvus that uses the S3 configurations.
helm install <your_release_name> milvus/milvus -f values.yaml

Using a command

To install Milvus and configure S3, run the following command using your values.

helm install <your_release_name> milvus/milvus --set cluster.enabled=true  --set minio.enabled=false --set externalS3.enabled=true --set externalS3.host=<your_s3_endpoint> --set externalS3.port=<your_s3_port> --set externalS3.accessKey=<your_s3_access_key_id> --set externalS3.secretKey=<your_s3_secret_key> --set externalS3.bucketName=<your_bucket_name>

What's next

Learn how to configure other Milvus dependencies with Docker Compose or Helm: