> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 对象存储配置

> Discover AutoMQ's cloud-native Kafka distribution utilizing object storage services from major cloud providers. Achieve optimal scalability and cost efficiency.

AutoMQ 是基于云原生理念重新设计的 Kafka 发行版，充分利用了对象存储云服务。可以基于各主流云厂商对象存储或者存储软件构建存储层。

### 对象存储 URI 构建

URI 是 AutoMQ 用于表示写入对象存储的唯一标识，遵循一定规范来屏蔽不通对象存储服务商的差异。 URI 的组成分为： `s3` 代表具体的协议； `xxx_bucket` 代表具体的 bucket； `region` 、 `endpoint` 用于不同厂商定位 bucket的辅助参数。

最终替换 [Linux 主机部署多节点集群▸](/zh/automq/deployment/deploy-multi-nodes-cluster-on-linux) 配置模版中 `global.config` 、 `global.envs` 中的变量生成最终配置文件。

| 提供商<br />    | 类型<br />   | URI示例<br />                                                                                                                                                                                                                              |
| ------------ | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| AWS<br />    | 云商<br />   | s3://xxx\_bucket?region=us-east-1<br />                                                                                                                                                                                                  |
| AWS-CN<br /> | 云商<br />   | s3://xxx\_bucket?region=cn-northwest-1\&endpoint=[https://s3.amazonaws.com.cn](https://s3.amazonaws.com.cn)<br />                                                                                                                        |
| ALIYUN<br /> | 云商<br />   | s3://xxx\_bucket?region=oss-cn-shanghai\&endpoint=[https://oss-cn-shanghai.aliyuncs.com](https://oss-cn-shanghai.aliyuncs.com)<br />                                                                                                     |
| OCI<br />    | 云商<br />   | s3://xxx\_bucket?region=us-ashburn-1\&endpoint=[https://xxx\_namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com\&pathStyle=true](https://xxx_namespace.compat.objectstorage.us-ashburn-1.oraclecloud.com\&pathStyle=true)<br /> |
| CEPH<br />   | 存储软件<br /> | s3://xxx\_bucket?region=us-west-2\&endpoint=[http://127.0.0.1:80](http://127.0.0.1:80)<br />                                                                                                                                             |
| CubeFS<br /> | 存储软件<br /> | s3://xxx\_bucket?region=us-west-2\&endpoint=[http://10.1.0.240:17410](http://10.1.0.240:17410)<br />                                                                                                                                     |
| MinIO<br />  | 存储软件<br /> | s3://xxx\_bucket?region=us-west-2\&pathStyle=true\&endpoint=[http://10.1.0.240:9000](http://10.1.0.240:9000)<br />                                                                                                                       |

<Tip>
  如果配置  `s3.wal.path`  还可在 URI 上按需增加  `batchInterval` 、 `maxBytesInBatch`  参数项，分别控制提交的间隔时间和一批最大字节数，默认  `batchInterval=250`  毫秒， `maxBytesInBatch=8388608`  字节。
</Tip>

### 云上对象存储配置

<Tabs>
  <Tab title="AWS">
    建议参考 [Policy](https://docs.aws.amazon.com/zh_cn/AmazonS3/latest/userguide/access-policy-language-overview.html) 和 [Endpoint & Region](https://docs.aws.amazon.com/zh_cn/general/latest/gr/s3.html) 链接，查阅 AWS 文档，获取更多 IAM 和 S3 的详细配置说明。

    <Info>
      生产环境中，建议 IAM Policy 授权范围精确到具体的 Bucket，以避免预期之外的授权。
    </Info>

    ```json theme={null}

    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Sid": "VisualEditor0",
                "Effect": "Allow",
                "Action": [
                    "s3:PutObject",
                    "s3:GetObject",
                    "s3:AbortMultipartUpload",
                    "s3:DeleteObject",
                    "s3:ListBucket"
                ],
                "Resource": [
                    "*"
                ]
            }
        ]
    }

    ```
  </Tab>

  <Tab title="阿里云">
    建议参考 [Policy](https://www.alibabacloud.com/help/zh/oss/user-guide/tutorial-use-ram-policies-to-control-access-to-oss) 和 [Endpoint & Region](https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints) 链接，查阅阿里云文档，获取更多 RAM 和 OSS 的详细配置说明。

    <Info>
      生产环境中，建议 RAM Policy 授权范围精确到具体的 Bucket，以避免预期之外的授权。
    </Info>

    ```json theme={null}

    {
        "Version": "1",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": [
                    "oss:PutObject",
                    "oss:AbortMultipartUpload",
                    "oss:GetObject",
                    "oss:DeleteObject"
                ],
                "Resource": [
                    "acs:oss:*:*:automq-data",
                    "acs:oss:*:*:automq-ops"
                ]
            }
        ]
    }

    ```
  </Tab>

  <Tab title="GCP">
    由于 AWS S3 SDK 并不能直接访问 GCP Cloud Storage ，因此 AutoMQ Open Source 无法直接基于 Google Cloud Storage 运行。如果您需要在 GCP 上运行 AutoMQ，建议[联系 AutoMQ 团队](https://www.automq.com/contact)获取支持，AutoMQ BYOC 兼容 GCP Cloud Storage。
  </Tab>

  <Tab title="Azure">
    [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) 与 AWS S3 网络协议不兼容，因此 AutoMQ 开源版无法直接基于 Azure Blob Storage 运行。用户可通过如下方式处理：

    * 自行搭建 S3 Proxy，实现访问 Blob Storage。

    * [联系 AutoMQ 团队](https://www.automq.com/contact)获取支持，AutoMQ BYOC 兼容 Azure Blob Storage。
  </Tab>

  <Tab title="OCI">
    建议查阅官方网站以获取更多详细信息。

    建议参考 [Policy](https://docs.oracle.com/en-us/iaas/Content/Security/Reference/objectstorage_security.htm#iam-policies) 、[Detailed Policy](https://docs.oracle.com/en-us/iaas/Content/Identity/Reference/objectstoragepolicyreference.htm#Details) 和 [Endpoint & Region](https://docs.oracle.com/en-us/iaas/Content/Object/Tasks/s3compatibleapi.htm#usingAPI) 链接，查阅 OCI 文档，获取更多 IAM 和  Object Storage 的详细配置说明。

    ```text theme={null}
    Allow group 'AutoMQ PoC' to manage objects in tenancy where any {target.bucket.name='automq-data', target.bucket.name='automq-ops'}
    ```
  </Tab>

  <Tab title="其他云厂商">
    如需在其他公共云环境部署 AutoMQ，需要确认云厂商提供的对象存储服务是否兼容 S3 协议。您可以通过[此处表单](https://www.automq.com/contact)联系 AutoMQ 团队获取必要的协助和最佳实践。
  </Tab>
</Tabs>

### 存储软件配置

如果您期望在私有数据中心部署 AutoMQ，也可以通过 MinIO、Ceph、CubeFS 等支持 S3 协议的存储软件提供对象存储服务。
