java hadoop认证,java远程连接hadoop,kerbers认证失败 报no supported default etypes for default_tkt_enctypes...

@PostConstructpublic voidinit() throws Exception {if (conn == null) {//System.setProperty("hadoop.home.dir", "G:/keyberos/hbase");

System.setProperty("java.security.krb5.conf",krbConf);

conf=HBaseConfiguration.create();

conf.set("hbase.zookeeper.property.clientPort", zkPort);

conf.set("hbase.zookeeper.quorum", zkHost);

conf.set("hbase.master", master);//conf.addResource(hbaseSite);

conf.set("hadoop.security.authentication", "kerberos");

conf.set("hbase.security.authentication", "kerberos");

conf.set("hbase.cluster.distributed", "true");

conf.set("hbase.rpc.protection", "authentication");

conf.set("hbase.master.kerberos.principal", principal); //this is needed even if you connect over rpc/zookeeper

conf.set("hbase.regionserver.kerberos.principal", principal); //what principal the master/region. servers use.

String principal= System.getProperty("kerberosPrincipal", kerberosPrincipal);

String keytabLocation= System.getProperty("kerberosKeytab",keyberos);

UserGroupInformation.setConfiguration(conf);

UserGroupInformation.loginUserFromKeytab(principal, keytabLocation);

conn=ConnectionFactory.createConnection(conf);

}

}

在 UserGroupInformation.loginUserFromKeytab(principal, keytabLocation) 处报错:

java.io.IOException: Login failure for hbase@XXXX.COM from keytab F:/hbase/hbase.keytab: javax.security.auth.login.LoginException: no supported default etypes for default_tkt_enctypes

参数分别为 hbase@XXXX.COM,F:/hbase/hbase.keytab 。

java.security.krb5.conf设置为F:/hbase/krb5.conf :

# Configuration snippets may be placed in this directory aswell

includedir/etc/krb5.conf.d/[logging]default = FILE:/var/log/krb5libs.log

kdc= FILE:/var/log/krb5kdc.log

admin_server= FILE:/var/log/kadmind.log

[libdefaults]

default_realm=XXXX.COM

dns_lookup_realm= falsedns_lookup_kdc= falseticket_lifetime=24h

renew_lifetime=7d

forwardable= truedefault_tgs_enctypes= aes256-cts-hmac-sha1-96default_tkt_enctypes= aes256-cts-hmac-sha1-96permitted_enctypes= aes256-cts-hmac-sha1-96clockskew= 120udp_preference_limit= 1[realms]

XXXX.COM={

kdc=bdp01

admin_server=bdp01

}

[domain_realm]

.xxxx.com=XXXX.COM

xxxx.com= XXXX.COM

处理:下载jdk8对应的JCE文件添加到jdk/jre/lib/security下

20191120165819660781.png

20191120165819762348.png

初步推测是,jdk需要相应的加密解密方式来处理hbase.keytab 文件。

1acf1ba0b2da598d3372dd574cf1d46f.gif

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值