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

【Hadoop】配置环境-伪分布式

时间:2018-10-24 22:28:35      阅读:355      评论:0      收藏:0      [点我收藏+]

标签:gcj   密码   5.0   jps   script   分布式配置   secondary   gre   host   

目录

1.Linux设置静态IP地址


    # cd /etc/sysconfig/network-scripts/
    # vi ifcfg-auto_eth0
            BOOTPRPTO=none
            IPADDR=192.168.0.202
            NETMASK=255.255.255.0
            GATE=192.168.0.1
            wq

2.修改主机名和映射文件


    # cd /etc/sysconfig/
    # vi network
            HOSTNAME=simple02
            wq
    # cat network
    # vi /etc/hosts
            192.168.0.202 simple02
            wq
    # reboot

3.SSH免密码配置


    # cd ~/.ssh
    # ssh-keygen -t rsa
    # ssh-copy-id simple02
    # ssh simple02

4.Linux系统JDK的安装和配置


    # rpm -qa | grep jdk
    # rpm -e –nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
    # cd /
    # mkdir simple
    # cd simple
    # mkdir soft
    # cd ../
    # tar -zvxf /simple/soft/jdk-7u79-linux-i586.tar.gz
    # vi /etc/profile
            JAVA_HOME=/simple/jdk1.7.0_79
            export PATH=$JAVA_HOME/bin:$PATH
            wq
    # source /etc/profile
    # java -version

5.Hadoop伪分布式配置和测试


    # cd /simple
    # tar -zvxf /simple/soft/hadoop-2.4.1.tar.gz
    # cd /simple/hadoop-2.4.1/etc/hadoop/
    # vi hadoop-env.sh
            export JAVA_HOME=/simple/jdk1.7.0_79
            wq
    # vi core-site.xml 
        <property>
            <name>fs.default.name</name>
            <value>hdfs://169.254.25.128:9000</value>
        </property>
        <property>
            <name>fs.defaultFS</name>
            <value>hdfs://169.254.25.128:9000</value>
        </property>
        <property>
            <name>hadoop.tmp.dir</name>
            <value>/simple/hadoop-2.4.1/tmp</value>
        </property>
        wq
    # vi hdfs-site.xml
        <property>
            <name>dfs.replication</name>
            <value>1</value>
        </property>
        <property>
            <name>dfs.name.dir</name>
            <value>/simple/hadoop-2.4.1/hdfs/name</value>
        </property>
        <property>
            <name>dfs.data.dir</name>
            <value>/simple/hadoop-2.4.1/hdfs/data</value>
        </property>
        wq
    # vi mapred-site.xml
        <property>
            <name>mapreduce.framework.name</name>
            <value>yarn</value>
        </property>
        wq
    # vi yarn-site.xml
        <property>
            <name>yarn.resourcemanager.hostname</name>
            <value>169.254.25.128</value>
        </property>
        <property>
            <name>yarn.nodemanager.aux-services</name>
            <value>mapreduce_shuffle</value>
        </property>
        wq
    # vi /etc/profile
            HADOOP_HOME=/simple/hadoop-2.4.1
            export PATH=$JAVAHOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH
            wq
    # source /etc/profile
    # cd /simple/hadoop-2.4.1
    # mkdir tmp
    # mkdir hdfs
    # cd hdfs
    # mkdir name
    # mkdir data
    # hdfs namenode -format
    # cd /simple/hadoop-2.4.1/sbin
    # ./start-dfs.sh
    # ./start-yarn.sh
    # ./start-all.sh
    # jps
        Jps
        ResourceManager
        SecondaryNameNode
        NameNode
        NodeManager
        DataNode

5.1 测试hdfs和yarn


在浏览器地址栏输入:
http:localhost:50070(HDFS管理界面)
http:localhost:8088(MR管理界面)

【Hadoop】配置环境-伪分布式

标签:gcj   密码   5.0   jps   script   分布式配置   secondary   gre   host   

原文地址:https://www.cnblogs.com/chromer/p/123142l34f55a1241r24.html

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