如何在公司中的环境中查看到类似hdfs://localhost:9000/user/hadoop的地址

在公司的Hadoop集群中,可以使用以下命令查看HDFS的地址:

hdfs getconf -confKey fs.defaultFS

执行此命令将会返回解析地址,例如:

hdfs://cluster_name-nn1.example.com:8020

然后你可以使用这个地址与目标HDFS进行交互。

例如,查看hdfs://localhost:9000/user/hadoop目录下的文件,需要执行以下命令

hadoop fs -ls hdfs://localhost:9000/user/hadoop

基本上查看文件的时候都直接

hadoop fs -ls 等命令

猜你喜欢

转载自blog.csdn.net/qq_52128187/article/details/131231915
今日推荐