使用 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 的键。
Key | Description | Value |
---|---|---|
minio.enabled | Enables or disables MinIO. | true /false |
externalS3.enabled | Enables or disables S3. | true /false |
externalS3.host | The endpoint to access S3. | |
externalS3.port | The port to access S3. | |
externalS3.rootPath | The root path of the S3 storage. | An emtpy string by default. |
externalS3.accessKey | The access key ID for S3. | |
externalS3.secretKey | The secret access key for S3. | |
externalS3.bucketName | The name of the S3 bucket. | |
externalS3.useSSL | Whether to use SSL when connecting | The values defaults to false |
Using the YAML file
- Configure the
minio
section in thevalues.yaml
file.
minio:
enabled: false
- Configure the
externalS3
section using your values in thevalues.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>"
- 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: