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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

hadoop streaming部分问题总结

發布時間:2025/4/5 编程问答 18 豆豆
生活随笔 收集整理的這篇文章主要介紹了 hadoop streaming部分问题总结 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

來源:

https://hadoop.apache.org/docs/r1.2.1/streaming.html#Generic+Command+Options


文檔還是要好好看,中間遇到的好多問題文檔中都有。之前看的時候沒有感覺,等遇到了問題再來看,就知道是啥了。

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


一、options

hadoop streaming有兩種參數:Generic Command Options和Streaming Command Options。

注意:genericOptions要求必須放在streamingOptions前面。如:

bin/hadoop command [genericOptions] [streamingOptions]

Generic Command Options

Parameter Optional/Required Description
-conf configuration_file Optional Specify an application configuration file
-D property=value Optional Use value for given property
-fs host:port or local Optional Specify a namenode
-jt host:port or local Optional Specify a job tracker
-files Optional Specify comma-separated files to be copied to the Map/Reduce cluster
-libjars Optional Specify comma-separated jar files to include in the classpath
-archives Optional Specify comma-separated archives to be unarchived on the compute machines

Streaming Command Options

Parameter Optional/Required Description
-input directoryname or filename Required Input location for mapper
-output directoryname Required Output location for reducer
-mapper executable or JavaClassName Required Mapper executable
-reducer executable or JavaClassName Required Reducer executable
-file filename Optional Make the mapper, reducer, or combiner executable available locally on the compute nodes
-inputformat JavaClassName Optional Class you supply should return key/value pairs of Text class. If not specified, TextInputFormat is used as the default
-outputformat JavaClassName Optional Class you supply should take key/value pairs of Text class. If not specified, TextOutputformat is used as the default
-partitioner JavaClassName Optional Class that determines which reduce a key is sent to
-combiner streamingCommand or JavaClassName Optional Combiner executable for map output
-cmdenv name=value Optional Pass environment variable to streaming commands
-inputreader Optional For backwards-compatibility: specifies a record reader class (instead of an input format class)
-verbose Optional Verbose output
-lazyOutput Optional Create output lazily. For example, if the output format is based on FileOutputFormat, the output file is created only on the first call to output.collect (or Context.write)
-numReduceTasks Optional Specify the number of reducers
-mapdebug Optional Script to call when map task fails
-reducedebug Optional Script to call when reduce task fails

注意:

1, genericoption中的-files參數和streamingoptions中的-file參數。

前者為可以放多個,中間用逗號分隔,并且可以放hdfs files的地址。后者是從本地往hadoop執行目錄上傳文件。

使用的時候,-files需要放到streamingoptions(如:-input, -output等)前面。

2. ?cmdenv參數可以設定需要的環境變量

-cmdenv EXAMPLE_DIR=/home/example/dictionaries/


二、使用hdfs files地址

先把數據文件上傳的hdfs上,之后可以直接使用。

使用參數:

-files hdfs://host:fs_port/user/testfile.txt

注意:

1.?host:fs_port可以從/usr/local/hadoop/etc/hadoop/core-site.xml中,找到fs.defaultFS對應的value即可。

2. 使用的時候,直接在對應的mapper.py中,使用open("testfile.txt")即可。hadoop會創建一個連接,指向對應的文件。(?Hadoop automatically creates a symlink named testfile.txt in the current working directory of the tasks. This symlink points to the local copy of testfile.txt.


三、"No space left on device" error?

這是因為hadoop streaming中,會把需要的-file文件打成jar包上傳,如果文件很大,jar包也很大。jar包默認是放在/tmp目錄下。如果/tmp目錄空間不夠,則會報該錯誤。

更改目錄命令:

-D stream.tmpdir=/export/bigspace/...


四、在mapper.py中獲取設置的參數

加入設置:

-D mapred.reduce.tasks=1

如何在mapper.py中獲取該參數:

直接把對應的參數名中"."換成下劃線"_"即可獲得。

reducer_tasks = os.getenv(“mapred_reduce_tasks')











總結

以上是生活随笔為你收集整理的hadoop streaming部分问题总结的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 乱lun合集男男高h | 怡红院精品视频 | 色呦呦入口 | 2019国产在线| brazzers精品成人一区 | 国产美女菊爆在线播放APP | 国产高清免费在线播放 | 欧美日韩国产一区在线 | 国产精品第3页 | 国产精品亚洲二区 | 成人欧美一区二区三区黑人动态图 | 国产a毛片 | 精品日本一区二区三区 | 成人av网站在线观看 | 不卡中文 | 国产肥熟 | 秋霞7777鲁丝伊人久久影院 | 翔田千里一区 | 日韩91| 中文字幕人成人乱码亚洲电影 | 精品国产乱码久久久久久久 | 欧美日韩亚洲国产 | 国产精品视频免费在线观看 | 日韩精品在线播放 | 黑人精品xxx一区一二区 | 久久人体视频 | 成人黄色在线观看 | 欧美老熟妇又粗又大 | 国产精品一区二区三区四区在线观看 | japanesehdxxxx | 亚洲成熟少妇 | 亚洲v欧美v另类v综合v日韩v | 亚洲精品高清无码视频 | 天堂在线v| 亚洲综合网在线 | 中文字幕在线观看 | 亚洲视频123 | 岛国在线视频 | 精品视频网 | 午夜伦伦电影理论片费看 | 国产色拍| 草碰在线视频 | 婷婷六月丁| 最近免费中文字幕大全免费版视频 | 国产在线aaa | 蜜臀av免费在线观看 | 欧美日韩不卡视频 | 成人性生生活性生交全黄 | 中文字幕在线日本 | 亚洲一区二区三 | 大地资源中文在线观看免费版 | 欧美日本精品 | 亚洲色图第1页 | 亚洲a成人 | 中文资源在线播放 | 四虎国产成人永久精品免费 | 午夜激情久久 | 69视频在线 | 亚洲精品女人久久久 | 国产精品成人久久 | 综合色婷婷一区二区亚洲欧美国产 | 天天干天天天 | 91网站在线观看视频 | 国内精品久久久久久久久 | 免费观看91视频 | 中文字幕黄色av | 91黄免费| 色视频2| 日本涩涩视频 | 制服丝袜一区 | av狠狠操 | 亚洲男人天堂2019 | 狠狠操你 | 国模丫头1000人体 | www.四虎影视| 99在线免费视频 | 蜜桃传媒一区二区亚洲av | 97黄色片| 精品国产999久久久免费 | 第一次破处视频 | 国产在线视频一区 | 美女av网址| 91av精品| 人人人插 | 久久久久久久久免费 | 亚洲视频中文字幕在线观看 | 国产成人精品视频ⅴa片软件竹菊 | 人操人人| 神马午夜国产 | 区一区二视频 | 影音先锋在线播放 | 少妇人妻在线视频 | 在线a| 国产精品suv一区二区88 | 91在线免费播放 | av免费高清 | 色哟哟视频在线 | 91精品国产乱码久久久张津瑜 | k8经典成人理伦片 |