日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

搭建hadoop开发环境--基于xp+cygwin

發布時間:2023/11/29 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 搭建hadoop开发环境--基于xp+cygwin 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

2019獨角獸企業重金招聘Python工程師標準>>>

1.安裝cygwin

?參考博文:http://hi.baidu.com/%BD%AB%D6%AE%B7%E7_%BE%B2%D6%AE%D4%A8/blog/item/8832551c7598551f314e15c2.html??

?? ??? Q1.實際安裝中在第9步 打開cygwin進行配置,首先輸入:ssh-host-config.回車。會讓你輸入yes/no輸入no。回車。見到Have fun!就說明成功了”有些不同

Administrator@03ad6b3ba2f34fe ~ $ ssh-host-config*** Info: Generating /etc/ssh_host_key *** Info: Generating /etc/ssh_host_rsa_key *** Info: Generating /etc/ssh_host_dsa_key *** Info: Generating /etc/ssh_host_ecdsa_key *** Info: Creating default /etc/ssh_config file *** Info: Creating default /etc/sshd_config file *** Info: Privilege separation is set to yes by default since OpenSSH 3.3. *** Info: However, this requires a non-privileged account called 'sshd'. *** Info: For more info on privilege separation read /usr/share/doc/openssh/README.privsep. *** Query: Should privilege separation be used? (yes/no) no *** Info: Updating /etc/sshd_config file *** Info: Added ssh to C:\WINDOWS\system32\driversc\services*** Query: Do you want to install sshd as a service? *** Query: (Say "no" if it is already installed as a service) (yes/no) yes *** Query: Enter the value of CYGWIN for the daemon: [] --直接敲回車*** Info: The sshd service has been installed under the LocalSystem *** Info: account (also known as SYSTEM). To start the service now, call *** Info: `net start sshd' or `cygrunsrv -S sshd'. Otherwise, it *** Info: will start automatically after the next reboot.*** Info: Host configuration finished. Have fun!

????? Q2. 第一次安裝中電腦死機,當時執行到創建圖標的步驟,已經可以運行了,但是還是想重裝一遍。于是找卸載辦法,有人說用setup那個文件,把選中的都uninstall一下,我信了然后就悲劇了,卸不干凈。然后找完美卸載的辦法,嘗試了一個"刪除所有cygwin的文件夾,然后清理注冊表中有cygwin的項" 這次OK了。千萬別用setup去卸載!!

2.安裝jdk和eclipse,這部分沒有遇到問題,畢業java程序也寫了1年多了

3.hadoop配置

????? 參考博文:http://hi.baidu.com/%BD%AB%D6%AE%B7%E7_%BE%B2%D6%AE%D4%A8/blog/item/a0ebb1db953a772033fa1c9a.html

?????? Q1.順著博主的第四步./hadoop jar ./../hadoop-0.20.2-examples.jar wordcount testin testout的時候開始報錯

INFO input.FileInputFormat: Total input paths to process : 2 INFO mapred.JobClient: Running job: job_201202131412_0007 INFO mapred.JobClient: map 0% reduce 0% INFO mapred.JobClient: Task Id : attempt_201202131412_0007_m_0 00003_0, Status : FAILED java.io.FileNotFoundException: File D:/hadoop/temp/taskTracker/jobcache/job_2012 02131412_0007/attempt_201202131412_0007_m_000003_0/work/tmp does not exist.at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSys tem.java:361)at

沒錯,博文下留言的人就是俺。這個錯誤怎么看都是找不到文件,上網找到了一個解決辦法,就是在mapred-site.xml文件中修改

<property><name>mapred.child.tmp</name><value>/hadoop/tmp</value>


后來的操作就一直OK了。

4.常用的命令
ssh localhost? 登錄
cd /cygdriver/d/hadoop-0.20.2 進入目錄
ls? 查看當前目錄下的所有文件
在/cygdrive/d/hadoop-0.20.2/bin目錄下
./start-all.sh??? 啟動
./hadoop namenode -format 格式化一個新的HDFS
./start-all.sh? 同時啟動HDFS和MAP/Reduce
./hadoop dfs -mkdir testin 創建目錄testin
./hadoop dfs -put /test/*.jav0a testin 把test目錄下的java文件全部復制到testin中
./hadoop dfs -ls testin 查看testin中的所有文件
./hadoop dfs -rmr testout? 刪除testout文件夾
./hadoop jar ./../hadoop-0.20.2-examples.jar wordcount testin testout
./hadoop dfs -cat testout/part-r-00000 查看testout文件夾下的part-r-00000文件

================================

遺留的問題

1. 好多人的博客中都寫到hadoop0.20.2版本會遇到很多問題,“在windows用cygwin配置hadoop環境的時候一定要選擇0.19.2的版本”。這個我暫時沒遇到,另外提供0.19.2的下載鏈接,需要的自己下載:http://archive.apache.org/dist/hadoop/core/hadoop-0.19.2/? 我也上傳到了csdn? 或者可以留個郵箱我發給你

2. 在cygwin上跑起來沒問題的wordCount,在eclipse下跑著總有問題,和最初遇到那個問題一樣,找不到文件。這個還需要進一步解決

注.參考的文檔:http://wildrain.iteye.com/blog/1164608

?

---低頭拉車,抬頭看路

?

?

轉載于:https://my.oschina.net/wangjiankui/blog/40629

總結

以上是生活随笔為你收集整理的搭建hadoop开发环境--基于xp+cygwin的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。