mac osx 系統 brew install hadoop 安裝指南

mac osx 系統 brew  install hadoop 安裝指南
 
  1. brew install hadoop 
  2. 配置 core-site.xml:配置hdfs文件地址(記得chmod 對應文件夾,不然沒法正常啓動hdfs)和namenode的rpc通行端口
  3. 配置mapred-site.xml  中的map reduce通訊端口
  4. 配置hdfs-site.xml 中的datanode 副本數。
  5. 格式化hdfs文件系統
  6. 啓動Hadoop 和 yarn  namenode  datanode  mapred , 即:運行 start_all.sh
  7. (可選)在hdfs中建立當前用戶的地址:  hadoop fs -mkdir -p /user/fan
  8. 開工,web ui 地址默認爲:http://localhost:50070。
 
 
遇到的問題:
一, 如在hdfs -put ~/file  fileonhdfs 時, 出現error:WARN org.apache.hadoop.hdfs.server.datanode.DataNode: Invalid directory in dfs.data.dir
          緣由是:
  1.   core-site.xml中設置的文件系統已滿,需從新設置,並再次-format。
  2.   core-site.xml中設置的hdfs文件系統所在文件夾須要chmod 777 
 
二, 如在hadoop fs -ls . 命令時出現: ls: '.': No such file or directory'
  1. 請執行: 
    hadoop fs -mkdir -p /user/[current login user]
 
 
 
配置文件demo:
 

配置core-site.xml、hdfs-site.xml、mapred-site.xmlhtml

* core-site.xml:node

 

Xml代碼   收藏代碼
  1. <configuration>  
  2.    
  3. <property>  
  4.   <name>hadoop.tmp.dir</name>  
  5.   <value>/usr/local/tmp/hadoop/hadoop-${user.name}</value>  
  6.   <description>A base for other temporary directories.</description>  
  7. </property>  
  8.    
  9. <property>  
  10.         <name>fs.default.name</name>  
  11.         <value>hdfs://localhost:8020</value>  
  12. </property>  
  13.    
  14. </configuration>  

 

 

* hdfs-site.xml:web

 

Xml代碼   收藏代碼
  1. <configuration>  
  2.    
  3.     <property>  
  4.         <name>dfs.replication</name>  
  5.         <value>1</value>  
  6.     </property>  
  7.    
  8. </configuration>  

 

 

* mapred-site.xml:apache

 

Xml代碼   收藏代碼
  1. <configuration>  
  2.    
  3.     <property>  
  4.         <name>mapred.job.tracker</name>  
  5.         <value>localhost:8021</value>  
  6.     </property>  
  7.    
  8.     <property>  
  9.           
  10. </configuration>  

 

 

其實這些都是基本配置, 網上一大把。配置的值的說明能夠參考這3個地址:oop

 

 寫道
http://hadoop.apache.org/common/docs/r0.20.2/core-default.html
http://hadoop.apache.org/common/docs/r0.20.2/hdfs-default.html
http://hadoop.apache.org/common/docs/r0.20.0/mapred-default.html

 

 

2.3)格式化hadoop的文件系統hdfs。 執行命令 hadoop namenode -format 
相關文章
相關標籤/搜索