Hadoop 군집 환경 구축

7187 단어 빅 데이터
1.  Linux  (**                   ,      1 ,        **)
    1.0  VMware    ,           ->   vmnetcfg.exe -> VMnet1 host-only ->  subnet ip     :192.168.1.0     :255.255.255.0 -> apply -> ok
          windows -->           ->         ->   VMnet1 ->    ->   IPv4 ->   windows IP:192.168.1.100     :255.255.255.0 ->     
               --My Computer ->       ->    -> settings -> network adapter -> host only -> ok   
    1.1     
        vim /etc/sysconfig/network

        NETWORKING=yes
        HOSTNAME=itcast    ###

    1.2  IP
            :
           :  Linux        (    )
              Linux     ->               ->   Edit connections ->       System eth0 ->   edit   ->   IPv4 -> method   manual ->   add   ->   IP:192.168.1.101     :255.255.255.0   :192.168.1.1 -> apply

           :        (       )
            vim /etc/sysconfig/network-scripts/ifcfg-eth0

            DEVICE="eth0"
            BOOTPROTO="static"               ###
            HWADDR="00:0C:29:3C:BF:E7"
            IPV6INIT="yes"
            NM_CONTROLLED="yes"
            ONBOOT="yes"
            TYPE="Ethernet"
            UUID="ce22eeca-ecde-4536-8cc2-ef0dc36d4a8c"
            IPADDR="192.168.1.101"           ###
            NETMASK="255.255.255.0"          ###
            GATEWAY="192.168.1.1"            ###

    1.3      IP     
        vim /etc/hosts

        192.168.1.101   itcast

    1.4     
        #       
        service iptables status
        #     
        service iptables stop
        #           
        chkconfig iptables --list
        #         
        chkconfig iptables off

    1.5  Linux
        reboot

2.  JDK
    2.1  alt+p    sftp  ,  put d:\xxx\yy\ll\jdk-7u_65-i585.tar.gz

    2.2  jdk
        #     
        mkdir /home/hadoop/app
        #  
        tar -zxvf jdk-7u55-linux-i586.tar.gz -C /home/hadoop/app

    2.3 java        
        vim /etc/profile
        #       
        export JAVA_HOME=/home/hadoop/app/jdk-7u_65-i585
        export PATH=$PATH:$JAVA_HOME/bin

        #    
        source /etc/profile

3.  hadoop2.4.1
       hadoop          /home/hadoop/
      :hadoop2.x     $HADOOP_HOME/etc/hadoop
            5     
    3.1  hadoop(     Hadoop     。。。)
       :hadoop-env.sh
        vim hadoop-env.sh
        # 27 
        export JAVA_HOME=/usr/java/jdk1.7.0_65

       :core-site.xml

        
        <property>
            <name>fs.defaultFSname>
            <value>hdfs://weekend-1206-01:9000value>
        property>
        
        <property>
            <name>hadoop.tmp.dirname>
            <value>/home/hadoop/hadoop-2.4.1/tmpvalue>
    property>

       :hdfs-site.xml   hdfs-default.xml  (3)
        
        <property>
            <name>dfs.replicationname>
            <value>1value>
    property>

       :mapred-site.xml (mv mapred-site.xml.template mapred-site.xml)
        mv mapred-site.xml.template mapred-site.xml
        vim mapred-site.xml
        
        <property>
            <name>mapreduce.framework.namename>
            <value>yarnvalue>
    property>

       :yarn-site.xml
        
        <property>
            <name>yarn.resourcemanager.hostnamename>
            <value>weekend-1206-01value>
    property>
        
    <property>
            <name>yarn.nodemanager.aux-servicesname>
            <value>mapreduce_shufflevalue>
     property>

    3.2 hadoop       

    vim /etc/proflie
        export JAVA_HOME=/usr/java/jdk1.7.0_65
        export HADOOP_HOME=/itcast/hadoop-2.4.1
        export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HADOOP_HOME/sbin

    source /etc/profile

    3.3   namenode(  namenode     )
        hdfs namenode -format (hadoop namenode -format)

    3.4  hadoop
           HDFS
        sbin/start-dfs.sh

           YARN
        sbin/start-yarn.sh

    3.5        
          jps    
        27408 NameNode
        28218 Jps
        27643 SecondaryNameNode
        28066 NodeManager
        27803 ResourceManager
        27512 DataNode

        http://192.168.1.101:50070 (HDFS    )
        http://192.168.1.101:8088 (MR    )

4.  ssh   
    #  ssh     
    #     home  
    cd ~/.ssh

    ssh-keygen -t rsa (    )
            ,       id_rsa(  )、id_rsa.pub(  )
                  
    ssh-copy-id localhost

좋은 웹페이지 즐겨찾기