Код: Выделить всё
14:41:17,006 ERROR [com.hdfs.HdfsFileBrowserBean] (default task-1) Failed to load file list for path: /: java.io.IOException: DestHost:destPort yava-bdr01.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
Код: Выделить всё
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/yava-bdr01.ecc.com@ECC.COM";
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);
Подробнее здесь: https://stackoverflow.com/questions/792 ... g-kerberos
Мобильная версия