代码之家  ›  专栏  ›  技术社区  ›  muazfaiz

Hadoop:错误:java.lang.RuntimeException:配置对象时出错

  •  8
  • muazfaiz  · 技术社区  · 6 年前

    this website as Example 2 (Average Salaries by each department) . 我使用相同的代码从网站和 this data

    #!usr/bin/Python
    # mapper.py
    import csv
    import sys
    reader = csv.reader(sys.stdin, delimiter=',')
    writer = csv.writer(sys.stdout, delimiter='\t')
    for row in reader:
        agency = row[3]
        annualSalary = row[5][1:].strip()
        print '{0}\t{1}'.format(agency, annualSalary)
    

    减速器.py

    #!usr/bin/Python
    # reducer.py 
    import csv
    import sys
    agency_salary_sum = 0
    current_agency = None
    n_occurences = 0
    for row in sys.stdin:
        data_mapped = row.strip().split("\t")
        if len(data_mapped) != 2:
            # Something has gone wrong. Skip this line.
            continue
        agency, salary = data_mapped
        try: salary = float(salary)
        except: continue
        if agency == current_agency:
            agency_salary_sum += salary
            n_occurences += 1
        else:
            if current_agency:
                print '{0}\t{1}'.format(current_agency, agency_salary_sum/n_occurences)
                n_occurences = 0
            current_agency = agency
            agency_salary_sum = salary
    if current_agency == agency:
        print '{0}\t{1}'.format(current_agency, agency_salary_sum / n_occurences)
    

    $ bin/hadoop jar python/hadoop-streaming-2.7.0.jar -file python/salaries/mapper.py -mapper python/salaries/mapper.py -file python/salaries/reducer.py -reducer python/salaries/reducer.py -input new-input/ -output output
    

    下面是我得到的线索

    18/07/02 12:20:03 WARN streaming.StreamJob: -file option is deprecated, please use generic option -files instead.
    packageJobJar: [python/salaries/mapper.py, python/salaries/reducer.py, /tmp/hadoop-unjar4765938201803407949/] [] /tmp/streamjob3060992493780265460.jar tmpDir=null
    18/07/02 12:20:05 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
    18/07/02 12:20:06 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
    18/07/02 12:20:07 INFO mapred.FileInputFormat: Total input paths to process : 2
    18/07/02 12:20:07 INFO mapreduce.JobSubmitter: number of splits:2
    18/07/02 12:20:07 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1530451183103_0017
    18/07/02 12:20:07 INFO impl.YarnClientImpl: Submitted application application_1530451183103_0017
    18/07/02 12:20:07 INFO mapreduce.Job: The url to track the job: http://98f81ca7cf43:8088/proxy/application_1530451183103_0017/
    18/07/02 12:20:07 INFO mapreduce.Job: Running job: job_1530451183103_0017
    18/07/02 12:20:16 INFO mapreduce.Job: Job job_1530451183103_0017 running in uber mode : false
    18/07/02 12:20:16 INFO mapreduce.Job:  map 0% reduce 0%
    18/07/02 12:20:28 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000001_0, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000003/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:28 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000000_0, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000002/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:40 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000001_1, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000004/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:41 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000000_1, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000005/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:53 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000001_2, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000007/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:54 INFO mapreduce.Job:  map 50% reduce 0%
    18/07/02 12:20:54 INFO mapreduce.Job: Task Id : attempt_1530451183103_0017_m_000000_2, Status : FAILED
    Error: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:449)
            at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
            at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
            at java.security.AccessController.doPrivileged(Native Method)
            at javax.security.auth.Subject.doAs(Subject.java:415)
            at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
            at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 9 more
    Caused by: java.lang.RuntimeException: Error in configuring object
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:112)
            at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:78)
            at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136)
            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:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:606)
            at org.apache.hadoop.util.ReflectionUtils.setJobConf(ReflectionUtils.java:109)
            ... 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 "/tmp/hadoop-root/nm-local-dir/usercache/root/appcache/application_1530451183103_0017/container_1530451183103_0017_01_000008/./mapper.py": error=2, No such file or directory
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
            at org.apache.hadoop.streaming.PipeMapRed.configure(PipeMapRed.java:209)
            ... 23 more
    Caused by: java.io.IOException: error=2, No such file or directory
            at java.lang.UNIXProcess.forkAndExec(Native Method)
            at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
            at java.lang.ProcessImpl.start(ProcessImpl.java:130)
            at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
            ... 24 more
    
    18/07/02 12:20:55 INFO mapreduce.Job:  map 0% reduce 0%
    18/07/02 12:21:05 INFO mapreduce.Job:  map 100% reduce 100%
    18/07/02 12:21:05 INFO mapreduce.Job: Job job_1530451183103_0017 failed with state FAILED due to: Task failed task_1530451183103_0017_m_000001
    Job failed as tasks failed. failedMaps:1 failedReduces:0
    
    18/07/02 12:21:05 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)=81502
                    Total time spent by all reduces in occupied slots (ms)=0
                    Total time spent by all map tasks (ms)=81502
                    Total vcore-seconds taken by all map tasks=81502
                    Total megabyte-seconds taken by all map tasks=83458048
            Map-Reduce Framework
                    CPU time spent (ms)=0
                    Physical memory (bytes) snapshot=0
                    Virtual memory (bytes) snapshot=0
    18/07/02 12:21:05 ERROR streaming.StreamJob: Job not successful!
    Streaming Command Failed!
    

    3 回复  |  直到 6 年前
        1
  •  0
  •   arunp9294    6 年前

    可以尝试运行以下命令:

    bin/hadoop jar python/hadoop-streaming-2.7.0.jar  -mapper python/salaries/mapper.py -reducer python/salaries/reducer.py -input new-input/* -output output
    

    文件python/salaries/映射器.py','-文件python/salaries/减速器.py'选项

        2
  •  0
  •   running.t    6 年前

    #!usr/bin/Python

    它应该指向正确的python解释器,即 #!/usr/bin/python .

    -mapper -reducer 参数,即。 -mapper python python/salaries/mapper.py