Linux(CentOS)下偽分布模式安裝Hadoop__Linux

來源:互聯網
上載者:User
一、下載  
下載地址: http://apache.etoak.com/hadoop/common/  
開啟會發現不同版本,我這裡選擇的是:hadoop-1.0.3.tar.gz 
下載位置到:/data/software 

二、安裝  
利用命令tar解壓縮安裝,解壓結果如下: 

Shell代碼  [root@SC-026 ~]# cd /data/software/   [root@SC-026 software]# tar xvf hadoop-1.0.3.tar.gz  

如果JAVA_HOME環境變數已經指向一個java安裝,則不需要進行配置。 
Shell代碼  [root@SC-026 software]# echo $JAVA_HOME   /usr/java/jdk1.7.0_01  

否則,編輯../conf/hadoop-env.sh檔案來設定JAVA_HOME變數 
Shell代碼  [root@SC-026 software]# cd hadoop-1.0.3/conf   [root@SC-026 conf]# vim hadoop-env.sh   
本機中是如下編輯: 
Shell代碼  export JAVA_HOME=/usr/java/jdk1.7.0_01   export HADOOP_HOME=//data/software/hadoop-1.0.3   export PATH=$PATH:$HADOOP_HOME/bin  
:wq儲存,退出。 

三、配置  
Hadoop的各個組件均可利用xml檔案配置。 
core-site.xml: 用於配置Common組件的屬性; 
hdfs-site.xml: 用於配置HDFS屬性; 
mapred-site.xml: 用於配置MapReduce屬性。 
這些設定檔都在以下路徑中: 
Shell代碼  [root@SC-026 conf]# ls   capacity-scheduler.xml  hadoop-env.sh~              mapred-site.xml   configuration.xsl       hadoop-metrics2.properties  masters   core-site.xml           hadoop-policy.xml           slaves   core-site.xml~          hdfs-site.xml               ssl-client.xml.example   fair-scheduler.xml      log4j.properties            ssl-server.xml.example   hadoop-env.sh           mapred-queue-acls.xml       taskcontroller.cfg  

通過vim依次開啟3個檔案,配置如下: 

Xml代碼  [root@SC-026 conf]# vim core-site.xml   <?xml version="1.0"?>   <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>      <!-- Put site-specific property overrides in this file. -->     
<configuration>           <property>                   <name>fs.default.name</name>                   <value>hdfs://localhost</value>           </property>   </configuration>  

Xml代碼  [root@SC-026 conf]# vim hdfs-site.xml    <?xml version="1.0"?>   <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>     

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.