我有一个 1TB(931GB 可用)硬盘,专门用于 HDFS。我将其安装在 /hdfs 上。这是我的 hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/hdfs</value>
</property>
<property>
<name>dfs.datanode.name.dir</name>
<value>/hdfs</value>
</property>
</configuration>
用法:
% df -H /dev/sdd1
Filesystem Size Used Avail Use% Mounted on
/dev/sdd1 984G 78M 934G 1% /hdfs
% hdfs dfs -df -h
Filesystem Size Used Available Use%
hdfs://localhost 15.7 G 4 K 15.7 G 0%
版本:
% hadoop version
Hadoop 2.8.1
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r 20fe5304904fc2f5a18053c389e43cd26f7a70fe
Compiled by vinodkv on 2017-06-02T06:14Z
Compiled with protoc 2.5.0
From source with checksum 60125541c2b3e266cbf3becc5bda666
This command was run using /opt/hadoop-2.8.1/share/hadoop/common/hadoop-common-2.8.1.jar
为什么 HDFS 仅使用一小部分可用空间?我如何告诉它使用所有可用空间?
答案1
XML 配置错误:
dfs.datanode.name.dir
→dfs.datanode.data.dir