关于一次部署kafka出现异常(key=’null’)的记录,环境为阿里云服务器 先贴异常: org.springframework.kafka.support.LoggingProducerListener [76] - Exception thrown when sending a message with key=’null’ and payload=’2017-11-14 15:36:53|iZbp1115ogry6vyp418vplZ|192.168.3.1|{“token”:”708037c594e04850bfd48f82fa862dd…’ to topic kafka启动日志报错如下
Could not initialize class kafka .network .RequestChannel
broker.id =0 # 1,2
delete.topic .enable =true
auto.create .topics .enable =false
listeners=PLAINTEXT://192.168 .4 .1 :9092
advertised.listeners =PLAINTEXT://192.168 .4 .1 :9092
num.network .threads =3
num.io .threads =6
socket.send .buffer .bytes =102400
socket.receive .buffer .bytes =102400
socket.request .max .bytes =104857600
log.dirs =/opt/kafka-logs
num.partitions =6
num.recovery .threads .per .data .dir =1
default.replication .factor =2
offsets.topic .replication .factor =1
transaction.state .log .replication .factor =1
transaction.state .log .min .isr =1
log.retention .hours =168
log.segment .bytes =1073741824
log.retention .check .interval .ms =300000
zookeeper.connect =192.168 .4 .1 :2181 ,192.168 .4 .2 :2181 ,192.168 .4 .3 :2181
zookeeper.connection .timeout .ms =6000
group.initial .rebalance .delay .ms =0
到生产环境总是有一台机网络有问题,经过查看日志,发现该台机没有做主机名ip映射,坑啊: 然后改/etc/hosts文件加上以下一段,一切正常,在此做一下记录:
127.0.0.1 iZbp1iazbfd949z016r62zZ