Can't get Kerberos realm

使用HDFS连接Hadoop的时候,需要Keytab认证,但是报错: Can't get Kerberos realm

解决:在配置代码中添加一下两行代码

System.setProperty("java.security.krb5.realm", "XXX.COM");
System.setProperty("java.security.krb5.kdc", "XXX.COM");

XXX.COM 从 krb5.cof 配置文件中获取

截图:
Can't get Kerberos realm_第1张图片

你可能感兴趣的:(Can't get Kerberos realm)