修改HDFS块大小

时间:2014-05-06 08:58:40   收藏:0   阅读:518

环境:OS:Centos 6.5 x64 & Soft:Hadoop 1.2.1

1、查看当前块大小,默认64M。

[huser@master hadoop-1.2.1]$ bin/hadoop fs -stat "%o" ./in/test1.txt
67108864

2、修改hdfs-site.conf配置文件,增加全局参数dfs.block.size

[huser@master hadoop-1.2.1]$ cat conf/hdfs-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
 <property>
  <name>dfs.replication</name>
  <value>1</value>
 </property>
 <property>
  <name>dfs.block.size</name>
  <value>134217728</value>
 </property>
</configuration>

3、上传个新文件,查看文件块大小。

[huser@master hadoop-1.2.1]$ bin/hadoop fs -put ../input/tes4.txt ./in

[huser@master hadoop-1.2.1]$ bin/hadoop fs -stat "%o" ./in/test4.txt
134217728

bubuko.com,布布扣

修改HDFS块大小,布布扣,bubuko.com

原文:http://www.cnblogs.com/guarder/p/3704214.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!