Open MrDHat opened 7 years ago
cc @confluentinc/clients
Looks like the Kerberos client is not able to connect to the KDC.
Did you add your realm and kdc to /etc/krb5.conf?
Can you reach the kdc from within the docker image? (e.g. telnet theKdcHost 88
)
I am unable to test if the KDC is reachable since the container never starts up. I think we can assume that the server is reachable since other containers (kafka and zookeeper) can reach the KDC server and they are in the same network as the schema registry.
Here is my krb5.conf
[logging]
default = FILE:/var/log/kerberos/krb5libs.log
kdc = FILE:/var/log/kerberos/krb5kdc.log
admin_server = FILE:/var/log/kerberos/kadmind.log
[libdefaults]
default_realm = TEST.GETSTRIKE.CO
dns_lookup_realm = false
dns_lookup_kdc = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
[realms]
TEST.GETSTRIKE.CO = {
kdc = kerberos-gob-dev.getstrike.co
admin_server = kerberos-gob-dev.getstrike.co
}
[domain_realm]
.TEST.GETSTRIKE.CO = TEST.GETSTRIKE.CO
TEST.GETSTRIKE.CO = TEST.GETSTRIKE.CO
Is there a way to get more detailed logs in the schema registry?
I could be missing something here, but I see this where the ZK connectivity failed because of bad SASL key. Irrespective, you could get more logs by setting SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL to DEBUG
gob-schema-registry | Found unsupported keytype (1) for zkclient/localhost@TEST.GETSTRIKE.CO gob-schema-registry | Added key: 16version: 1 gob-schema-registry | Added key: 23version: 1 gob-schema-registry | Using builtin default etypes for default_tkt_enctypes gob-schema-registry | default etypes for default_tkt_enctypes: 17 16 23. gob-schema-registry | >>> KrbAsReq creating message gob-schema-registry | getKDCFromDNS using UDP gob-schema-registry | getKDCFromDNS using TCP gob-schema-registry | SASL configuration failed: javax.security.auth.login.LoginException: Cannot locate KDC Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it. gob-schema-registry | Opening socket connection to server localhost/127.0.0.1:22181 gob-schema-registry | Error occurred while connecting to Zookeeper server[localhost:22181].
Setting SCHEMA_REGISTRY_LOG4J_ROOT_LOGLEVEL
to DEBUG
does nothing.
I think I messed up the environment variables in docker compose. Can someone confirm if they are correct?
This seems to be network problem. Try to start the registry server with jvm debug mode (JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9998") and with suspend to yes then you can login into the docker image and try to telnet to the port of the kdc.
After 3 years, when I setting up a kafka with kerberos, this problem appears again!
docker run -itd --name kafka \
-h kafka \
-v /opt/kafka/data:/var/lib/kafka/data/:rw \
-v /opt/kafka/kafka.properties.template:/etc/confluent/docker/kafka.properties.template \
-v /opt/kafka/kafka-server.keytab:/var/lib/kafka/kafka-server.keytab \
-v /opt/kafka/zookeeper-client.keytab:/var/lib/kafka/zookeeper-client.keytab \
-v /opt/kafka/krb5.conf:/var/lib/kafka/krb5.conf \
-v /opt/kafka/jaas.conf:/var/lib/kafka/jaas.conf \
-v /etc/timezone:/etc/timezone:ro \
--add-host kdc1.ops.com:172.17.0.1 \
--add-host zk1:172.17.0.2 \
--add-host zk2:172.17.0.3 \
--add-host zk3:172.17.0.4 \
--restart always \
-e KAFKA_OPTS="-Dlogging.level=INFO -Djava.security.krb5.conf=/var/lib/zookeeper/krb5.conf -Djava.security.auth.login.config=/var/lib/kafka/jaas.conf -Dsun.security.krb5.debug=true" \
-e KAFKA_ADVERTISED_LISTENERS="SASL_PLAINTEXT://192.168.43.103:9092" \
-e REPLICATION=1 \
-e KAFKA_ZOOKEEPER_CONNECT="zk1:21811;zk2:21812;zk3:21813" \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
-e KAFKA_BROKER_ID=0 \
-e SECURITY_INTER_BROKER_PROTOCOL='SASL_PLAINTEXT' \
-e SASL_MECHANISM_INTER_BROKER_PROTOCOL='GSSAPI' \
-e SASL_ENABLED_MECHANISMS='GSSAPI' \
-p 9092:9092 \
kafka:2.1.1cp1 bash
I started the kafka container with bash as CMD, and entered the kafka container, I can connect to the kdc:
nc -vz kdc1.ops.com 88
kdc1.ops.com [172.17.0.1] 88 (kerberos) open
BUT the the problem is the same:
KrbAsReq creating message
getKDCFromDNS using UDP
getKDCFromDNS using TCP
[main] ERROR io.confluent.admin.utils.ClusterStatus - Timed out waiting for connection to Zookeeper server [zk1:21811].
[Krb5LoginModule] authentication failed
Cannot locate KDC
[main-SendThread(zk1:21811)] WARN org.apache.zookeeper.ClientCnxn - SASL configuration failed: javax.security.auth.login.LoginException: Cannot locate KDC Will continue connection to Zookeeper server without SASL authentication, if Zookeeper server allows it.
I am trying to setup Confluent Schema Registry with Kerberos backed Kafka Cluster. Here is what my docker compose file looks like:
I get this in my container logs:
This is what the jaas conf looks like for the schema registry:
Looks like the schema registry is unable to locate KDC. Not sure what is wrong here. I am guessing I am missing something out in the docker compose file. Can someone help me out with this?
P.S. I am using an existing kerberos server.