怎么改变HDFS块大小
转载自https://blog.****.net/u010230476/article/details/40475767
1.上传test1.txt
[[email protected] hadoop]$ hadoop fs -put
/home/hadoop/input/test1.txt /usr/hadoop/in
Warning: $HADOOP_HOME is deprecated.
2.查看上传的文件大小
[[email protected] hadoop]$ hadoop fs -stat "%o"
/usr/hadoop/in/test1.txt
Warning: $HADOOP_HOME is deprecated.
67108864
3.修改hdfs-site.xml配置文件,增加全局参数dfs.block.size
<property>
<name>dfs.block.size</name>
<value>512000</value>
</property>
注意:blockSize必须是io.bytes.per.checksum的整数倍,否则会报错
put: io.bytes.per.checksum(512) and blockSize(100000) do not match. blockSize should be a multiple of io.bytes.per.checksum
4.再上传test1.txt文件
[[email protected] bin]$ hadoop fs -put /home/hadoop/input/test1.txt /usr/hadoop/in/test1000.txt
5.查看test1000.txt文件大小
[[email protected] bin]$ hadoop fs -stat "%o" /usr/hadoop/in/test1000.txt
Warning: $HADOOP_HOME is deprecated.
512000