简体   繁体   English

我们如何从具有debezium kafka连接器的副本集中的辅助mongodb节点中截取oplog?

[英]How could we tail oplog from a secondary mongodb node in a replica set with debezium kafka connector?

We want to use debezium mongodb kafka source connector against the replica set secondary node rather than primary (at least for the start, to be sure that we are not affecting the main stream functionality in any way). 我们希望将debezium mongodb kafka源连接器用于副本集辅助节点而不是主节点(至少在开始时,以确保我们不会以任何方式影响主流功能)。

Debezium mongodb tutorial says that “the connector always uses the replica set's primary node to tail the oplog” . Debezium mongodb教程说“连接器总是使用副本集的主节点来拖尾oplog” However, it looks like that by setting auto.discovery to false and specifying secondary node in the connector config make the connector to tail oplog from the secondary node just fine. 但是,看起来通过将auto.discovery设置为false并在连接器配置中指定辅助节点使得连接器从辅助节点的尾部oplog就好了。

So the first question – are we right about it (and it's not that debezium connector "under the hood" finds a way to the primary node somehow)? 所以第一个问题 - 我们是否正确(并且不是“引擎盖下的debezium连接器”以某种方式找到通往主节点的方式)?

If, indeed, the oplog is tailed from the secondary node (as we want it to be), are there ways to switch to another secondary node automatically if the original one fails? 实际上,如果oplog从辅助节点(如我们所希望的那样)加尾,那么如果原始节点出现故障,是否有办法自动切换到另一个辅助节点?

Thank you. 谢谢。

The MongoDB connector currently will always connect to the primary node of the replica set. MongoDB连接器当前将始终连接到副本集的主节点。 Could you open a feature request in our JIRA tracker for optionally reading from secondary nodes? 您是否可以在我们的JIRA跟踪器中打开功能请求,以便可选择从辅助节点读取? Any help with implementing it will be welcome of course, too. 当然,任何有关实施它的帮助也会受到欢迎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM