卡夫卡的Kerberos - 只有经纪人

问题描述 投票:0回答:1

我想配置卡夫卡经纪人只经纪商间的Kerberos。但是,我似乎不断跨越的错误来,由于它似乎想通过Kerberos连接到饲养员以及事实。我还没有安装任何动物园管理员keytabs的时刻。

我的经纪人卡夫卡JAAS配置如下:

    KafkaServer {


    com.sun.security.auth.module.Krb5LoginModule required
    serviceName=kafkabroker
    keytab="/etc/security/keytabs/kafka_server.keytab"
    useKeyTab=true
    storeKey=true
    principal="kafkabroker/[email protected]";


    org.apache.kafka.common.security.plain.PlainLoginModule required
    username="user"
    password="secret"
    user_admin="admin"
    user_alice="secret";
};

Client {
    org.apache.kafka.common.security.plain.PlainLoginModule required
    username="admin"
    password="secret";
};

server.properties

sasl.mechanism.inter.broker.protocol=GSSAPI
sasl.enabled.mechanisms=PLAIN, GSSAPI
security.inter.broker.protocol=SASL_SSL
sasl.kerberos.service.name=kafkabroker

我上面的配置得到下面的错误是:

    [2019-02-08 10:08:17,995] ERROR SASL authentication failed using login context 'Client' with exception: {} (org.apache.zookeeper.client.ZooKeeperSaslClient)
javax.security.sasl.SaslException: Error in authenticating with a Zookeeper Quorum member: the quorum member's saslToken is null.
        at org.apache.zookeeper.client.ZooKeeperSaslClient.createSaslToken(ZooKeeperSaslClient.java:279)
        at org.apache.zookeeper.client.ZooKeeperSaslClient.respondToServer(ZooKeeperSaslClient.java:242)
        at org.apache.zookeeper.ClientCnxn$SendThread.readResponse(ClientCnxn.java:805)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doIO(ClientCnxnSocketNIO.java:94)
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:366)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1145)
[2019-02-08 10:08:18,015] ERROR [ZooKeeperClient] Auth failed. (kafka.zookeeper.ZooKeeperClient)
[2019-02-08 10:08:18,048] ERROR Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.zookeeper.KeeperException$AuthFailedException: KeeperErrorCode = AuthFailed for /consumers
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:126)
        at org.apache.zookeeper.KeeperException.create(KeeperException.java:54)
        at kafka.zookeeper.AsyncResponse.maybeThrow(ZooKeeperClient.scala:499)
        at kafka.zk.KafkaZkClient.createRecursive(KafkaZkClient.scala:1456)
        at kafka.zk.KafkaZkClient.makeSurePersistentPathExists(KafkaZkClient.scala:1378)
        at kafka.zk.KafkaZkClient$$anonfun$createTopLevelPaths$1.apply(KafkaZkClient.scala:1370)
        at kafka.zk.KafkaZkClient$$anonfun$createTopLevelPaths$1.apply(KafkaZkClient.scala:1370)
        at scala.collection.immutable.List.foreach(List.scala:392)
        at kafka.zk.KafkaZkClient.createTopLevelPaths(KafkaZkClient.scala:1370)
        at kafka.server.KafkaServer.initZkClient(KafkaServer.scala:373)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:202)
        at io.confluent.support.metrics.SupportedServerStartable.startup(SupportedServerStartable.java:114)
        at io.confluent.support.metrics.SupportedKafka.main(SupportedKafka.java:66)
[2019-02-08 10:08:18,056] INFO shutting down (kafka.server.KafkaServer)
[2019-02-08 10:08:18,058] WARN  (kafka.utils.CoreUtils$)
java.lang.NullPointerException
        at kafka.server.KafkaServer$$anonfun$shutdown$5.apply$mcV$sp(KafkaServer.scala:579)
        at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:86)
        at kafka.server.KafkaServer.shutdown(KafkaServer.scala:579)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:329)
        at io.confluent.support.metrics.SupportedServerStartable.startup(SupportedServerStartable.java:114)
        at io.confluent.support.metrics.SupportedKafka.main(SupportedKafka.java:66)
[2019-02-08 10:08:18,060] INFO [ZooKeeperClient] Closing. (kafka.zookeeper.ZooKeeperClient)
[2019-02-08 10:08:18,063] INFO [ZooKeeperClient] Closed. (kafka.zookeeper.ZooKeeperClient)
[2019-02-08 10:08:18,065] INFO shut down completed (kafka.server.KafkaServer)
[2019-02-08 10:08:18,065] INFO Shutting down SupportedServerStartable (io.confluent.support.metrics.SupportedServerStartable)
[2019-02-08 10:08:18,065] INFO Shutting down KafkaServer (io.confluent.support.metrics.SupportedServerStartable)
[2019-02-08 10:08:18,065] INFO shutting down (kafka.server.KafkaServer)

换句话说,我只是想为券商对经纪人和滑动SASL_SSL对经纪人的Kerberos - 动物园管理员。是否可能?

apache-kafka apache-zookeeper kerberos
1个回答
1
投票

所以,我设法得到这个工作。我需要更新我的/etc/krb5.conf文件与“default_realm”和“[境界]”的详细信息。

然后,我改变了server_jaas.conf文件,如下所示:

KafkaServer {
    com.sun.security.auth.module.Krb5LoginModule required
    serviceName=kafkabroker
    keytab="/etc/security/keytabs/kafka_server.keytab"
    useKeyTab=true
    storeKey=true
    principal="kaffka_service_account@REALM";
}

最后,我更新了我的server.properties文件,如下所示:

sasl.mechanism.inter.broker.protocol=GSSAPI
sasl.enabled.mechanisms=GSSAPI
security.inter.broker.protocol=SASL_SSL
sasl.kerberos.service.name=kafkabroker
© www.soinside.com 2019 - 2024. All rights reserved.