使用Fluentd将数据传输到DocumentDB



我可以使用Fluentd将数据传输到建立在AWS EC2上的mongoDB,但我不能将数据传输到DocumentDB,这是一个与mongoDB兼容的托管服务。

td-agent.conf用于传输保存在/var/log/test/bulk/中的json文件。mongoDB。

<source>
@type tail
path /var/log/test/bulk/*
tag bulk.*
format json
time_key time
time_format '%F %T.%N %z %Z'
pos_file /var/log/test/run/log-json.pos
read_from_head true
refresh_interval 5s
</source>
<match bulk.**>
@type record_reformer
tag test.${tag_parts[-3]}.${tag_parts[-2]}
</match>
<match test.**>
@type copy
<store>
@type forest
subtype mongo_replset
<template>
host hostname1:27017,hostname2:27017,hostname3:27017
replica_set rs0 
database ${tag_parts[-2]}
collection ${tag_parts[-1]}
user ********
password ********
replace_dot_in_key_with __dot__
<buffer>
@type file
path /var/log/test/buffer-mongo/${tag_parts[-2..-1]}
chunk_limit_size 8m
queued_chunks_limit_size 64
flush_interval 1s
</buffer>
</template>
</store>
</match>

当传输到DocumentDB时,我将上面配置文件中的主机更改为集群端点,但是发生了以下错误:

[warn]: #0 failed to flush the buffer. retry_time=0 next_retry_seconds=2021-09-14 10:26:56 +0900 chunk="5cbea78155b58ec0810e9fde94aa2355" error_class=Mongo::Error::NoServerAvailable error="No server is available matching preference: #<Mongo::ServerSelector::Primary:0x70233136498300 tag_sets=[] max_staleness=nil> using server_selection_timeout=30 and local_threshold=0.015"

由于TLS在DocumentDB中启用,我想知道我是否需要指定rds-combined-ca-bundle。启用TLS。我想是的,但我不知道该怎么做。(当我测试在Python中使用链接写入DocumentDB时,当禁用TLS时发生上述错误。)

你能告诉我如何写数据到启用TLS的DocumentDB吗?

Amazon DocumentDB集群部署在Amazon VPC内。它们可以被部署在同一个Amazon VPC中的Amazon EC2实例或其他AWS服务直接访问。客户端应用运行在与DocumentDB集群相同的VPC和安全组中?

最新更新