三台hadoop分布式集群的搭建:
1、修改主机名分别为:
master
slave1
slave2
2、配置/etc/hosts(三台都要修改)
192.168.8.88 master
192.168.8.89 slave1
192.168.8.90 slave2
3、ssh免密码登录三台:
每台都执行:ssh-keygen -t rsa(一路回车)
进入:.ssh/目录
cat ./id_rsa.pub >> ./authorized_keys
这个时候。我们分别查看另外两台的authorized_keys然后把这两台里面的内容复制到第一台的authorized_keys 里面。然后用scp -r authorized_keys slave1:.ssh/
安装前步骤:
1、配置jdk
2、关闭防火墙
service iptables stop
service iptables status
chkconfig iptables off
chkconfig iptables list
1、下载安装包
2、tar开安装包
3、配置环境变量
4、修改配置文件(五个配置文件)
1.core-site.xml
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://zj01</value>
</property>
</configuration>
2.hdfs-site.xml
<configuration>
<property>
<name>dfs.replication</name>
<value>3</value>
</property>
</configuration>
3.mapred-site.xml
注意:cp mapred-site.xml.template mapred-site.xml
<?xml version="1.0"?>
<configuration>
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
</configuration>
4.yarn-site.xml
<property>
<name>yarn.resourcemanager.hostname</name>
<value>zj01</value>
</property>
<property>
<name>yarn.nodemanager.aux-services</name>
<value>mapreduce_shuffle</value>
</property>
5.salves
master
salve
slave2
5、分发配置
6、格式化文件系统
hadoop namenode -format
7、启动进程查看配置是否正确
http://master:8088
http://master:50070