hadoop集群搭建

1.修改主机名

2.修改IP地址

3.添加主机名与ip的映射

dataNodeOneIP dataNodeOne

dataNodeTwoIP dataNodeTwo

nameNodeIP nameNode

slaveNodeIP slaveNode

4.防火墙:

查看:service iptables status

关闭:service iptables stop

查看开启状态:chkconfig iptables --list

关闭开机启动:chkconfig iptables off

验证:service iptables status

5.拷贝安装包:

6.关闭:selinux

验证:sestatus -v

没有修改成功就reboot

7.在隐藏文件中导入jdk环境变量:/home/用户名/.bash_profile  (.bash_profile隐藏文件)

export JAVA_HOME=/home/用户名/setupPackage/jdk1.7.0_79

export JRE_HOME=/home/用户名/setupPackage/jdk1.7.0_79/jre

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$JRE_HOME/lib

export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

生效环境变量:source /home/用户名/.bash_profile

检查jdk版本:java -version

分发/home/用户名/.bash_profile到集群其他机器,并逐个生效环境变量;

8.建立互信:

cd ~/.ssh

ssh-keygen -t rsa

#把公钥发送到authorized_keys (默认)

ssh-copy-id -i /home/用户名/.ssh/id_rsa.pub dataNodeOne

ssh-copy-id -i /home/用户名/.ssh/id_rsa.pub dataNodeTwo

ssh-copy-id -i /home/用户名/.ssh/id_rsa.pub nameNode

ssh-copy-id -i /home/用户名/.ssh/id_rsa.pub slaveNode

查看公钥:more authorized_keys

验证:ssh 集群主机名

9.在nameNode上安装Hadoop与zookeeper;

10.分发安装好的Hadoop与zookeeper 到 集群其他机器

scp -r /home/用户名/setupPackage/hadoop-2.7.3      slaveNodeIP:/home/用户名/setupPackage/

scp -r /home/用户名/setupPackage/hadoop-2.7.3      dataNodeOneIP:/home/用户名/setupPackage/

scp -r /home/用户名/setupPackage/hadoop-2.7.3      dataNodeTwoIP:/home/用户名/setupPackage/

scp -r /home/用户名/setupPackage/zookeeper-3.4.6      nameNodeIP:/home/用户名/setupPackage/

scp -r /home/用户名/setupPackage/zookeeper-3.4.6      dataNodeOneIP:/home/用户名/setupPackage/

scp -r /home/用户名/setupPackage/zookeeper-3.4.6      slaveNodeIP:/home/用户名/setupPackage/

11.启动zookeeper

你可能感兴趣的:(hadoop集群搭建)