ELK,萌萌哒

kakfa 添加kerberos认证 启动报错

默认分类 | 作者 liucy | 发布于2018年02月08日 | 阅读数:10860

security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=GSSAPI
sasl.enabled.mechanisms=GSSAPI
sasl.kerberos.service.name=zookeeper
 
dsg@node1:[/dsg/bigdata/kafka_2.12-1.0.0/config] more kafka_server_jaas.conf 
KafkaServer {
  com.sun.security.auth.module.Krb5LoginModule required
  debug=true
  useKeyTab=true
  storeKey=true
  keyTab="/dsg/bigdata/kafka_2.12-1.0.0/config/kafka.keytab"
  principal="zookeeper/node1@HADOOP.COM";
};

Client {
  com.sun.security.auth.module.Krb5LoginModule required
  debug=true
  useKeyTab=true
  storeKey=true
  keyTab="/dsg/bigdata/kafka_2.12-1.0.0/config/kafka.keytab"
  principal="zookeeper/node1@HADOOP.COM";
};
 
[2018-02-08 17:52:38,085] INFO zookeeper state changed (SyncConnected) (org.I0Itec.zkclient.ZkClient)
[2018-02-08 17:52:38,105] ERROR An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - UNKNOWN_SERVER)]) occurred when evaluating Zookeeper Quorum Member's  received SASL token. This may be caused by Java's being unable to resolve the Zookeeper Quorum Member's hostname correctly. You may want to try to adding '-Dsun.net.spi.nameservice.provider.1=dns,sun' to your client's JVMFLAGS environment. Zookeeper Client will go to AUTH_FAILED state. (org.apache.zookeeper.client.ZooKeeperSaslClient)
[2018-02-08 17:52:38,105] ERROR SASL authentication with Zookeeper Quorum member failed: javax.security.sasl.SaslException: An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - UNKNOWN_SERVER)]) occurred when evaluating Zookeeper Quorum Member's  received SASL token. This may be caused by Java's being unable to resolve the Zookeeper Quorum Member's hostname correctly. You may want to try to adding '-Dsun.net.spi.nameservice.provider.1=dns,sun' to your client's JVMFLAGS environment. Zookeeper Client will go to AUTH_FAILED state. (org.apache.zookeeper.ClientCnxn)
[2018-02-08 17:52:38,106] INFO zookeeper state changed (AuthFailed) (org.I0Itec.zkclient.ZkClient)
[2018-02-08 17:52:38,106] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2018-02-08 17:52:38,107] FATAL Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.I0Itec.zkclient.exception.ZkAuthFailedException: Authentication failure
        at org.I0Itec.zkclient.ZkClient.waitForKeeperState(ZkClient.java:947)
        at org.I0Itec.zkclient.ZkClient.waitUntilConnected(ZkClient.java:924)
        at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1231)
        at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:157)
        at org.I0Itec.zkclient.ZkClient.<init>(ZkClient.java:131)
        at kafka.utils.ZkUtils$.createZkClientAndConnection(ZkUtils.scala:115)
        at kafka.utils.ZkUtils$.withMetrics(ZkUtils.scala:92)
        at kafka.server.KafkaServer.initZk(KafkaServer.scala:350)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:194)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
        at kafka.Kafka$.main(Kafka.scala:92)
        at kafka.Kafka.main(Kafka.scala)
已邀请:

medcl - 今晚打老虎。

赞同来自:

看起来服务器连不上,host配置对了么?
Hadoop.com

locatelli

赞同来自:

大体上有两种可能:
-- DNS 解析出问题,所以server不知道怎么解析机器名
-- Kerberos principal里的/_HOST部分跟实际的hostname不匹配。比如说这里principal里是/node1@REALM,表示hostname应该是'node1',所以需要确保实际的hostname是'node1'并且正反向nslookup都要能够正确解析。  

检查一下 'hostname -f" , "nslookup node1" , "nslookup <node1 ip>"等看看。另外看一下/etc/hosts里面hostname and ip是否正确

要回复问题请先登录注册