码迷,mamicode.com
首页 > 其他好文 > 详细

hadoop在CentOS下的安装配置

时间:2018-12-12 19:05:25      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:prope   bin   val   apr   .sh   env   安装配置   sbin   minimal   

 
  • 版本:CentOS-6.8-x86_64-minimal,hadoop2.6.4,jdk1.7.0
  • 首先把jdk、hadoop压缩包下载发送到CentOS下并解压

下载发送不多赘述,解压命令tar -zxvf 压缩包

mv 原文件名 新文件名

(注意空格)

  • 先配置jdk
  1. 进入jdk目录 pwd 查看当前目录复制备用/apps/jdk1.7.0_25
  2. 配置环境变量

vi ~/.bash_profile

JAVA_HOME=/apps/jdk1.7.0_25
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin

source ~/.bash_profile

  • 关闭防火墙,做好ssh免密登录
    • 关闭防火墙
      • service iptables stop
      • chkconfig iptables off
      • ssh-keygen -t rsa
    • ssh免密登录
      • master: cat /root/.ssh/id_rsa.pub >>/root/.ssh/authorized_keys
      • master:scp /root/.ssh/authorized_keys @slave1:/root/.ssh/authorized_keys
      • slave1:cat /root/.ssh/id_rsa.pub >>/root/.ssh/authorized_keys
      • slave1:scp /root/.ssh/authorized_keys @slave2:/root/.ssh/authorized_keys
      • slave2:cat /root/.ssh/id_rsa.pub >>/root/.ssh/authorized_keys
      • slave2:scp /root/.ssh/authorized_keys @master:/root/.ssh/authorized_keys
      • master:scp /root/.ssh/authorized_keys @slave1:/root/.ssh/authorized_keys
      • slave2:scp /root/.ssh/authorized_keys @slave2:/root/.ssh/authorized_keys
  • 再配置hadoop
  1. 环境变量vi ~/.bash_profile

    HADOOP_HOME=/apps/hadoop-2.6.4
    PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

    source ~/.bash_profile

  2. 配置运行环境
    • core-site.xml
      • <property>
        <name>fs.defaultFS</name>
        <value>hdfs://master:9000</value>
        </property>

    • hdfs-site.xml

      • <property>
        <name>dfs.replication</name>
        <value>3</value>
        </property>

        <property>
        <name>dfs.namenode.name.dir</name>
        <value>/app/hadoop/dfs/name</value>
        </property>

        <property>
        <name>dfs.datanode.data.dir</name>
        <value>/app/hadoop/dfs/data</value>
        </property>

        <property>
        <name>dfs.secondary.http.address</name>
        <value>slave2:50090</value>
        </property>

        <property>
        <name>dfs.namenode.checkpoint.dir</name>
        <value>/app/hadoop/dfs/namesecondary</value>
        </property>

    • hadoop-env.sh
      •  export JAVA_HOME=/apps/jdk1.7.0_25
    • yarn-site.xml
      • <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value>
        </property>

        <property>
        <name>yarn.resourcemanager.hostname</name>
        <value>master</value>
        </property>


        mapreduce-site.xml
        <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
        </property>

  3. 将配置完成的jdk、hadoop发送到另外两台主机上
    • master:scp -r apps/ @slave1:/apps/
    • master:scp -r apps/ @slave2:/apps/

  hadoop集群配置完成

 

hadoop在CentOS下的安装配置

标签:prope   bin   val   apr   .sh   env   安装配置   sbin   minimal   

原文地址:https://www.cnblogs.com/mxxq/p/10109696.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!