Hadoop安装
Hadoop安装
bluntFish 发表于6个月前
Hadoop安装
  • 发表于 6个月前
  • 阅读 70
  • 收藏 1
  • 点赞 0
  • 评论 0

标题:腾讯云 新注册用户域名抢购1元起>>>   

  1.  
  2. 下载“hadoop-3.0.0-alpha4.tar.gz”,放到/home/hadoop目录下。下载地址:http://hadoop.apache.org
  3. 解压,输入命令,tar -xzvf hadoop-3.0.0-alpha4.tar.gz
  4. 在/home/hadoop目录下创建数据存放的文件夹,tmp、hdfs、hdfs/data、hdfs/name
  5. 配置/home/hadoop/hadoop-3.0.0-alpha4/etc/hadoop目录下的core-site.xml
  6.  <configuration>
        <property>
            <name>fs.defaultFS</name>
            <value>hdfs://172.17.0.2:9000</value>
        </property>
        <property>
            <name>hadoop.tmp.dir</name>
            <value>file:/home/hadoop/tmp</value>
        </property>
        <property>
            <name>io.file.buffer.size</name>
            <value>131702</value>
        </property>
     </configuration>

    配置/home/hadoop/hadoop-3.0.0-alpha4/etc/hadoop目录下的hdfs-site.xml

  7. <configuration>
        <property>
            <name>dfs.namenode.name.dir</name>
            <value>file:/home/hadoop/dfs/name</value>
        </property>
        <property>
            <name>dfs.datanode.data.dir</name>
            <value>file:/home/hadoop/dfs/data</value>
        </property>
        <property>
            <name>dfs.replication</name>
            <value>2</value>
        </property>
        <property>
            <name>dfs.namenode.secondary.http-address</name>
            <value>172.17.0.2:9001</value>
        </property>
        <property>
        <name>dfs.webhdfs.enabled</name>
        <value>true</value>
        </property>
     </configuration>

    配置/home/hadoop/hadoop-3.0.0-alpha4/etc/hadoop目录下的mapred-site.xml

  8.  <configuration>
        <property>
            <name>mapreduce.framework.name</name>
            <value>yarn</value>
        </property>
        <property>
            <name>mapreduce.jobhistory.address</name>
            <value>172.17.0.2:10020</value>
        </property>
        <property>
            <name>mapreduce.jobhistory.webapp.address</name>
            <value>172.17.0.2:19888</value>
        </property>
     </configuration>

    配置/home/hadoop/hadoop-3.0.0-alpha4/etc/hadoop目录下的yarn-site.xml

  9.  <configuration>
        <property>
            <name>yarn.nodemanager.aux-services</name>
            <value>mapreduce_shuffle</value>
        </property>
        <property>
            <name>yarn.nodemanager.auxservices.mapreduce.shuffle.class</name>
            <value>org.apache.hadoop.mapred.ShuffleHandler</value>
        </property>
        <property>
            <name>yarn.resourcemanager.address</name>
            <value>172.17.0.2:8032</value>
        </property>
        <property>
            <name>yarn.resourcemanager.scheduler.address</name>
            <value>172.17.0.2:8030</value>
        </property>
        <property>
            <name>yarn.resourcemanager.resource-tracker.address</name>
            <value>172.17.0.2:8031</value>
        </property>
        <property>
            <name>yarn.resourcemanager.admin.address</name>
            <value>172.17.0.2:8033</value>
        </property>
        <property>
            <name>yarn.resourcemanager.webapp.address</name>
            <value>172.17.0.2:8088</value>
        </property>
        <property>
            <name>yarn.nodemanager.resource.memory-mb</name>
            <value>768</value>
        </property>
     </configuration>

    配置/home/hadoop/hadoop-2.7.0/etc/hadoop目录下hadoop-env.sh、yarn-env.sh的JAVA_HOME,不设置的话,启动不了,

    export JAVA_HOME=/home/java/jdk1.7.0_79

     

  10. 配置/home/hadoop/hadoop-2.7.0/etc/hadoop目录下的workers(注意,老版本中这里似乎 是slaves),删除默认的localhost,增加2个从节点:

    172.17.0.3
    172.17.0.4

     

 11、配置用户,在start-dfs.sh与stop-dfs.sh文件中增加:

HDFS_DATANODE_USER=root
HADOOP_SECURE_DN_USER=hdfs
HDFS_NAMENODE_USER=root
HDFS_SECONDARYNAMENODE_USER=root

    如果不加如上配置,则会出现如下错误:

[root@deb3b84de619 hadoop-3.0.0-alpha4]# sbin/start-all.sh
Starting namenodes on [localhost]
ERROR: Attempting to launch hdfs namenode as root
ERROR: but there is no HDFS_NAMENODE_USER defined. Aborting launch.
Starting datanodes
ERROR: Attempting to launch hdfs datanode as root
ERROR: but there is no HDFS_DATANODE_USER defined. Aborting launch.
Starting secondary namenodes [VM_128_191_centos]
ERROR: Attempting to launch hdfs secondarynamenode as root
ERROR: but there is no HDFS_SECONDARYNAMENODE_USER defined. Aborting launch.

 

标签: Hadoop
共有 人打赏支持
粉丝 1
博文 13
码字总数 2116
×
bluntFish
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: