在这里我准备了5个机器
server1 192.168.80.131
server2 192.168.80.132
server3 192.168.80.133
server4 192.168.80.134
server5 192.168.80.135
server1作为namenode 其他作为datanode
1 在5个节点上分别安装 hadoop
2 分别配置5个节点的hosts文件 vi /etc/hosts
将主机名和IP映射更新上
3 分别配置5个节点的配置文件
(1) 配置 core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://server1/</value>
</property>
</configuration>
(2) 配置hdfs-site.xml 默认副本数3个
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
</configuration>
(3) 配置 mapred-site.xml
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
(4) yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties -->
<property>
<name>yarn.resourcemanager.hostname</name>
<value>server1</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
</configuration>
(5) 配置slaves
server2
server3
server4
server5
以下操作 只在server1上
# hadoop namenode -format
启动hadoop
# start-all.sh
访问一下看看
http://server1:50070