我有一个namenode地址(ip地址和端口),但我不知道配置文件(即core-site.xml、hdfs site.xml等)在本地文件系统上的位置。我想访问配置详细信息。
我知道通过下面的步骤我可以得到细节,
Configuration conf = new Configuration();
conf.addResource(file path of core-site.xml);
conf.addResource(file path of hdfs-site.xml);
它在我知道文件路径的本地机器上工作。但是我不知道远程机器上文件的位置。
有没有办法访问配置?
1条答案
按热度按时间whitzsjs1#
如果真正的问题是如何在一个集群中运行代码并在另一个集群上访问hdfs,那么您不需要像大多数教程所示那样添加resource core-site.xml和hdfs-site.xml。