hadoop2.6.4伪分布式环境搭建

1、准备Linux环境 1.0先将虚拟机的网络模式选为NAT

  • 1.1:修改主机名
    vi /etc/sysconfig/network
    NETWORKING=yes
    HOSTNAME=liuzuwei
  • 1.2修改IP
            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  
    172.21.0.4 liuzuwei
  • 1.4关闭防火墙
    #查看防火墙状态
    service iptables status
    #关闭防火墙
    service iptables stop
    #查看防火墙开机启动状态
    chkconfig iptables --list
    #关闭防火墙开机启动
    chkconfig iptables off
  • 1.5 修改sudo
    su root
    vim /etc/sudoers
    给hadoop用户添加执行的权限
  • 1.6重启Linux
    reboot

2、安装JDK

  • 先解压JDK
  • 再将java添加到环境变量中
    vim /etc/profile
    #在文件最后添加
    export JAVA_HOME=/usr/jdk1.8.0_191
    export PATH=$PATH:$JAVA_HOME/bin

    #刷新配置
    source /etc/profile

3、安装hadoop2.6.4

  • 第一个:hadoop-env.sh
    #第27行
    export JAVA_HOME=/usr/jdk1.8.0_191
  • 第二个:core-site.xml
        

            
                fs.defaultFS
                hdfs://liuzuwei:9000
            
            
        
            
                hadoop.tmp.dir
                /home/hadoop/hadoop-2.6.4/tmp
            
  • 第三个:hdfs-site.xml
           
        
            
                dfs.replication
                1
            

            
                dfs.secondary.http.address
                liuzuwei:50090
            
  • 第四个:mapred-site.xml

        
            mapreduce.framework.name
            yarn
        
  • 第五个:yarn-site.xml
            
                yarn.resourcemanager.hostname
                liuzuwei
            
            
            
            
                yarn.nodemanager.aux-services
                mapreduce_shuffle
            
            
            
                yarn.resourcemanager.webapp.address
                liuzuwei:8080
            

你可能感兴趣的:(hadoop2.6.4伪分布式环境搭建)