![](/img/trans.png)
[英]Error during creation of Kafka Source with SASL_SSL: No such File
[英]Get 'INFO [SocketServer brokerId=___] Failed authentication with /server_ip (Unexpected Kafka request of type METADATA during SASL handshake)'
當我嘗試使用 kafka-mirror-maker.sh 時遇到此問題
通過運行此命令:
bin/kafka-mirror-maker.sh --consumer.config config/consumer.properties --producer.config config/producer.properties --whitelist "topicName"
這是我的配置文件:
1.producer.properties
bootstrap.servers=target_server_cluster_ips_with_kafka_port
acks=-1
linger.ms=100
batch.size=16384
retries=3
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="username" password="password";
compression.type=none
2.consumer.properties
bootstrap.servers=source_server_cluster_ips_with_kafka_port
enable.auto.commit=true
auto.offset.reset=earliest
auto.commit.interval.ms=1000
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="username" password="password";
group.id=mirror-maker-group
Apache 卡夫卡版本信息:kafka_2.13-2.7.2
參考鏈接: https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0
這不是問題的答案,但它可以解決這個問題。
后來我以另一種方式更改了我的配置,它可以工作。
我正在做單向 kafka 集群同步,如果您需要雙向同步,您可以簡單地將 T->S 設置為 true。
請注意,這僅適用於mirror maker 2,這意味着您的kafka 版本應該是kafka 2.4.0 或更高版本。
我使用命令:
nohup bin/connect-mirror-maker.sh config/mirror-maker.properties > mirrormaker.nohup &
我的配置文件:
clusters = S,T
S.bootstrap.servers = source_ip:port
T.bootstrap.servers = target_ip:port
topics = topic1,topic2
groups = .*
emit.checkpoints.interval.seconds = 10
S->T.enabled = true
T->S.enabled = false
S.offset.storage.topic = S-mirrormaker2-offsets-topic
T.offset.storage.topic = T-mirrormaker2-offsets-topic
security.protocol=your_protocol
sasl.mechanism=your_choice
sasl.jaas.config=your login module with username and password
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.