zoukankan      html  css  js  c++  java
  • hadoop配置环境变量

    hadoop安装包解压 

    tar -xvf hadoop-2.7.7.tar.gz

    解压成功ll查看文件

    配置环境变量

    1.

    vi  /home/wj/hadoop-2.7.7/etc/hadoop/hadoop-env.sh

    修改export JAVA_HOME={$JAVA_HOME}

    为 export  JAVA_HOME=/usr/java/jdk1.8.0_162/

    2.

    vi yarn-env.sh

    找到#export JAVA_HOME=/home/y/libexec/jdk.1.6.0/

    去掉#,改为

    export JAVA_HOME=/usr/java/jdk1.8.0_162

    3.

    vi core-site.xml

    <configuration>
      <property>
        <name>fs.defaultFS</name>
        <value>hdfs://master:9000</value>
      </property>
      <property>
        <name>hadoop.tmp.dir</name>
        <value>/home/wj/hadoopdata</value>
      </property>
    </configuration>

    4.

    vi hdfs-site.xml

    <configuration>
    <property>
    <name>dfs.replication</name>
    <value>1</value>
    </property>
    </configuration>

    5. 

    vi yarn-site.xml

    <configuration>

    <!-- Site specific YARN configuration properties -->
      <property>
        <name>yarn.nodemanager.aux-services</name>
        <value>mapreduce_shuffle</value> #洗牌,类似排序
      </property>

      <property>
        <name>yarn.resourcemanager.address</name>
        <value>master:18040</value>#主机端口

       </property>

      <property>
        <name>yarn.resourcemanager.scheduler.address</name>
        <value>master:18030</value>#调度端口

      </property>

      <property>

        <name>yarn.resourcemanager.resource-tracker.address</name>
        <value>master:18025</value>#跟踪端口

      </property>

    首次运行格式化

    [wj@master hadoop]$ hdfs namenode -format

      <property>
        <name>yarn.resourcemanager.admin.address</name>
        <value>master:18141</value>#管理操作端口

      </property>

      <property>
        <name>yarn.resourcemanager.webapp.address</name>#监控页面
        <value>master:18088</value>

      </property>

    </configuration>

    6.

    复制 mapred-site-template.xml

    cp etc/hadoop/mapred-site-template.xml etc/hadoop/mapred-site.xml

    vi mapred-site.xml

    <configuration>

      <property>
        <name>mapreduce.framework.name</name>
        <value>yarn</value>
      </property>
    </configuration>

    7.

    wj@master ~]$ pwd
    /home/wj
    [wj@master ~]$ vi ~/.bash_profile  或者vi /etc/profile

    #JAVA
    export JAVA_HOME=/usr/java/jdk1.8.0_162
    export PATH=$JAVA_HOME/bin:$PATH
    #hadoop
    export HADOOP_HOME=/home/wj/hadoop2.7.7
    export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH

    使配置生效
    [wj@master ~]$ source .bash_profile  或者source /etc/profile

  • 相关阅读:
    [转]asp.net页面缓存技术
    UL和LI在div中的高度的IE6下兼容性
    jquery制作的横向图片滚动带横向滚动条TackerScroll
    电脑可以上网,但是qq登陆不上去?
    Introduction to discrete event system学习笔记4.6
    Introduction to Discrete event system学习笔记4.9
    Introduction to discrete event systemsstudy 4.5
    Symbolic synthesis of obserability requirements for diagnosability B.Bittner,M.Bozzano,A.Cimatti,and X.Olive笔记4.16
    Introduction to discrete event system学习笔记4.8pm
    Introduction to discrete event system学习笔记 4.8
  • 原文地址:https://www.cnblogs.com/aprilwang/p/10954916.html
Copyright © 2011-2022 走看看