当前位置:   article > 正文

Hadoop-2.6.5报错STDERR: mkdir: Cannot create directory /user/.../files. Name node is in safe mode._err mkdir

err mkdir

使用Python的MrJob写了MapReduce任务后,运行MapReduce任务的时候报错如下:经过排查发现,这是由于hadoop刚刚启动,还处于安全模式下,因此执行MapReduce任务会报错,等待一会,待hadoop安全正常的启动后,再执行同样的任务,就正常了。

如果还是报同样的错误,那么你可以离开安全模式,操作方法如下:bin/hadoop dfsadmin -safemode leave。

dfsadmin常用命令如下:leave(离开安全模式)、enter(进入安全模式)、get(获取当前模式状态)、wait(等待,知道安全模式结束)。

  1. # python /home/test/hadoop/httpflow.py -r hadoop --jobconf mapreduce.job.priority=VERY_HIGH -o hdfs://data/hadoop/output/httpflow hdfs:///data/hadoop/data/tmp20180802
  2. No configs found; falling back on auto-configuration
  3. No configs specified for hadoop runner
  4. Looking for hadoop binary in $PATH...
  5. Found hadoop binary: /usr/local/soft/hadoop-2.6.5/bin/hadoop
  6. Using Hadoop version 2.6.5
  7. Looking for Hadoop streaming jar in /usr/local/soft/hadoop-2.6.5...
  8. Found Hadoop streaming jar: /usr/local/soft/hadoop-2.6.5/share/hadoop/tools/lib/hadoop-streaming-2.6.5.jar
  9. Creating temp directory /tmp/httpflow.root.20180802.023651.138363
  10. STDERR: mkdir: Cannot create directory /user/root/tmp/mrjob/httpflow.root.20180802.023651.138363/files. Name node is in safe mode.
  11. Traceback (most recent call last):
  12. File "/root/.virtualenvs/env3/lib/python3.6/site-packages/mrjob/fs/hadoop.py", line 286, in mkdir
  13. self.invoke_hadoop(args, ok_stderr=[_HADOOP_FILE_EXISTS_RE])
  14. File "/root/.virtualenvs/env3/lib/python3.6/site-packages/mrjob/fs/hadoop.py", line 173, in invoke_hadoop
  15. raise CalledProcessError(proc.returncode, args)
  16. subprocess.CalledProcessError: Command '['/usr/local/soft/hadoop-2.6.5/bin/hadoop', 'fs', '-mkdir', '-p', 'hdfs:///user/root/tmp/mrjob/httpflow.root.20180802.023651.138363/files/']' returned non-zero exit status 1.
  17. During handling of the above exception, another exception occurred:

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/699196
推荐阅读
相关标签
  

闽ICP备14008679号