


下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、基于hadoop的大規模文本處理技術實驗專業班級:軟件1102學生姓名:張國宇學號:Setup Hadoop on Ubuntu 11.04 64-bit提示:前面的putty軟件安裝省略;直接進入 JDK的安裝。1.1 nstall Sun JDK由于Sun JDK在ubuntu的軟件中心中無法找到,我們必須使用外部的PPA翻開終端并且運行以下命令:sudo add-apt-repository ppa:ferramroberto/javasudo apt-get updatesudo apt-get in stall sun-java6-b insudo apt-get in stall
2、sun-java6-jdkAdd JAVA_HOME variablev配置環境變量 :先輸入粘貼下面文字:sudo vi /etc/e nvir onment再將下面的文字輸入進去:按i鍵添加,esc鍵退出,X保存退出;如下列圖:export JAVA_HOME=/usr/lib/jvm/java-6-su n-1.6.0.26Test the success of installation in Terminal:sudo . /etc/e nvir onment java - vers ion2. Check SSH Sett in g ssh localhost 如果出現“ conne
3、ction refused ,你最好重新安裝 ssh 如下命令可以安裝 : sudo apt-get install openssh-server openssh-client 如果你沒有通行證 ssh 到主機,執行下面的命令:ssh-keygen -t dsa -P -f /.ssh/id_dsacat /.ssh/id_dsa.pub /.ssh/authorized_keys3. Setup Hadoop安裝 apache2sudo apt-get install apache2 下載 hadoop:解壓 hadoop 所下載的文件包:下載最近的一個穩定版本,解壓。編輯 / hadoop
4、-env.sh 定義 java_home “use/library/java-6-sun-1.6.0.26 作為 hadoop 的根目錄:Sudo vi conf/hadoop-env.sh 將以下內容加到文件最后: # The java implementation to use. Required. export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26 Pseudo-Distributed Operation Single-Node Cluster:將下面中間局部插入: 得到如圖:cat conf/core-site.xml: cat conf
5、/hdfs-site.xml:dfs.replication1cat conf/mapred-site.xml:localhost:9001Switch to hadoop root directory and format a new distributedfile system:bin/hadoop namenode - format注意:這一步一定不能掉,否那么后面會出錯!Youll get info like“Storage directory /tmp/hadoop -ubuntu/dfs/namehas been successfully formatted. Remember t
6、his path is the HDFS home directory of namenode. 你會得到提示:你已經成功格式化。 Start and stop hadoop daemons 啟動和終止進程。 :bin/start-all.sh (start the hadoop)bin/stop-all.sh (stop the hadoop)Web interfaces for the NameNode and the JobTracker:NameNode-提示:如果前面沒有格式化成功,這個網址會出現就不去的現象! !如果進不去就先結束進程,重新格式化然后再開始進程。JobTracker
7、 -4. Deploy An Example Map-Reduce Job 創立路徑 /home/ubuntu/mapreduce/wordcount/ ,并在該目錄下放置文本文件 worldcou nt.txt 。然后將這些文件復制到 HDFS目錄:bin/hadoop dfs -copyFromLocal /home/ubuntu/mapreduce/wordcount/tmp/hadoop-ubuntu/dfs/name/wordcountbin/hadoop dfs -ls /tmp/hadoop-ubuntu/dfs/name/wordcountRun the job:bin/had
8、oop jar hadoop*examples*.jar wordcount/tmp/hadoop-ubuntu/dfs/name/wordcount/tmp/hadoop-ubuntu/dfs/name/wordcount-outputIf the output info looks no problem, copy the output file from HDFS tolocal directoryv如果輸出信息看起來沒有問題,從 HDFS輸出復制文件到本地目錄的: :bin/hadoop dfs -getmerge /tmp/hadoop-ubuntu/dfs/name/wordcount-output/home/ubuntu/mapreduce/wordcount/Now you can open the output file in your local directory to view theresults 實驗總結:1、在實驗過程中,發現對
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
評論
0/150
提交評論