Can’t get Kerberos realm


When using HDFS to connect to Hadoop, Keytab authentication is required, but an error is reported: Can’t get Kerberos realm

Solution: Add two lines of code to the configuration code

System.setProperty(“”, “XXX.COM”);
System.setProperty(“”, “XXX.COM”);

XXX.COM is obtained from the krb5.cof configuration file

Can't get Kerberos realm