hadoop伪分布式配置
1、$HADOOP_HOME/etc/hadoop/core-site.xml
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>file:/usr/local/hadoop/tmp</value>
<description>Abase for other temporary directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
2、$HADOOP_HOME/etc/hadoop/hdfs-site.xml
<configuration>
<!--数据块大小,表示副本的数量。即rdd.getNumPartitions()的返回值,伪分布式要将其设置为1-->
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<!--dfs.namenode.name.dir表示本地磁盘目录,是存放fsimage文件的地方-->
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/usr/local/hadoop/tmp/dfs/name</value>
</property>
<!--dfs.datanode.data.dir表示本地磁盘目录,HDFS存放block的地方-->
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/usr/local/hadoop/tmp/dfs/data</value>
</property>
</configuration>