最近想尝试下对Kafka做一个简单的认证,增加了用户名密码的验证,程序里加上用户名密码后已经可以进行生产和消费了,但是每次第一次消费或者生产的时候就需要很长时间,大概几十秒,后面就正常了,但是Kafka服务日志一直在报错,想问下这个情况是哪里出了问题?
先贴上Kafka的配置
server.properties 这个文件相比原来没有认证的配置就多了这几句
listeners=SASL_PLAINTEXT://192.168.3.247:19092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAINkafka_server_jaas.conf 这个是新增文件
KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="admin"
password="xxxxxx"
user_admin="xxxxxx";
};
最后就是kafka的启动脚本加了一句 :
export KAFKA_OPTS="-Djava.security.auth.login.config=/home/ubuntu/HardDisk/kafka/kafka_2.12-2.8.0/config/kafka_server_jaas.conf"
其他的文件都没动,zookeeper相关配置也没改。
写了个Demo,第一次生产和消费拉取很慢,甚至超时了 (实例化生产者对象后不释放),后面恢复正常,但是见到过跑了一段时间又超时的情况,怀疑自己还是没有配置好。
消费者已订阅.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
2024-08-14 14:49:11,826 Thread-1 ERROR No appender named console was configured
准备发送topic到kafka
onCompletion出错:Topic test3 not present in metadata after 60000 ms.
准备发送topic到kafka
produce | offset:1724, topic:test3 ,耗时:49391
准备发送topic到kafka
produce | offset:1725, topic:test3 ,耗时:111
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
produce | offset:1726, topic:test3 ,耗时:26006
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
onCompletion出错:Disconnected from node 0
onCompletion出错:Disconnected from node 0
onCompletion出错:Disconnected from node 0
onCompletion出错:Disconnected from node 0
onCompletion出错:Disconnected from node 0
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
准备发送topic到kafka
produce | offset:1729, topic:test3 ,耗时:38007
produce | offset:1730, topic:test3 ,耗时:35007
produce | offset:1731, topic:test3 ,耗时:32012
produce | offset:1732, topic:test3 ,耗时:28999
produce | offset:1733, topic:test3 ,耗时:25992
produce | offset:1734, topic:test3 ,耗时:22988
produce | offset:1735, topic:test3 ,耗时:19986
produce | offset:1736, topic:test3 ,耗时:16975
produce | offset:1737, topic:test3 ,耗时:13971
produce | offset:1738, topic:test3 ,耗时:10961
produce | offset:1739, topic:test3 ,耗时:7954
produce | offset:1740, topic:test3 ,耗时:4951
produce | offset:1741, topic:test3 ,耗时:1947
consumer1 | offset = 1724, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":2,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:50:14.951","sctdcgzzt":255}
consumer1 | offset = 1725, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":3,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:07.225","sctdcgzzt":255}
consumer1 | offset = 1726, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":4,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:10.234","sctdcgzzt":255}
consumer1 | offset = 1727, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":5,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:13.240","sctdcgzzt":255}
consumer1 | offset = 1728, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":6,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:16.247","sctdcgzzt":255}
consumer1 | offset = 1729, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":10,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:28.265","sctdcgzzt":255}
consumer1 | offset = 1730, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":11,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:31.268","sctdcgzzt":255}
consumer1 | offset = 1731, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":12,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:34.269","sctdcgzzt":255}
consumer1 | offset = 1732, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":13,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:37.284","sctdcgzzt":255}
consumer1 | offset = 1733, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":14,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:40.291","sctdcgzzt":255}
consumer1 | offset = 1734, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":15,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:43.297","sctdcgzzt":255}
consumer1 | offset = 1735, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":16,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:46.299","sctdcgzzt":255}
consumer1 | offset = 1736, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":17,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:49.311","sctdcgzzt":255}
consumer1 | offset = 1737, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":18,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:52.315","sctdcgzzt":255}
consumer1 | offset = 1738, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":19,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:55.325","sctdcgzzt":255}
consumer1 | offset = 1739, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":20,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:51:58.333","sctdcgzzt":255}
consumer1 | offset = 1740, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":21,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:01.337","sctdcgzzt":255}
consumer1 | offset = 1741, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":22,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:04.341","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1742, topic:test3 ,耗时:112
consumer1 | offset = 1742, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":23,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:07.343","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1743, topic:test3 ,耗时:110
consumer1 | offset = 1743, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":24,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:10.354","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1744, topic:test3 ,耗时:110
consumer1 | offset = 1744, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":25,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:13.359","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1745, topic:test3 ,耗时:110
consumer1 | offset = 1745, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":26,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:16.363","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1746, topic:test3 ,耗时:111
consumer1 | offset = 1746, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":27,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:19.370","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1747, topic:test3 ,耗时:111
consumer1 | offset = 1747, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":28,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:22.375","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1748, topic:test3 ,耗时:111
consumer1 | offset = 1748, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":29,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:25.384","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1749, topic:test3 ,耗时:110
consumer1 | offset = 1749, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":30,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:28.398","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1750, topic:test3 ,耗时:111
consumer1 | offset = 1750, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":31,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:31.412","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1751, topic:test3 ,耗时:114
consumer1 | offset = 1751, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":32,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:34.421","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1752, topic:test3 ,耗时:114
consumer1 | offset = 1752, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":33,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:37.432","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1753, topic:test3 ,耗时:110
consumer1 | offset = 1753, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":34,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:40.437","sctdcgzzt":255}
准备发送topic到kafka
produce | offset:1754, topic:test3 ,耗时:112
consumer1 | offset = 1754, topic = {"btsj":"07:00","rjbbh":"220924","sbxh":"HZ199T","btyl":79,"dqsj":"14:02","sctdbgzzt":255,"wgsj":1681279360382,"bthyzt":0,"hyyl":71,"sctdbyl":65,"sctdcyl":50,"hysj":"20:30","sctdayl":65,"sctddyl":50,"kgjzt":1,"sbddgzzt":255,"sctdagzzt":255,"wgbh":"05225087","yykzqbh":"230412","index":35,"sctddgzzt":255,"sctddyy":3,"sctdayy":0,"sctdcyy":2,"yjbbh":"VMM2V1","sctdbyy":1,"cs":255,"njyzt":255,"srtd2zt":1,"yblc":"0","srtd1zt":1,"srtd4zt":-1,"topic":"voice_controller","jyzt":0,"srtd3zt":0,"time":"2024-08-14 14:52:43.440","sctdcgzzt":255}
Process finished with exit code 130
kafkaServer.out这个文件疯狂的记录这种日志
[2024-08-14 14:47:22,666] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,666] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,667] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,667] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,717] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,717] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,717] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,718] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,769] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,819] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,820] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,820] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,870] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
[2024-08-14 14:47:22,870] INFO [SocketServer listenerType=ZK_BROKER, nodeId=0] Failed authentication with /192.168.3.247 (Unexpected Kafka request of type METADATA during SASL handshake.) (org.apache.kafka.common.network.Selector)
帮忙分析下可能是哪里的问题?
zk和kafka之间的认证失败了,检查下kafka和zk之间的认证。
你要把这个用户保存到zk里面去
你的答案