我的kafka版本是10.2.1.0客户端和服务器,在zookeeper日志中没有错误,kafka服务器日志没有错误,只在客户端我收到错误而没有发布和订阅消息。
以下是追踪:
[2017-07-17 00:02:09,577] DEBUG Set SASL client state to INITIAL
(org.apache.kafka.common.security.authenticator.SaslClientAuthenticator)
[2017-07-17 00:02:09,578] DEBUG Set SASL client state to INTERMEDIATE
(org.apache.kafka.common.security.authenticator.SaslClientAuthenticator)
[2017-07-17 00:02:09,578] DEBUG Connection with some_ip disconnected
(org.apache.kafka.common.network.Selector)
java.io.EOFException
at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:83)
at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:71)
at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.receiveResponseOrToken(SaslClientAuthenticator.java:242)
at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.authenticate(SaslClientAuthenticator.java:185)
at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:71)
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:350)
at org.apache.kafka.common.network.Selector.poll(Selector.java:303)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:349)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:225)
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:126)
at java.lang.Thread.run(Thread.java:745)
这是我的制作人资产:
security.protocol=SASL_PLAINTEXT
sasl.mechanism=PLAIN
bootstrap.servers=some_ip:9092
compression.type=none
这是我的服务器属性:
sasl.enabled.mechanisms=PLAINsecurity.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
authorizer.class.name=kafka.security.auth.SimpleAclAuthorizer
allow.everyone.if.no.acl.found=true
auto.create.topics.enable=true
broker.id=0
listeners=SASL_PLAINTEXT://some_ip:9092
advertised.listeners=SASL_PLAINTEXT://some_ip:9092
num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
advertised.host.name=somei_ip
num.partitions=1
num.recovery.threads.per.data.dir=1
log.flush.interval.messages=30000000
log.flush.interval.ms=1800000
log.retention.minutes=30
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
delete.topic.enable=true
zookeeper.connect=some_ip:2181
zookeeper.connection.timeout.ms=1000000
super.users=User:admin
服务器jaas conf
KafkaServer {
org.kafka.security.KafkaLoginModule required
username="admin"
password="admin-secret"
user_admin="admin_secret"
user_kafka="kafka_secret";
};
客户jaas conf
KafkaClient {
org.kafka.security.KafkaLoginModule required
username="admin"
password="admin-secret";
};
KafkaLoginModule它是自定义LoginModule,但它与PlainLoginModule相同,只是从PlainLoginModule复制了所有内容