hdfs-site.xml下配置
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>/Users/shen/tmp/dfs/namenode</value>
</property>
<property>
<name>dfs.datanode.data.dir</name>
<value>/Users/shen/tmp/dfs/datanode</value>
</property>
<property>
<name>dfs.http.address</name>
<value>localhost:9870</value>
</property>
</configuration>
core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/Users/shen/tmp</value>
</property>
</configuration>
hdfs-site.xml的第二三个设置,以及core-site.xml的第二个设置,要设置一下文件系统信息的目录,像我这里就是/Users/shen/tmp
它默认似乎放在系统目录下,似乎因为权限问题需要重新格式化。