Hadoop学习集群安装之全分布模式

2017-12-22  本文已影响10人  薛落花随泪绽放

关闭防火墙

#systemctl stop firewalld
#systemctl disable firewalld

配置映射主机地址

#vi /etc/hosts
192.168.56.21 hadoop21
192.168.56.22 hadoop22
192.168.56.23 hadoop23
192.168.56.24 hadoop24

配置免密码登录

# ssh-keygen -t rsa
# ssh-copy-id -i .ssh/id_rsa.pub root@hadoop21
# ssh-copy-id -i .ssh/id_rsa.pub root@hadoop22
# ssh-copy-id -i .ssh/id_rsa.pub root@hadoop23
# ssh-copy-id -i .ssh/id_rsa.pub root@hadoop24

解压jdk

#mkdir training
#cd training
# rpm -ivh jdk-8u91-linux-x64.rpm 
# rm -rf jdk-8u91-linux-x64.rpm

解压hadoop

# tar -zxvf hadoop-2.7.3.tar.gz
# rm -rf hadoop-2.7.3.tar.gz
# mv hadoop-2.7.3/ hadoop
# cd hadoop
#vi /etc/profile

export HADOOP_HOME=/root/training/hadoop

export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

#source /etc/profile
# cd etc/hadoop/
#vi hadoop-env.sh
export JAVA_HOME=/usr/java/default

配置hdfs-site.xml

#vi hdfs-site.xml
<property>
    <name>dfs.replication</name>
    <value>2</value>
</property>
<property>
    <name>dfs.permissions</name>
    <value>false</value>
</property>

配置core-site.xml

# mkdir ~/training/hadoop/data
# vi core-site.xml
<property>
    <name>fs.defaultFS</name>
    <value>hdfs://192.168.56.21:9000</value>
</property>
<property>
    <name>hadoop.tmp.dir</name>
    <value>/root/training/hadoop/data</value>
</property>

配置slaves

#vi slaves
192.168.56.22
192.168.56.23
192.168.56.24

配置mapred-site.xml

# cp mapred-site.xml.template mapred-site.xml
# vi mapred-site.xml
<property>
    <name>mapreduce.framework.name</name>
    <value>yarn</value>
</property>

配置yarn-site.xml

# vi yarn-site.xml
<property>
    <name>yarn.resourcemanager.hostname</name>
    <value>192.168.56.21</value>
</property>
<property>
    <name>yarn.nodemanager.aux-services</name>
    <value>mapreduce_shuffle</value>
</property>

在hadoop21上面格式化

#hdfs namenode -format
#start-all.sh
#stop-all.sh
上一篇下一篇

猜你喜欢

热点阅读