1. 下载jdk
1. 更改hadoop-env.sh
vim hadoop-env.sh
找到export JAVA_HOME,更改为自己的JAVA_HOME目录
export JAVA_HOME=/usr/local/java/jdk
2. 更改core-site.xml
vim core-site.xml
找到并更改以下内容
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop:9000</value>
</property>
<property>
<name>hadoop.tmp.dir</name>
<value>/home/hadoop/hadoopdata</value>
</property>
</configuration>
3. 更改hdfs-site.xml
找到并更改以下内容
<configuration>
<property>
<name>dfs.namenode.name.dir</name>
<value>/home/hadoop/hadoopdata/tmp/dfs/name</value>
</property>
<property>
<name>dfs.datanode.data.dir/<name>
<value>/home/hadoop/hadoopdata/tmp/dfs/data</value>
</property>
<property>
<name>dfs.replication/name>
<value>1/value>
</property>
</configuration>
4. 更改mapred-site.xml
cp mapred-site.xml.template mapred-site.xml
找到并更改
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
5. 更改yarn-site.xml
vim yarn-site.xml
<configuration>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
<property>
<name>yarn.resourcemanager.hostname</name>
<value>hadoop</value>
</property>
</property>
</configuration>
6. 初始化namenode
hdfs namenode -format