kafka node3 连接异常导致应用无法消费、生产数据

kafka node3 连接异常导致应用无法消费、生产数据,基本的筛查方式全部尝试但是没有效果,查遍全网没有解决办法。确认防火墙关闭也不行,最后先启动防火墙,再关闭,解决问题

报错语句

WARN [Controller id=0, targetBrokerId=0] Connection to node 3 (/192.168.230.133:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

检查方式:

1、查看防火墙是否开启,如果是开启状态则关闭

systemctl stop firewalld    //停止firewalld防火墙
systemctl disable firewalld   //disable防火墙,让它开机不自启
systemctl status firewalld    //查看firewalld是否已经关闭
(active(running))显示防火墙处于激活状态
(inactive(dead))防火墙进程处于未激活状态

如果报错firewalld未启动,则启动FirewallD服务

systemctl start firewalld.service #开启服务
systemctl enable firewalld.service #设置开机启动

防火墙相关命令

防火墙开启
systemctl start firewalld
关闭
systemctl stop firewalld
永久开启,永久关闭
systemctl disable firewalld
systemctl enable firewalld
检查防火墙状态
systemctl status firewalld

2、查看zookeeper进程是否正常

jps|grep QuorumPeerMain

可以尝试重启zookeeper

kill掉QuorumPeerMain进程,然后启动zookeeper

启动zk
$ZK_HOME/bin/zkServer.sh start

3、检查kafka配置

/software/kafka/config/server.properties
broker.id
broker.id=1
每台集群的id不同,1,2,3
listeners,集群ip
listeners=PLAINTEXT://192.168.230.131:9092
log.dirs
log.dirs=/software/kafka/logs-1#日志目录
zookeeper.connect
zookeeper.connect=192.168.230.131:2181,192.168.230.132:2181,192.168.230.133:2181
集群:端口

可以尝试重启kafka

./bin/kafka-server-start.sh config/server.properties

在此期间,启动kafka,然后,telnet测试端口服务,如果不通则证明服务异常

telnet hadoop01 9092

4、以上都没有用的话,可以尝试开启防火墙再关闭

你可能感兴趣的:(hadoop组件部署,kafka,分布式)