Kafka镜像工具异地同步

1.创建mirror-consumer.properties

bootstrap.servers=192.168.43.209:9092(源服务器地址)

group.id=sce

若用了身份认证,添加如下

security.protocol=SASL_PLAINTEXT

sasl.mechanism=PLAIN

partition.assignment.strategy=org.apache.kafka.clients.consumer.RoundRobinAssignor

2.创建mirror-producer.properties

bootstrap.servers=192.168.43.211:9092(目标服务器地址)

若用了身份认证,添加如下

security.protocol=SASL_PLAINTEXT

sasl.mechanism=PLAIN

3.修改kafka-mirror-maker.sh(若用了身份认证)

添加如下

if [ "x$KAFKA_OPTS" ]; then

    export KAFKA_OPTS="-Djava.security.auth.login.config=/home/wucan/msgbus/kafka_2.11-1.0.0/config/kafka_client_jaas.conf"

fi


4.在目标服务器上运行

bin/kafka-mirror-maker.sh --consumer.config ./config/mirror-consumer.properties --producer.config ./config/mirror-producer.properties --whitelist ".*"

你可能感兴趣的:(Kafka镜像工具异地同步)