在KRB5KDC的log里有如下两条认证信息,不知道是对还不是不对:
Jan 21 20:01:43 rh74v1.sample1.com krb5kdc46018: AS_REQ (4 etypes {18 17 16 23}) 192.168.137.98: ISSUE: authtime 1516536103, etypes {rep=18 tkt=18 ses=18}, kafka/192.168.137.98@EXAMPLE.COM for krbtgt/EXAMPLE.COM@EXAMPLE.COM
Jan 21 20:01:43 rh74v1.sample1.com krb5kdc46018: TGS_REQ (4 etypes {18 17 16 23}) 192.168.137.98: ISSUE: authtime 1516536103, etypes {rep=18 tkt=18 ses=18}, kafka/192.168.137.98@EXAMPLE.COM for zookeeper/192.168.137.98@EXAMPLE.COM
https://www.orchome.com/171说的是kafka使用SSL加密和认证,我的测试是用SASL/Kerberos认证,没没用SSL。
从zookeeper和Kafka的log可以看到Session已经建立了,但zookeeper之后发了个这个信息:
2018-01-21 20:01:43,523 [myid:] - ERROR [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@1055] - cnxn.saslServer is null: cnxn object did not initialize its saslServer properly.
Kafka出信息:
[2018-01-21 20:01:43,532] ERROR SASL authentication failed using login context 'Client'. (org.apache.zookeeper.client.ZooKeeperSaslClient)
中断Session,启动失败。。
https://www.orchome.com/171
排查各类日志中的细节异常。是否每一环境都是正确的。往往某个环境出错 而导致全盘出错。
例如:
一旦你启动broker,你应该就能在server.log看到
with addresses: PLAINTEXT -> EndPoint(192.168.64.1,9092,PLAINTEXT),SSL -> EndPoint(192.168.64.1,9093,SSL)
用以下命令,快速验证服务器的keystore和truststore设置是否正确:
openssl s_client -debug -connect localhost:9093 -tls1
(注意: TLSv1 应列出 ssl.enabled.protocols)
在命令的输出中,你应该能看到服务器的证书:
-----BEGIN CERTIFICATE-----
{variable sized random bytes}
-----END CERTIFICATE-----
subject=/C=US/ST=CA/L=Santa Clara/O=org/OU=org/CN=Sriharsha Chintalapani
issuer=/C=US/ST=CA/L=Santa Clara/O=org/OU=org/CN=kafka/emailAddress=test@test.com
如果证书没有出现或者有任何其他错误信息,那么你的keystore设置不正确。