我正在尝试在 JakartaEE 应用程序中使用 Kerberos 身份验证连接到 HDFS。连接代码似乎设置正确,但在尝试从 HDFS 加载文件列表时遇到以下错误:
14:41:17,006 ERROR [com.hdfs.HdfsFileBrowserBean] (default task-1) Failed to load file list for path: /: java.io.IOException: DestHost:destPort java.ecc.com:8020, LocalHost:localPort localhost.localdomain/127.0.0.1:0. Failed on local exception: java.io.IOException: Couldn't set up IO streams: java.lang.IllegalArgumentException: Parameter 'callbackHandler' may not be null
这表明callbackHandler存在问题。我已验证密钥表和主体详细信息,但不确定如何解决此特定错误。
Configuration conf = new Configuration();
setClusterConfig(conf, peerCrawler.getClusterConfig(url, username, password, "hdfs-site"));
setClusterConfig(conf, peerCrawler.getClusterConfig(url, username, password, "core-site"));
String keytabPath = "/opt/wildfly-34.0.0.Final/keytabs/yarn.service.keytab";
String principal = "yarn/[email protected]";
org.apache.hadoop.conf.Configuration hadoopConfig = new org.apache.hadoop.conf.Configuration();
hadoopConfig.set("hadoop.security.authentication", "kerberos");
UserGroupInformation.setConfiguration(hadoopConfig);
UserGroupInformation.loginUserFromKeytab(principal, keytabPath);
String currentUser = UserGroupInformation.getCurrentUser().getUserName();
logger.info("Login successful with principal: " + currentUser);
// Get FileSystem instance
this.fileSystem = FileSystem.get(new URI(hdfsUri), conf);
有人可以帮助我理解为什么我收到此错误以及如何解决它吗?任何有关
callbackHandler
参数的见解将不胜感激。
damm,问题出在CDI上,另一部分代码中断了与IPC客户端的连接。