从aws连接到hadoop集群

3bygqnnd  于 2021-05-29  发布在  Hadoop
关注(0)|答案(0)|浏览(235)

我正在尝试从aws示例(没有安装hadoop)连接到hadoop集群来传输一些文件。但是,以下代码不起作用。。

System.setProperty("javax.security.auth.useSubjectCredsOnly", "false");
    Configuration configuration = new Configuration();

    configuration.addResource(coreSite);
    configuration.addResource(hdfsSite);
    UserGroupInformation.setConfiguration(configuration);
    UserGroupInformation.loginUserFromKeytab(user, keytabPath);
    FileSystem fs = FileSystem.get(configuration);

filesystem对象仍然只指向本地aws路径。我用的是 core-site.xml , hdfs-site.xml , .keytab , krb5.conf 和batchid作为特定集群的用户。有人能给我一些建议吗。谢谢。
ps:我也试过在windows环境下运行这段代码,但它不起作用。所以可以排除环境问题。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题