1. 程式人生 > >hadoop2.7.7 測試安裝 centos7

hadoop2.7.7 測試安裝 centos7

useradd –m hadoop –s /bin/bash

passwd hadoop   增加sudo許可權 chmod u+w /etc/sudoers vi /etc/sudoers root    ALL=(ALL)       ALL

hadoop ALL=(ALL) ALL

chmod u-w /etc/sudoers
    su hadoop && cd ~   wget http://mirror.bit.edu.cn/apache/hadoop/common/hadoop-2.7.7/hadoop-2.7.7.tar.gz   tar -zxf hadoop-2.7.7.tar.gz sudo mkdir /usr/local/hadoop sudo mv hadoop-2.7.7 /usr/local/hadoop mkdir dfs mkdir dfs/name mkdir dfs/data mkdir tmp   cd /usr/local/hadoop/hadoop-2.7.7/etc/hadoop   涉及到的配置檔案有7個:

安裝路徑/hadoop-2.7.7/etc/hadoop/hadoop-env.sh

安裝路徑/hadoop-2.7.7/etc/hadoop/yarn-env.sh

安裝路徑/hadoop-2.7.7/etc/hadoop/slaves

安裝路徑/hadoop-2.7.7/etc/hadoop/core-site.xml

安裝路徑/hadoop-2.7.7/etc/hadoop/hdfs-site.xml

安裝路徑/hadoop-2.7.7/etc/hadoop/mapred-site.xml

安裝路徑/hadoop-2.7.7/etc/hadoop/yarn-site.xml
=== cat core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
      <property>
               <name>fs.defaultFS</name>
               <value>hdfs://localhost:8020</value>
      </property>
      <property>
               <name>io.file.buffer.size</name>
               <value>131072</value>
       </property>
      <property>
              <name>hadoop.tmp.dir</name>
               <value>file:/home/hadoop/tmp</value>
              <description>Abase for other temporary   directories.</description>
      </property>
       <property>
               <name>hadoop.proxyuser.hadoop.hosts</name>
              <value>*</value>
      </property>
      <property>
               <name>hadoop.proxyuser.hadoop.groups</name>
              <value>*</value>
      </property>
</configuration> === cat hdfs-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
       <property>
               <name>dfs.namenode.secondary.http-address</name>
              <value>localhost:9001</value>
       </property>
     <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>3</value>
        </property>
        <property>
                 <name>dfs.webhdfs.enabled</name>
                 <value>true</value>
         </property>
</configuration>
=== cp mapred-site.xml.template mapred-site.xml