Springboot项目集成kafka启动报错

Caused by: v11.org.apache.kafka.common.KafkaException: javax.security.auth.login.LoginException: Could not login: the client is being asked for a password, but the Kafka client code does not currently support obtaining a password from the user. not available to garner  authentication information from the user
	at v11.org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:125)
	at v11.org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:140)
	at v11.org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:65)
	at v11.org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:88)
	at v11.org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:413)
	... 73 common frames omitted
Caused by: javax.security.auth.login.LoginException: Could not login: the client is being asked for a password, but the Kafka client code does not currently support obtaining a password from the user. not available to garner  authentication information from the user
	at com.chinawayltd.op.common.gmq.login.Krb5LoginModule.promptForPass(Krb5LoginModule.java:707)
	at com.chinawayltd.op.common.gmq.login.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:486)
	at com.chinawayltd.op.common.gmq.login.Krb5LoginModule.login(Krb5LoginModule.java:292)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at javax.security.auth.login.LoginContext.invoke(LoginContext.java:755)
	at javax.security.auth.login.LoginContext.access$000(LoginContext.java:195)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:682)
	at javax.security.auth.login.LoginContext$4.run(LoginContext.java:680)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
	at javax.security.auth.login.LoginContext.login(LoginContext.java:587)
	at v11.org.apache.kafka.common.security.authenticator.AbstractLogin.login(AbstractLogin.java:52)
	at v11.org.apache.kafka.common.security.kerberos.KerberosLogin.login(KerberosLogin.java:98)
	at v11.org.apache.kafka.common.security.authenticator.LoginManager.<init>(LoginManager.java:53)
	at v11.org.apache.kafka.common.security.authenticator.LoginManager.acquireLoginManager(LoginManager.java:95)
	at v11.org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:114)
	... 77 common frames omitted

原因是java8u351之后默认屏蔽了DES等弱密码算法,导致认证不通过;

The des3-hmac-sha1 and rc4-hmac Kerberos encryption types (etypes) are now deprecated and disabled by default. Users can set allow_weak_crypto = true in the krb5.conf configuration file to re-enable them (along with other weak etypes including des-cbc-crc and des-cbc-md5) at their own risk. To disable a subset of the weak etypes, users can list preferred etypes explicitly in any of the default_tkt_enctypesdefault_tgs_enctypes, or permitted_enctypes settings.

解决:在krb5.conf的[libdefaults]节添加:

allow_weak_crypto = true

或着使用jdk8u351之前的版本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值