我有3个Kafka集群,我在其他集群中复制了一个主题。第一类主题“测试”
群集2 test.replica ..我在集群3中复制了这个主题,但是当我将数据发送到主题"test“时,我可以从主题"test.replica”中读取数据。主题test.replica.replica似乎是空的
群集3 test.replica.replica
连接器
{
"name":"test-z1-z2",
"config":{
"connector.class":"io.confluent.connect.replicator.ReplicatorSourceConnector",
"tasks.max":"4",
"key.converter":"io.confluent.connect.replicator.util.ByteArrayConverter",
"value.converter":"io.confluent.connect.replicator.util.ByteArrayConverter",
"src.kafka.bootstrap.servers":"localhost:9092",
"src.zookeeper.connect":"localhost:2181",
"dest.zookeeper.connect":"localhost:2182",
"topic.whitelist":"test",
"topic.rename.format":"test.replica",
"confluent.license":""
}
}
{
"name":"test-z2-z3",
"config":{
"connector.class":"io.confluent.connect.replicator.ReplicatorSourceConnector",
"tasks.max":"4",
"key.converter":"io.confluent.connect.replicator.util.ByteArrayConverter",
"value.converter":"io.confluent.connect.replicator.util.ByteArrayConverter",
"src.kafka.bootstrap.servers":"localhost:9093",
"src.zookeeper.connect":"localhost:2182",
"dest.zookeeper.connect":"localhost:2183",
"topic.whitelist":"test.replica",
"topic.rename.format":"test.replica.replica",
"confluent.license":""
}
}
群集1
[root@localhost bin]# ./kafka-topics --list --zookeeper localhost:2181
__confluent.support.metrics
__consumer_offsets
__consumer_timestamps
test群集2
[root@localhost bin]# ./kafka-topics --list --zookeeper localhost:2182
__confluent.support.metrics
__consumer_offsets
test.replica
[root@localhost bin]#
[root@localhost bin]# ./kafka-topics --list --zookeeper localhost:2183
__confluent.support.metrics
__consumer_offsets
test.replica.replica生产数据
[root@localhost bin]# seq 10 | ./kafka-console-producer --broker-list localhost:9092 --topic test
>>>>>>>>>>>使用复制副本
[root@localhost bin]# ./kafka-console-consumer --bootstrap-server localhost:9093 --topic test.replica
1
2
3
4
5
6
7
8
9
10正在尝试其他复本
[root@localhost bin]# ./kafka-console-consumer --bootstrap-server localhost:9094 --topic test.replica.replica
(no Data)我希望将数据发送到一个集群,然后从那里跨其他集群再次复制数据。
发布于 2019-02-08 06:55:29
复制的数据可能已经到达代理,而您指向的是最新的偏移量。
您可以添加要从起始偏移量消费的--from-beginning。
真正的检查是使用OffsetShell来查看主题的实际偏移量。此外,目标主题已正确创建,因此复制器至少在该部分上工作。
也不清楚您的连接器配置是否属于同一Connect集群。您是否在不同的端口上运行connect-disributed,并使用不同的bootstrap.servers?
https://stackoverflow.com/questions/54580147
复制相似问题