- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在使用 cloudera 虚拟机。这是我的文件结构:
[cloudera@quickstart pydoop]$ hdfs dfs -ls -R /input
drwxr-xr-x - cloudera supergroup 0 2015-10-02 15:00 /input/test1
-rw-r--r-- 1 cloudera supergroup 62 2015-10-02 15:00 /input/test1/file1.txt
drwxr-xr-x - cloudera supergroup 0 2015-10-02 14:59 /input/test2
-rw-r--r-- 1 cloudera supergroup 1428841 2015-10-02 14:59 /input/test2/5000-8.txt
-rw-r--r-- 1 cloudera supergroup 674570 2015-10-02 14:59 /input/test2/pg20417.txt
-rw-r--r-- 1 cloudera supergroup 1573151 2015-10-02 14:59 /input/test2/pg4300.txt
这是我执行 wordcount 示例的代码:
python /home/cloudera/MapReduceCode/mrjob/wordcount1.py -r hadoop hdfs://input/test1/file1.txt
它因以下内容而崩溃。好像找不到文件。
[cloudera@quickstart hadoop]$ python /home/cloudera/MapReduceCode/mrjob/wordcount1.py -r hadoop hdfs://input/test1/file1.txt
no configs found; falling back on auto-configuration
no configs found; falling back on auto-configuration
Traceback (most recent call last):
File "/home/cloudera/MapReduceCode/mrjob/wordcount1.py", line 13, in <module>
MRWordCount.run()
File "/usr/local/lib/python2.7/site-packages/mrjob/job.py", line 461, in run
mr_job.execute()
File "/usr/local/lib/python2.7/site-packages/mrjob/job.py", line 479, in execute
super(MRJob, self).execute()
File "/usr/local/lib/python2.7/site-packages/mrjob/launch.py", line 153, in execute
self.run_job()
File "/usr/local/lib/python2.7/site-packages/mrjob/launch.py", line 216, in run_job
runner.run()
File "/usr/local/lib/python2.7/site-packages/mrjob/runner.py", line 470, in run
self._run()
File "/usr/local/lib/python2.7/site-packages/mrjob/hadoop.py", line 233, in _run
self._check_input_exists()
File "/usr/local/lib/python2.7/site-packages/mrjob/hadoop.py", line 247, in _check_input_exists
if not self.path_exists(path):
File "/usr/local/lib/python2.7/site-packages/mrjob/fs/composite.py", line 78, in path_exists
return self._do_action('path_exists', path_glob)
File "/usr/local/lib/python2.7/site-packages/mrjob/fs/composite.py", line 54, in _do_action
return getattr(fs, action)(path, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/mrjob/fs/hadoop.py", line 212, in path_exists
ok_stderr=[_HADOOP_LS_NO_SUCH_FILE])
File "/usr/local/lib/python2.7/site-packages/mrjob/fs/hadoop.py", line 86, in invoke_hadoop
proc = Popen(args, stdout=PIPE, stderr=PIPE)
File "/usr/local/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "/usr/local/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
最佳答案
请在 Cloudera Quickstart VM
上按照以下步骤使其正常工作。
确保 HADOOP_HOME
已设置。
export HADOOP_HOME=/usr/lib/hadoop
创建 symlink
到 **hadoop-streaming.jar
sudo ln -s/usr/lib/hadoop-mapreduce/hadoop-streaming.jar/usr/lib/hadoop
使用 hdfs:///
而不是 hdfs://
python/home/cloudera/MapReduceCode/mrjob/wordcount1.py -r hadoop hdfs:///input/test1/file1.txt
下面是 my cloudera quickstart VM
的完整 mrjob
结果。
注意:wordcount1.py 和 file1.txt 的位置与您的不同,但没关系。
[cloudera@quickstart ~]$ python wordcount1.py -r hadoop hdfs:///user/cloudera/file1.txt
no configs found; falling back on auto-configuration
no configs found; falling back on auto-configuration
creating tmp directory /tmp/wordcount1.cloudera.20151011.115958.773999
writing wrapper script to /tmp/wordcount1.cloudera.20151011.115958.773999/setup-wrapper.sh
Using Hadoop version 2.6.0
Copying local files into hdfs:///user/cloudera/tmp/mrjob/wordcount1.cloudera.20151011.115958.773999/files/
PLEASE NOTE: Starting in mrjob v0.5.0, protocols will be strict by default. It's recommended you run your job with --strict-protocols or set up mrjob.conf as described at https://pythonhosted.org/mrjob/whats-new.html#ready-for-strict-protocols
HADOOP: packageJobJar: [] [/usr/jars/hadoop-streaming-2.6.0-cdh5.4.2.jar] /tmp/streamjob3860196653022444549.jar tmpDir=null
HADOOP: Connecting to ResourceManager at quickstart.cloudera/127.0.0.1:8032
HADOOP: Connecting to ResourceManager at quickstart.cloudera/127.0.0.1:8032
HADOOP: Total input paths to process : 1
HADOOP: number of splits:2
HADOOP: Submitting tokens for job: job_1444564543695_0003
HADOOP: Submitted application application_1444564543695_0003
HADOOP: The url to track the job: http://quickstart.cloudera:8088/proxy/application_1444564543695_0003/
HADOOP: Running job: job_1444564543695_0003
HADOOP: Job job_1444564543695_0003 running in uber mode : false
HADOOP: map 0% reduce 0%
HADOOP: map 100% reduce 0%
HADOOP: map 100% reduce 100%
HADOOP: Job job_1444564543695_0003 completed successfully
HADOOP: Counters: 49
HADOOP: File System Counters
HADOOP: FILE: Number of bytes read=105
HADOOP: FILE: Number of bytes written=356914
HADOOP: FILE: Number of read operations=0
HADOOP: FILE: Number of large read operations=0
HADOOP: FILE: Number of write operations=0
HADOOP: HDFS: Number of bytes read=322
HADOOP: HDFS: Number of bytes written=32
HADOOP: HDFS: Number of read operations=9
HADOOP: HDFS: Number of large read operations=0
HADOOP: HDFS: Number of write operations=2
HADOOP: Job Counters
HADOOP: Launched map tasks=2
HADOOP: Launched reduce tasks=1
HADOOP: Data-local map tasks=2
HADOOP: Total time spent by all maps in occupied slots (ms)=1164160
HADOOP: Total time spent by all reduces in occupied slots (ms)=350080
HADOOP: Total time spent by all map tasks (ms)=9095
HADOOP: Total time spent by all reduce tasks (ms)=2735
HADOOP: Total vcore-seconds taken by all map tasks=9095
HADOOP: Total vcore-seconds taken by all reduce tasks=2735
HADOOP: Total megabyte-seconds taken by all map tasks=1164160
HADOOP: Total megabyte-seconds taken by all reduce tasks=350080
HADOOP: Map-Reduce Framework
HADOOP: Map input records=5
HADOOP: Map output records=15
HADOOP: Map output bytes=153
HADOOP: Map output materialized bytes=152
HADOOP: Input split bytes=214
HADOOP: Combine input records=0
HADOOP: Combine output records=0
HADOOP: Reduce input groups=3
HADOOP: Reduce shuffle bytes=152
HADOOP: Reduce input records=15
HADOOP: Reduce output records=3
HADOOP: Spilled Records=30
HADOOP: Shuffled Maps =2
HADOOP: Failed Shuffles=0
HADOOP: Merged Map outputs=2
HADOOP: GC time elapsed (ms)=148
HADOOP: CPU time spent (ms)=1470
HADOOP: Physical memory (bytes) snapshot=428871680
HADOOP: Virtual memory (bytes) snapshot=2197188608
HADOOP: Total committed heap usage (bytes)=144179200
HADOOP: Shuffle Errors
HADOOP: BAD_ID=0
HADOOP: CONNECTION=0
HADOOP: IO_ERROR=0
HADOOP: WRONG_LENGTH=0
HADOOP: WRONG_MAP=0
HADOOP: WRONG_REDUCE=0
HADOOP: File Input Format Counters
HADOOP: Bytes Read=108
HADOOP: File Output Format Counters
HADOOP: Bytes Written=32
HADOOP: Output directory: hdfs:///user/cloudera/tmp/mrjob/wordcount1.cloudera.20151011.115958.773999/output
Counters from step 1:
(no counters found)
Streaming final output from hdfs:///user/cloudera/tmp/mrjob/wordcount1.cloudera.20151011.115958.773999/output
"chars" 67
"lines" 5
"words" 16
removing tmp directory /tmp/wordcount1.cloudera.20151011.115958.773999
deleting hdfs:///user/cloudera/tmp/mrjob/wordcount1.cloudera.20151011.115958.773999 from HDFS
[cloudera@quickstart ~]$
关于python - mrjob 找不到输入文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33005403/
今天我在一个 Java 应用程序中看到了几种不同的加载文件的方法。 文件:/ 文件:// 文件:/// 这三个 URL 开头有什么区别?使用它们的首选方式是什么? 非常感谢 斯特凡 最佳答案 file
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我有一个 javascript 文件,并且在该方法中有一个“测试”方法,我喜欢调用 C# 函数。 c# 函数与 javascript 文件不在同一文件中。 它位于 .cs 文件中。那么我该如何管理 j
需要检查我使用的文件/目录的权限 //filePath = path of file/directory access denied by user ( in windows ) File fil
我在一个目录中有很多 java 文件,我想在我的 Intellij 项目中使用它。但是我不想每次开始一个新项目时都将 java 文件复制到我的项目中。 我知道我可以在 Visual Studio 和
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a software
我有 3 个组件的 Twig 文件: 文件 1: {# content-here #} 文件 2: {{ title-here }} {# content-here #}
我得到了 mod_ldap.c 和 mod_authnz_ldap.c 文件。我需要使用 Linux 命令的 mod_ldap.so 和 mod_authnz_ldap.so 文件。 最佳答案 从 c
我想使用PIE在我的项目中使用 IE7。 但是我不明白的是,我只能在网络服务器上使用 .htc 文件吗? 我可以在没有网络服务器的情况下通过浏览器加载的本地页面中使用它吗? 我在 PIE 的文档中看到
我在 CI 管道中考虑这一点,我应该首先构建和测试我的应用程序,结果应该是一个 docker 镜像。 我想知道使用构建环境在构建服务器上构建然后运行测试是否更常见。也许为此使用构建脚本。最后只需将 j
using namespace std; struct WebSites { string siteName; int rank; string getSiteName() {
我是 Linux 新手,目前正在尝试使用 ginkgo USB-CAN 接口(interface) 的 API 编程功能。为了使用 C++ 对 API 进行编程,他们提供了库文件,其中包含三个带有 .
我刚学C语言,在实现一个程序时遇到了问题将 test.txt 文件作为程序的输入。 test.txt 文件的内容是: 1 30 30 40 50 60 2 40 30 50 60 60 3 30 20
如何连接两个tcpdump文件,使一个流量在文件中出现一个接一个?具体来说,我想“乘以”一个 tcpdump 文件,这样所有的 session 将一个接一个地按顺序重复几次。 最佳答案 mergeca
我有一个名为 input.MP4 的文件,它已损坏。它来自闭路电视摄像机。我什么都试过了,ffmpeg , VLC 转换,没有运气。但是,我使用了 mediainfo和 exiftool并提取以下信息
我想做什么? 我想提取 ISO 文件并编辑其中的文件,然后将其重新打包回 ISO 文件。 (正如你已经读过的) 我为什么要这样做? 我想开始修改 PSP ISO,为此我必须使用游戏资源、 Assets
给定一个 gzip 文件 Z,如果我将其解压缩为 Z',有什么办法可以重新压缩它以恢复完全相同的 gzip 文件 Z?在粗略阅读了 DEFLATE 格式后,我猜不会,因为任何给定的文件都可能在 DEF
我必须从数据库向我的邮件 ID 发送一封带有附件的邮件。 EXEC msdb.dbo.sp_send_dbmail @profile_name = 'Adventure Works Admin
我有一个大的 M4B 文件和一个 CUE 文件。我想将其拆分为多个 M4B 文件,或将其拆分为多个 MP3 文件(以前首选)。 我想在命令行中执行此操作(OS X,但如果需要可以使用 Linux),而
快速提问。我有一个没有实现文件的类的项目。 然后在 AppDelegate 我有: #import "AppDelegate.h" #import "SomeClass.h" @interface A
我是一名优秀的程序员,十分优秀!