背景
CDH在开启kerberos后,kinit 认证成功,但是hdfs,hbase sehll 发现无法找到kerberos tgt
hdfs dfs -ls /user
hbase shell -d #开启hbase shell 的debug模式
问题追踪
1、判断kinit 认证是否正常。开启kinit debug模式
参考文档:https://risdenk.github.io/2018/03/14/kerberos-debugging.html
KRB5_TRACE=/dev/stdout kinit -V
2、开启hdfs,hbase shell的debug模式
#hdfs debug模式
export HADOOP_OPTS="-Djava.net.preferIPv4Stack=true -Dsun.security.krb5.debug=true $HADOOP_OPTS"
#hbase shell debug模式
hbase shell -d
3、在执行hdfs dfs -ls /user命令发现
unsupported key type found the default TGT: 18
这里的type 18, 表示的是AES256的一种加密算法。而当前的JDK并不支持这种方式。所以导致无法解密。
解决方案
方案1、安装oracle jdk版本为jdk 1.8-161以上版本
rpm -ivh jdk-8u181-linux-x64.rpm
#查看文档 java -version
方案2、下载JCE POLICY FILE
https://www.oracle.com/java/technologies/javase-downloads.html
将
unzip jce_policy-
查看readme文档进行部署