Kafka mirror

16 篇文章 1 订阅
准备两个Kafka集群 (default | loganalysis)

在这里插入图片描述

在这里插入图片描述

配置文件
### loganalysis kafka-0 ###
root@kafka-0:/etc/kafka# ls
connect-console-sink.properties    connect-file-sink.properties    connect-standalone.properties  log4j.properties     server.properties           tools-log4j.properties
connect-console-source.properties  connect-file-source.properties  consumer.properties            producer.properties  source-consumer.properties  trogdor.conf
connect-distributed.properties     connect-log4j.properties        kafka.properties               secrets              target-producer.properties  zookeeper.properties

### 数据源 Kafka ###

root@kafka-0:/etc/kafka# cat source-consumer.properties
bootstrap.servers=kafka-headless:9092
zookeeper.connect=kafka-zookeeper-headless:2181
zookeeper.connection.timeout.ms=1000000
group.id=mirror-maker-group-test
message.max.bytes=7000000
fetch.message.max.bytes=7500000
max.partition.fetch.bytes=7500000
replica.fetch.max.bytes=7500000

### 目标 Kafka ###

root@kafka-0:/etc/kafka# cat target-producer.properties
bootstrap.servers=loganalysis-kafka-headless.default:9092
message.max.bytes=7000000
fetch.message.max.bytes=7500000
max.partition.fetch.bytes=7500000
replica.fetch.max.bytes=7500000
root@kafka-0:/etc/kafka# 




kafka-mirror
root@kafka-2:/# kafka-mirror-maker
Continuously copy data between two Kafka clusters.
Option                                   Description
------                                   -----------
--abort.on.send.failure <String: Stop    Configure the mirror maker to exit on
  the entire mirror maker when a send      a failed send. (default: true)
  failure occurs>
--consumer.config <String: config file>  Embedded consumer config for consuming
                                           from the source cluster.
--consumer.rebalance.listener <String:   The consumer rebalance listener to use
  A custom rebalance listener of type      for mirror maker consumer.
  ConsumerRebalanceListener>
--help                                   Print this message.
--message.handler <String: A custom      Message handler which will process
  message handler of type                  every record in-between consumer and
  MirrorMakerMessageHandler>               producer.
--message.handler.args <String:          Arguments used by custom message
  Arguments passed to message handler      handler for mirror maker.
  constructor.>
--new.consumer                           DEPRECATED Use new consumer in mirror
                                           maker (this is the default so this
                                           option will be removed in a future
                                           version).
--num.streams <Integer: Number of        Number of consumption streams.
  threads>                                 (default: 1)
--offset.commit.interval.ms <Integer:    Offset commit interval in ms.
  offset commit interval in                (default: 60000)
  millisecond>
--producer.config <String: config file>  Embedded producer config.
--rebalance.listener.args <String:       Arguments used by custom rebalance
  Arguments passed to custom rebalance     listener for mirror maker consumer.
  listener constructor as a string.>
--whitelist <String: Java regex          Whitelist of topics to mirror.
  (String)>
root@kafka-2:/#

root@kafka-0:/etc/kafka# kafka-mirror-maker --consumer.config source-consumer.properties --producer.config target-producer.properties  --whitelist test

在这里插入图片描述

kafka集群1

在这里插入图片描述

kafka集群2

在这里插入图片描述

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值