<i id='1RTwZ'><tr id='1RTwZ'><dt id='1RTwZ'><q id='1RTwZ'><span id='1RTwZ'><b id='1RTwZ'><form id='1RTwZ'><ins id='1RTwZ'></ins><ul id='1RTwZ'></ul><sub id='1RTwZ'></sub></form><legend id='1RTwZ'></legend><bdo id='1RTwZ'><pre id='1RTwZ'><center id='1RTwZ'></center></pre></bdo></b><th id='1RTwZ'></th></span></q></dt></tr></i><div id='1RTwZ'><tfoot id='1RTwZ'></tfoot><dl id='1RTwZ'><fieldset id='1RTwZ'></fieldset></dl></div>

      <small id='1RTwZ'></small><noframes id='1RTwZ'>

      <tfoot id='1RTwZ'></tfoot>
        • <bdo id='1RTwZ'></bdo><ul id='1RTwZ'></ul>

        <legend id='1RTwZ'><style id='1RTwZ'><dir id='1RTwZ'><q id='1RTwZ'></q></dir></style></legend>
      1. Windows 上的 Python Hadoop 流式传输,脚本不是有效的

        时间:2023-09-12
        <tfoot id='bK92s'></tfoot>

                <tbody id='bK92s'></tbody>

              <legend id='bK92s'><style id='bK92s'><dir id='bK92s'><q id='bK92s'></q></dir></style></legend>

              <small id='bK92s'></small><noframes id='bK92s'>

              • <i id='bK92s'><tr id='bK92s'><dt id='bK92s'><q id='bK92s'><span id='bK92s'><b id='bK92s'><form id='bK92s'><ins id='bK92s'></ins><ul id='bK92s'></ul><sub id='bK92s'></sub></form><legend id='bK92s'></legend><bdo id='bK92s'><pre id='bK92s'><center id='bK92s'></center></pre></bdo></b><th id='bK92s'></th></span></q></dt></tr></i><div id='bK92s'><tfoot id='bK92s'></tfoot><dl id='bK92s'><fieldset id='bK92s'></fieldset></dl></div>

                  <bdo id='bK92s'></bdo><ul id='bK92s'></ul>
                • 本文介绍了Windows 上的 Python Hadoop 流式传输,脚本不是有效的 Win32 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  使用 Hadoop streaming.jar 在 Hadoop 上执行 mapreduce python 文件时遇到问题.

                  I have a problem to execute mapreduce python files on Hadoop by using Hadoop streaming.jar.

                  我使用:视窗 10 64 位Python 3.6 和我的 IDE 是 spyder 3.2.6,Hadoop 2.3.0jdk1.8.0_161

                  I use: Windows 10 64bit Python 3.6 and my IDE is spyder 3.2.6, Hadoop 2.3.0 jdk1.8.0_161

                  当我的 maperducec 代码是用 java 语言编写时,我可以得到答案,但我的问题是当我想在我的数据上混合 python 库(例如 tensorflow 或其他有用的机器学习库)时.

                  I can get answer while my maperducec code is written on java language, but my problem is when I want to mingle python libraries such as tensorflow or other useful machine learning libs on my data.

                  安装 hadoop 2.3.0:1.hadoop-env导出 JAVA_HOME=C:Javajdk1.8.0_1612.我在hadoop文件夹中创建了数据-> dfs

                  Installing hadoop 2.3.0: 1. hadoop-env export JAVA_HOME=C:Javajdk1.8.0_161 2. I created data -> dfs in hadoop folder

                  1. 对于环境用户变量

                  1. For environment User Variable

                  Hadoop_Home = D:hadoopJava_Home = C:Javajdk1.8.0_161M2_HOME = C:apache-maven-3.5.2apache-maven-3.5.2-binMaven-3.5.2平台 = x64

                  Hadoop_Home = D:hadoop Java_Home = C:Javajdk1.8.0_161 M2_HOME = C:apache-maven-3.5.2apache-maven-3.5.2-binMaven-3.5.2 Platform = x64

                  系统变量:编辑路径为:

                  System Varibales: Edit Path as:

                  D:hadoopin
                  C:javajdk1.8.0_161in
                  C:ProgramDataAnaconda3
                  

                  我的 MapReduce Python 代码:D:digitwordcount-mapper.py

                  My MapReduce Python code: D:digitwordcount-mapper.py

                  #!/usr/bin/python3
                  import sys
                  for line in sys.stdin:    
                      line = line.strip()    # remove leading and trailing whitespace
                      words = line.split()   # split the line into words
                      for word in words:   
                          print( '%s	%s' % (word, 1))
                  

                  D:digitwordcount-reducer.py

                  D:digitwordcount-reducer.py

                  #!/usr/bin/python3
                  from operator import itemgetter
                  import sys
                  current_word = None
                  current_count = 0
                  word = None
                  for line in sys.stdin:    
                      line = line.strip()   
                      word, count = line.split('	', 1)  
                      try:    
                          count = int(count)   
                      except ValueError:
                          continue       
                      if current_word == word:    
                          current_count += count
                      else:
                          if current_word:
                              print( '%s	%s' % (current_word, current_count))
                          current_count = count
                          current_word = word
                  if current_word == word:    
                      print( '%s	%s' % (current_word, current_count))
                  

                  当我以管理员身份运行命令提示符时:

                  When I run my command prompt as administrator:

                  D:hadoopin> hadoop namenode -format
                  D:hadoopsbin>start-dfs.cmd
                  D:hadoopsbin>start-yarn.cmd
                  

                  我检查了:localhost:8088/和 http://localhost:50070一切正常.

                  I checked : localhost:8088/ and http://localhost:50070 all is ok.

                  那么当我进入时:

                  D:hadoopsbin>hadoop fs -mkdir -p /input
                  D:hadoopsbin>hadoop fs -copyFromLocal D:digitmahsa.txt /input
                  D:hadoopsbin>D:hadoopinhadoop jar D:hadoopsharehadoop	oolslibhadoop-streaming-2.3.0.jar -file D:digitwordcount-mapper.py -mapper D:digitwordcount-mapper.py -file D:digitwordcount-reducer.py -reducer D:digitwordcount-reducer.py -input /input/mahsa.txt/ -output /output/
                  

                  我有这个错误:

                  18/02/21 21:49:24 WARN streaming.StreamJob: -file option is deprecated, please use generic option -files instead.
                  packageJobJar: [D:digitwordcount-mapper.py, D:digitwordcount-reducer.py, /D:/tmp/hadoop-Mahsa/hadoop-unjar7054071292684552905/] [] C:UsersMahsaAppDataLocalTempstreamjob2327207111481875361.jar tmpDir=null
                  18/02/21 21:49:25 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
                  18/02/21 21:49:25 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
                  18/02/21 21:49:28 INFO mapred.FileInputFormat: Total input paths to process : 1
                  18/02/21 21:49:28 INFO mapreduce.JobSubmitter: number of splits:2
                  18/02/21 21:49:29 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1519235874088_0003
                  18/02/21 21:49:29 INFO impl.YarnClientImpl: Submitted application application_1519235874088_0003
                  18/02/21 21:49:29 INFO mapreduce.Job: The url to track the job: http://Mahsa:8088/proxy/application_1519235874088_0003/
                  18/02/21 21:49:29 INFO mapreduce.Job: Running job: job_1519235874088_0003
                  18/02/21 21:49:42 INFO mapreduce.Job: Job job_1519235874088_0003 running in uber mode : false
                  18/02/21 21:49:42 INFO mapreduce.Job:  map 0% reduce 0%
                  18/02/21 21:49:52 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000001_0, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000003.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:49:52 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000000_0, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000002.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:50:02 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000001_1, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000004.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:50:03 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000000_1, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000005.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:50:13 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000001_2, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000007.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:50:14 INFO mapreduce.Job: Task Id : attempt_1519235874088_0003_m_000000_2, Status : FAILED
                  Error: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:426)
                          at org.apache.hadoop.mapred.MapTask.run(MapTask.java:342)
                          at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
                          at java.security.AccessController.doPrivileged(Native Method)
                          at javax.security.auth.Subject.doAs(Subject.java:422)
                          at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1548)
                          at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 9 more
                  Caused by: java.lang.RuntimeException: Error in configuring object
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
                          at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:75)
                          at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:133)
                          at org.apache.hadoop.mapred.MapRunner.configure(MapRunner.java:38)
                          ... 14 more
                  Caused by: java.lang.reflect.InvocationTargetException
                          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                          at java.lang.reflect.Method.invoke(Method.java:498)
                          at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:106)
                          ... 17 more
                  Caused by: java.lang.RuntimeException: configuration exception
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:222)
                          at org.apache.hadoop.streaming.PipeMapper.configure(PipeMapper.java:66)
                          ... 22 more
                  Caused by: java.io.IOException: Cannot run program "D:	mphadoop-Mahsa
                  m-local-dirusercacheMahsaappcacheapplication_1519235874088_0003container_1519235874088_0003_01_000008.wordcount-mapper.py": CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
                          at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
                          ... 23 more
                  Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
                          at java.lang.ProcessImpl.create(Native Method)
                          at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
                          at java.lang.ProcessImpl.start(ProcessImpl.java:137)
                          at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
                          ... 24 more
                  
                  18/02/21 21:50:24 INFO mapreduce.Job:  map 100% reduce 100%
                  18/02/21 21:50:34 INFO mapreduce.Job: Job job_1519235874088_0003 failed with state FAILED due to: Task failed task_1519235874088_0003_m_000001
                  Job failed as tasks failed. failedMaps:1 failedReduces:0
                  
                  18/02/21 21:50:34 INFO mapreduce.Job: Counters: 13
                          Job Counters
                                  Failed map tasks=7
                                  Killed map tasks=1
                                  Launched map tasks=8
                                  Other local map tasks=6
                                  Data-local map tasks=2
                                  Total time spent by all maps in occupied slots (ms)=66573
                                  Total time spent by all reduces in occupied slots (ms)=0
                                  Total time spent by all map tasks (ms)=66573
                                  Total vcore-seconds taken by all map tasks=66573
                                  Total megabyte-seconds taken by all map tasks=68170752
                          Map-Reduce Framework
                                  CPU time spent (ms)=0
                                  Physical memory (bytes) snapshot=0
                                  Virtual memory (bytes) snapshot=0
                  18/02/21 21:50:34 ERROR streaming.StreamJob: Job not Successful!
                  Streaming Command Failed!
                  

                  我真的不知道这是什么问题,它占用了我很多时间.提前感谢您的帮助或任何想法?

                  I really donot know what is problem it tool my time a lot. Thank you in advanced for your help or any idea?

                  推荐答案

                  解决方案:

                  1. 我使用 Hadoop 版本 2.7.2,对 *.xml 配置几乎相同.
                  2. 我从我的 python 代码顶部删除了 #!/usr/bin/python3.

                  我将命令更改为:

                  D:hadoopinhadoop jar
                  D:hadoopsharehadoop	oolslibhadoop-streaming-2.7.2.jar
                  -file /in/wordcount-mapper.py -mapper "python wordcount-mapper.py"
                  -file /in/wordcount-reducer.py -reducer "python wordcount-reducer.py"
                  -input /in/mahsa.txt -output /output
                  

                  因此我可以得到结果.

                  hadoop fs -cat /output/part-00000
                  

                  这篇关于Windows 上的 Python Hadoop 流式传输,脚本不是有效的 Win32 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:使用 Hadoop 计算唯一身份访问者的最佳方法是什么 下一篇:从python中的字符串中提取英文单词

                  相关文章

                  最新文章

                  <legend id='vGbpn'><style id='vGbpn'><dir id='vGbpn'><q id='vGbpn'></q></dir></style></legend>
                  <tfoot id='vGbpn'></tfoot>

                  1. <i id='vGbpn'><tr id='vGbpn'><dt id='vGbpn'><q id='vGbpn'><span id='vGbpn'><b id='vGbpn'><form id='vGbpn'><ins id='vGbpn'></ins><ul id='vGbpn'></ul><sub id='vGbpn'></sub></form><legend id='vGbpn'></legend><bdo id='vGbpn'><pre id='vGbpn'><center id='vGbpn'></center></pre></bdo></b><th id='vGbpn'></th></span></q></dt></tr></i><div id='vGbpn'><tfoot id='vGbpn'></tfoot><dl id='vGbpn'><fieldset id='vGbpn'></fieldset></dl></div>
                    • <bdo id='vGbpn'></bdo><ul id='vGbpn'></ul>

                    1. <small id='vGbpn'></small><noframes id='vGbpn'>