Hadoop streaming: Exception in thread main java.io.IOException: No space left on device
在使用Hadoop streaming時,遇到報錯如標題:
packageJobJar: [mapper_sim.py, reducer_sim.py, XXX files, /tmp/hadoop-unjar2957146529644350496/] [] /tmp/? streamjob2631394570007422828.jar tmpDir=null
Exception in thread "main" java.io.IOException: No space left on device
查看原因,主要是因為,Hadoop streaming時,把需要的文件打包成jar,放在/tmp目錄中。在任務較多,并且文件較大的時候,/tmp目錄超額,導致no space出錯。
查了一圈stackoverflow什么的,有好多都沒說到點子上,有些靠譜的是說“清空/tmp目錄就好了”,但對我并不適合。所以,需要設定生成臨時文件的目錄位置。
又查了一圈,指向這里:
https://hadoop.apache.org/docs/r1.2.1/streaming.html#Specifying+Configuration+Variables+with+the+-D+Option
===============================================================
Exception in thread "main" java.io.IOException: No space left on device
Specifying Directories
To change the local temp directory use:
-D dfs.data.dir=/tmpTo specify additional local temp directories use:
-D mapred.local.dir=/tmp/local-D mapred.system.dir=/tmp/system-D mapred.temp.dir=/tmp/temp Exception in thread "main" java.io.IOException: No space left on device===============================================================
結果試了還是不行,沒有一個起作用。我還猜測是不是和jar包中的設置沖突了,結果看到“Frequently Asked Questions”部分,發現已經有答案了。。。
如下:
Exception in thread "main" java.io.IOException: No space left on device
What do I do if I get the "No space left on device" error??
For example, when I run a streaming job by distributing large executables (for example, 3.6G) through the -file option, I get a "No space left on device" error. ?The jar packaging happens in a directory pointed to by the configuration variable stream.tmpdir.?
The default value of stream.tmpdir is /tmp. Set the value to a directory with more space:?
?-D stream.tmpdir=/export/bigspace/...
總結
以上是生活随笔為你收集整理的Hadoop streaming: Exception in thread main java.io.IOException: No space left on device的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql中与null值不能比较
- 下一篇: hadoop streaming部分问题