如何检索Hdfs文件中的复制因子信息? [英] How do you retrieve the replication factor info in Hdfs files?
本文介绍了如何检索Hdfs文件中的复制因子信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我为我的文件设置了复制因子,如下所示:
hadoop fs -D dfs.replication = 5 -copyFromLocal file.txt / user / xxxx
当 NameNode
重新启动,它确保复制的块被复制。
因此文件的复制信息被存储(可能在 nameNode
中)。如何获取这些信息?
hadoop fs -stat%r / path / to / file
,它应该打印复制因子。 I have set the replication factor for my file as follows:
hadoop fs -D dfs.replication=5 -copyFromLocal file.txt /user/xxxx
When a NameNode
restarts, it makes sure under-replicated blocks are replicated.
Hence the replication info for the file is stored (possibly in nameNode
). How can I get that information?
解决方案
Try to use command hadoop fs -stat %r /path/to/file
, it should print the replication factor.
这篇关于如何检索Hdfs文件中的复制因子信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文