我们在 Kafka 连接中遇到了一些错误。我们有两个不同的 Kafka (一个用于消费数据,另一个用于生成数据),具有单独的 kdc 和领域配置。我们的应用程序是用 Go 语言编写的,并使用 Librdkafka 库进行 Kafka 配置。
在 krb 中我们配置了多个 Realm 域。例如
- realm1_domain.com
- realm2_domain.com
下面是 krb5 conf 输出。
renew_lifetime = 7d
forwardable = true
default_realm = realm1_domain.com
ticket_lifetime = 24h
dns_lookup_realm = false
dns_lookup_kdc = false
#default_ccache_name = /tmp/krb5cc_%{uid}
default_ccache_name = DIR:/tmp/krb5cc # defined this because we are using multiple realms and application runing as same user.
#default_tgs_enctypes = aes des3-cbc-sha1 rc4 des-cbc-md5
#default_tkt_enctypes = aes des3-cbc-sha1 rc4 des-cbc-md5
[realms]
realm1_domain.com = {
admin_server = x.x.x.x
kdc = x.x.x.x
}
realm2_domain.com = {
admin_server = x.x.x.x
kdc = x.x.x.x
}
[domain_realm]
.realm1_domain.com = realm1_domain.com
realm1_domain.com = realm1_domain.com
.realm2_domain.com = realm2_domain.com
realm2_domain.com = realm2_domain.com
我们在系统日志中不断收到以下错误。
2021/09/07 18:41:52 ERROR 1631020311198-2 ++ Kafka kafkamanager.go/handleKafkaEvent ++ Error while reading data: sasl_plaintext://kafka:6667/bootstrap: Failed to initialize SASL authentication: SASL handshake failed (start (-1)): SASL(-1): generic failure: GSSAPI Error: Unspecified GSS failure. Minor code may provide more information (Server krbtgt/realm1_domain.COM@realm2_domain.COM not found in Kerberos database) (after 12018ms in state AUTH_REQ)