Link Search Menu Expand Document Documentation Menu

documentdb

documentdb 源从 Amazon DocumentDB 集合读取文档。它可以通过导出读取历史数据,并使用 Amazon DocumentDB 变更流保持数据最新。

documentdb 源从 Amazon DocumentDB 读取数据,并将数据放入 Amazon 简单存储服务 (Amazon S3) 存储桶中。然后,其他 OpenSearch Data Prepper 工作器从 S3 存储桶读取数据以处理数据。

用法

以下示例管道使用 documentdb

version: "2"
documentdb-pipeline:
  source:
    documentdb:
      host: "docdb-mycluster.cluster-random.us-west-2.docdb.amazonaws.com"
      port: 27017
      authentication:
        username: ${{aws_secrets:secret:username}}
        password: ${{aws_secrets:secret:password}}
      aws:
        sts_role_arn: "arn:aws:iam::123456789012:role/MyRole"
      s3_bucket: my-bucket
      s3_region: us-west-2
      collections:
        - collection: my-collection
          export: true
          stream: true
      acknowledgments: true

配置

您可以使用以下选项配置 documentdb 源。

选项 必需 类型 描述
host 字符串 Amazon DocumentDB 集群的主机名。
端口 整数 Amazon DocumentDB 集群的端口号。默认为 27017
trust_store_file_path 字符串 包含 Amazon DocumentDB 集群公共证书的信任存储文件的路径。
trust_store_password 字符串 trust_store_file_path 指定的信任存储的密码。
身份验证 身份验证 身份验证配置。有关更多信息,请参阅身份验证部分。
collections 列表 集合配置列表。需要且仅需要一个集合。有关更多信息,请参阅集合部分。
s3_bucket 字符串 用于处理来自 Amazon DocumentDB 事件的 S3 存储桶。
s3_prefix 字符串 可选的 Amazon S3 键前缀。默认情况下,没有键前缀。
s3_region 字符串 S3 存储桶所在的 AWS 区域。
aws AWS AWS 配置。有关更多信息,请参阅aws部分。
id_key 字符串 指定后,Amazon DocumentDB _id 字段将被设置为 id_key 指定的键名。当您需要比保存到接收器的 ObjectId 字符串提供的信息更多时,可以使用此选项。默认情况下,_id 不作为事件的一部分包含。
direct_connection 布尔型 当为 true 时,MongoDB 驱动程序直接连接到指定的 Amazon DocumentDB 服务器,而无需发现并连接到整个副本集。默认为 true
read_preference 字符串 确定如何从 Amazon DocumentDB 读取数据。有关更多信息,请参阅读取偏好模式。默认为 primaryPreferred
disable_s3_read_for_leader 布尔型 当为 true 时,当前领导节点不从 Amazon S3 读取数据。它只读取流。默认为 false
partition_acknowledgment_timeout 持续时间 配置节点持有分区的时长。默认为 2h
确认 布尔型 当设置为 true 时,在事件发送到接收器后,源上启用端到端确认
insecure 布尔型 禁用 TLS。默认为 false。请勿在生产环境中使用此值。
ssl_insecure_disable_verification 布尔型 禁用 TLS 主机名验证。默认为 false。请勿在生产环境中启用此标志。相反,请使用 trust_store_file_path 来验证主机名。

身份验证

以下参数使您能够配置 Amazon DocumentDB 集群的身份验证

选项 必需 类型 描述
username 字符串 与 Amazon DocumentDB 集群进行身份验证时使用的用户名。支持自动刷新。
password 字符串 与 Amazon DocumentDB 集群进行身份验证时使用的密码。支持自动刷新。

collection

以下参数使您能够配置从 Amazon DocumentDB 集群读取的集合

选项 必需 类型 描述
collection 字符串 集合的名称。
export 布尔型 是否包含导出或完整加载。默认为 true
stream 布尔型 是否启用流。默认为 true
partition_count 整数 定义要在 Amazon S3 中创建的分区数量。默认为 100
export_batch_size 整数 默认为 10,000
stream_batch_size 整数 默认为 1,000

aws

以下参数使您能够配置对 Amazon DocumentDB 的访问。

选项 必需 类型 描述
sts_role_arn 字符串 用于向 Amazon 简单队列服务 (Amazon SQS) 和 Amazon S3 发出请求时承担的 AWS 安全令牌服务 (AWS STS) 角色。默认为 null,这会使用标准 SDK 凭证行为
aws_sts_header_overrides 映射 AWS 身份与访问管理 (IAM) 角色为接收器插件承担的标头覆盖映射。
sts_external_id 字符串 当 Data Prepper 承担 STS 角色时使用的外部 STS ID。请参阅 STS AssumeRole API 参考文档中的 ExternalID
剩余 350 字符

有问题?

想贡献力量?