hadoop修改副本数:setrep

说明:

生产环境下,hadoop的副本因子一般配置为3,但在测试环境或本地pc虚拟机下,如果磁盘较小,可以考虑调整副本数以减少容量限制。

命令格式:

hadoop fs -setrep [-R] [-w]

参数说明:

-R:(向后兼容)
-w:(等待副本复制完成)
-rep:numReplicas
-path:希望进行副本数调整的hdfs路径

来自官网的说明:http://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/FileSystemShell.html

setrep

Usage: hadoop fs -setrep [-R] [-w] <numReplicas> <path>

Changes the replication factor of a file. If path is a directory then the command recursively changes the replication factor of all files under the directory tree rooted at path.

Options:

    The -w flag requests that the command wait for the replication to complete. This can potentially take a very long time.(等待副本复制完成)
    The -R flag is accepted for backwards compatibility. It has no effect.(向后兼容)

Example:

    hadoop fs -setrep -w 3 /user/hadoop/dir1

Exit Code:

Returns 0 on success and -1 on error.
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值