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

关闭防火墙

#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

    dfs.replication
    2


    dfs.permissions
    false

配置core-site.xml

# mkdir ~/training/hadoop/data
# vi core-site.xml

    fs.defaultFS
    hdfs://192.168.56.21:9000


    hadoop.tmp.dir
    /root/training/hadoop/data

配置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

    mapreduce.framework.name
    yarn

配置yarn-site.xml

# vi yarn-site.xml

    yarn.resourcemanager.hostname
    192.168.56.21


    yarn.nodemanager.aux-services
    mapreduce_shuffle

在hadoop21上面格式化

#hdfs namenode -format
#start-all.sh
#stop-all.sh

你可能感兴趣的:(Hadoop学习集群安装之全分布模式)