美文网首页linux学习
添加PATH变量,方便使用java与hadoop命令

添加PATH变量,方便使用java与hadoop命令

作者: tonyemail_st | 来源:发表于2017-09-24 18:08 被阅读18次

    /etc/profile后面添加以下四行

    export HADOOP_HOME=/usr/hadoop/hadoop-2.7.4/
    export JAVA_HOME=/usr/jdk64/jdk1.8.0_144/
    export PATH=$PATH:$JAVA_HOME/bin/
    export PATH=$PATH:$HADOOP_HOME/bin/
    export PATH=$PATH:$HADOOP_HOME/sbin/
    
    

    验证

    [root@hadoop hadoop-2.7.4]# source /etc/profile
    [root@hadoop hadoop-2.7.4]# java -version
    java version "1.8.0_144"
    Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
    Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
    [root@hadoop hadoop-2.7.4]# jps
    10902 DataNode
    10776 NameNode
    11064 SecondaryNameNode
    11339 Jps
    [root@hadoop hadoop-2.7.4]# hadoop version
    Hadoop 2.7.4
    Subversion https://shv@git-wip-us.apache.org/repos/asf/hadoop.git -r cd915e1e8d9d0131462a0b7301586c175728a282
    Compiled by kshvachk on 2017-08-01T00:29Z
    Compiled with protoc 2.5.0
    From source with checksum 50b0468318b4ce9bd24dc467b7ce1148
    This command was run using /usr/hadoop/hadoop-2.7.4/share/hadoop/common/hadoop-common-2.7.4.jar
    

    相关文章

      网友评论

        本文标题:添加PATH变量,方便使用java与hadoop命令

        本文链接:https://www.haomeiwen.com/subject/axxlextx.html