第一步配置ssh免密码登陆:
在每个节点,执行:ssh-keygen -t rsa
然后在Master结点,执行:
cd .ssh
分发给每个slave:scp id_rsa.pub cloud@XXX:/home/cloud
在每个slave节点:
cat id_rsa.pub >> ~/.ssh/authorized_keys
然后在每个节点:
vim /etc/hosts
加入
#127.0.0.1 localhost
10.0.0.23 hadoop-master
10.0.0.24 hadoop-slave1
10.0.0.25 hadoop-slave2
10.0.0.7 hadoop-slave3
127.0.0.1 localhost
#127.0.1.1 cloud
ssh实验一下。
第二步装Java:
vim ~/.bashrc
export JAVA_HOME=/home/cloud/jdk1.7.0_67
export CLASSPATH=/home/cloud/jdk1.7.0_67/lib
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bashrc
vim ~/.bash_profile
export JAVA_HOME=/home/cloud/jdk1.7.0_67
export CLASSPATH=/home/cloud/jdk1.7.0_67/lib
export PATH=$JAVA_HOME/bin:$PATH
source ~/.bash_profile