美文网首页
intellij windows7 下运行hadoop

intellij windows7 下运行hadoop

作者: proud2008 | 来源:发表于2017-02-09 11:47 被阅读1064次

    前提:已安装jdk intellij, hadoop安装成功,可正常读写文件

    一、新建项目 配置

    新建java项目

    二、导入依赖的jar

    Paste_Image.png Paste_Image.png Paste_Image.png Paste_Image.png

    最终导入如下


    Paste_Image.png

    三、创建java实例

    /**
     * Created by Administrator on 2017/2/9.
     */
    
    import org.apache.hadoop.conf.Configuration;
    import org.apache.hadoop.fs.FileSystem;
    import org.apache.hadoop.fs.Path;
    import org.apache.hadoop.io.IntWritable;
    import org.apache.hadoop.io.Text;
    import org.apache.hadoop.mapreduce.Job;
    import org.apache.hadoop.mapreduce.Mapper;
    import org.apache.hadoop.mapreduce.Reducer;
    import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
    import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
    
    import java.io.IOException;
    import java.util.StringTokenizer;
    
    public class WordCount {
    
        public static class TokenizerMapper
                extends Mapper<Object, Text, Text, IntWritable> {
    
            private final static IntWritable one = new IntWritable(1);
            private Text word = new Text();
    
            public void map(Object key, Text value, Context context
            ) throws IOException, InterruptedException {
                StringTokenizer itr = new StringTokenizer(value.toString());
                while (itr.hasMoreTokens()) {
                    word.set(itr.nextToken());
                    context.write(word, one);
                }
            }
        }
    
        public static class IntSumReducer
                extends Reducer<Text, IntWritable, Text, IntWritable> {
            private IntWritable result = new IntWritable();
    
            public void reduce(Text key, Iterable<IntWritable> values,
                               Context context
            ) throws IOException, InterruptedException {
                int sum = 0;
                for (IntWritable val : values) {
                    sum += val.get();
                }
                result.set(sum);
                context.write(key, result);
            }
        }
    
        private static void deleteDir(Configuration conf, String dirPath) throws IOException {
            FileSystem fs = FileSystem.get(conf);
            Path targetPath = new Path(dirPath);
            if (fs.exists(targetPath)) {
                boolean delResult = fs.delete(targetPath, true);
                if (delResult) {
                    System.out.println(targetPath + " has been deleted sucessfullly.");
                } else {
                    System.out.println(targetPath + " deletion failed.");
                }
            }
    
        }
    
        public static void main(String[] args) throws Exception {
            Configuration conf = new Configuration();
          /*  String[] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
            if (otherArgs.length < 2) {
                System.err.println("Usage: wordcount <in> [<in>...] <out>");
                System.exit(2);
            }
            //先删除output目录
            deleteDir(conf, otherArgs[otherArgs.length - 1]);*/
            Job job = Job.getInstance(conf, "word count");
            job.setJarByClass(WordCount.class);
            job.setMapperClass(TokenizerMapper.class);
            job.setCombinerClass(IntSumReducer.class);
            job.setReducerClass(IntSumReducer.class);
            job.setOutputKeyClass(Text.class);
            job.setOutputValueClass(IntWritable.class);
            FileInputFormat.addInputPath(job, new Path(args[0]));
            FileOutputFormat.setOutputPath(job, new Path(args[1]));
            System.exit(job.waitForCompletion(true) ? 0 : 1);
        }
    }
    

    统计 args第一个参数对应的文件目录中所有文件中单词出现的次数
    输出结果在第二个参数对应的文件目录中会自动创建目录 运行前要保证目录不存在

    四、运行配置

    Paste_Image.png Paste_Image.png
    hdfs://localhost:9000/user/wcinput hdfs://localhost:9000/user/wcoutput

    五、 运行Log

    D:\Android\AS\jre\bin\java -Didea.launcher.port=7536 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3.4\bin" -Dfile.encoding=UTF-8 -classpath "D:\Android\AS\jre\jre\lib\charsets.jar;D:\Android\AS\jre\jre\lib\ext\access-bridge-64.jar;D:\Android\AS\jre\jre\lib\ext\cldrdata.jar;D:\Android\AS\jre\jre\lib\ext\dnsns.jar;D:\Android\AS\jre\jre\lib\ext\jaccess.jar;D:\Android\AS\jre\jre\lib\ext\localedata.jar;D:\Android\AS\jre\jre\lib\ext\nashorn.jar;D:\Android\AS\jre\jre\lib\ext\sunec.jar;D:\Android\AS\jre\jre\lib\ext\sunjce_provider.jar;D:\Android\AS\jre\jre\lib\ext\sunmscapi.jar;D:\Android\AS\jre\jre\lib\ext\sunpkcs11.jar;D:\Android\AS\jre\jre\lib\ext\zipfs.jar;D:\Android\AS\jre\jre\lib\jce.jar;D:\Android\AS\jre\jre\lib\jsse.jar;D:\Android\AS\jre\jre\lib\management-agent.jar;D:\Android\AS\jre\jre\lib\resources.jar;D:\Android\AS\jre\jre\lib\rt.jar;C:\hadoop\project\Deme2\out\production\Deme2;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\xz-1.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\asm-3.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\avro-1.7.4.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\junit-4.11.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jsch-0.1.42.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jsp-api-2.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\xmlenc-0.52.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\guava-11.0.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jets3t-0.9.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jettison-1.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jetty-6.1.26.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jsr305-1.3.9.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\log4j-1.2.17.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\paranamer-2.3.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\activation-1.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-el-1.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-io-2.4.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\httpcore-4.2.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jaxb-api-2.2.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\stax-api-1.0-2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-cli-1.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-net-3.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jersey-core-1.9.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jersey-json-1.9.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\servlet-api-2.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\slf4j-api-1.7.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\zookeeper-3.4.6.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-lang-2.6.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\httpclient-4.2.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-codec-1.4.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\hadoop-auth-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\hamcrest-core-1.3.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jackson-xc-1.9.13.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jaxb-impl-2.2.3-1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jersey-server-1.9.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jetty-util-6.1.26.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\mockito-all-1.8.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\netty-3.6.2.Final.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\api-util-1.0.0-M20.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-math3-3.1.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\java-xmlbuilder-0.4.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\protobuf-java-2.5.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\slf4j-log4j12-1.7.5.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\snappy-java-1.0.4.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-digester-1.8.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jackson-jaxrs-1.9.13.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-logging-1.1.3.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jasper-runtime-5.5.23.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\api-asn1-api-1.0.0-M20.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-compress-1.4.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-httpclient-3.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jasper-compiler-5.5.23.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\apacheds-i18n-2.0.0-M15.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-beanutils-1.7.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jackson-core-asl-1.9.13.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\hadoop-annotations-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-collections-3.2.1.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-configuration-1.6.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\jackson-mapper-asl-1.9.13.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\commons-beanutils-core-1.8.0.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\lib\apacheds-kerberos-codec-2.0.0-M15.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\hadoop-nfs-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\hadoop-common-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\common\hadoop-common-2.5.2-tests.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\hdfs\hadoop-hdfs-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\hdfs\hadoop-hdfs-nfs-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\hdfs\hadoop-hdfs-2.5.2-tests.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\httpfs;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-examples-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-hs-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-app-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-core-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-common-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-shuffle-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-jobclient-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-hs-plugins-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\mapreduce\hadoop-mapreduce-client-jobclient-2.5.2-tests.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-api-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-client-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-common-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-tests-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-common-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-web-proxy-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-nodemanager-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-resourcemanager-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-applications-distributedshell-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-server-applicationhistoryservice-2.5.2.jar;C:\hadoop\hadoop-2.5.2\share\hadoop\yarn\hadoop-yarn-applications-unmanaged-am-launcher-2.5.2.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain WordCount hdfs://localhost:9000/user/wcinput hdfs://localhost:9000/user/wcoutput
    2017-02-09 11:32:43,647 INFO  [main] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated(1019)) - session.id is deprecated. Instead, use dfs.metrics.session-id
    2017-02-09 11:32:43,655 INFO  [main] jvm.JvmMetrics (JvmMetrics.java:init(76)) - Initializing JVM Metrics with processName=JobTracker, sessionId=
    2017-02-09 11:32:44,139 WARN  [main] mapreduce.JobSubmitter (JobSubmitter.java:copyAndConfigureFiles(150)) - Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
    2017-02-09 11:32:44,147 WARN  [main] mapreduce.JobSubmitter (JobSubmitter.java:copyAndConfigureFiles(259)) - No job jar file set.  User classes may not be found. See Job or Job#setJar(String).
    2017-02-09 11:32:44,317 INFO  [main] input.FileInputFormat (FileInputFormat.java:listStatus(281)) - Total input paths to process : 1
    2017-02-09 11:32:44,429 INFO  [main] mapreduce.JobSubmitter (JobSubmitter.java:submitJobInternal(396)) - number of splits:1
    2017-02-09 11:32:44,646 INFO  [main] mapreduce.JobSubmitter (JobSubmitter.java:printTokens(479)) - Submitting tokens for job: job_local1873026139_0001
    2017-02-09 11:32:44,722 WARN  [main] conf.Configuration (Configuration.java:loadProperty(2368)) - file:/tmp/hadoop-Administrator/mapred/staging/Administrator1873026139/.staging/job_local1873026139_0001/job.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval;  Ignoring.
    2017-02-09 11:32:44,727 WARN  [main] conf.Configuration (Configuration.java:loadProperty(2368)) - file:/tmp/hadoop-Administrator/mapred/staging/Administrator1873026139/.staging/job_local1873026139_0001/job.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts;  Ignoring.
    2017-02-09 11:32:44,953 WARN  [main] conf.Configuration (Configuration.java:loadProperty(2368)) - file:/tmp/hadoop-Administrator/mapred/local/localRunner/Administrator/job_local1873026139_0001/job_local1873026139_0001.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval;  Ignoring.
    2017-02-09 11:32:44,961 WARN  [main] conf.Configuration (Configuration.java:loadProperty(2368)) - file:/tmp/hadoop-Administrator/mapred/local/localRunner/Administrator/job_local1873026139_0001/job_local1873026139_0001.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts;  Ignoring.
    2017-02-09 11:32:44,971 INFO  [main] mapreduce.Job (Job.java:submit(1289)) - The url to track the job: http://localhost:8080/
    2017-02-09 11:32:44,973 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1334)) - Running job: job_local1873026139_0001
    2017-02-09 11:32:45,002 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:createOutputCommitter(471)) - OutputCommitter set in config null
    2017-02-09 11:32:45,023 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:createOutputCommitter(489)) - OutputCommitter is org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter
    2017-02-09 11:32:45,253 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:runTasks(448)) - Waiting for map tasks
    2017-02-09 11:32:45,260 INFO  [LocalJobRunner Map Task Executor #0] mapred.LocalJobRunner (LocalJobRunner.java:run(224)) - Starting task: attempt_local1873026139_0001_m_000000_0
    2017-02-09 11:32:45,352 INFO  [LocalJobRunner Map Task Executor #0] util.ProcfsBasedProcessTree (ProcfsBasedProcessTree.java:isAvailable(181)) - ProcfsBasedProcessTree currently is supported only on Linux.
    2017-02-09 11:32:45,431 INFO  [LocalJobRunner Map Task Executor #0] mapred.Task (Task.java:initialize(587)) -  Using ResourceCalculatorProcessTree : org.apache.hadoop.yarn.util.WindowsBasedProcessTree@2597b289
    2017-02-09 11:32:45,443 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:runNewMapper(733)) - Processing split: hdfs://localhost:9000/user/wcinput/file1.txt:0+4
    2017-02-09 11:32:45,477 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:createSortingCollector(388)) - Map output collector class = org.apache.hadoop.mapred.MapTask$MapOutputBuffer
    2017-02-09 11:32:45,567 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:setEquator(1182)) - (EQUATOR) 0 kvi 26214396(104857584)
    2017-02-09 11:32:45,571 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:init(975)) - mapreduce.task.io.sort.mb: 100
    2017-02-09 11:32:45,571 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:init(976)) - soft limit at 83886080
    2017-02-09 11:32:45,572 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:init(977)) - bufstart = 0; bufvoid = 104857600
    2017-02-09 11:32:45,572 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:init(978)) - kvstart = 26214396; length = 6553600
    2017-02-09 11:32:45,970 INFO  [LocalJobRunner Map Task Executor #0] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - 
    2017-02-09 11:32:45,977 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:flush(1437)) - Starting flush of map output
    2017-02-09 11:32:45,977 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:flush(1455)) - Spilling map output
    2017-02-09 11:32:45,977 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:flush(1456)) - bufstart = 0; bufend = 9; bufvoid = 104857600
    2017-02-09 11:32:45,977 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:flush(1458)) - kvstart = 26214396(104857584); kvend = 26214396(104857584); length = 1/6553600
    2017-02-09 11:32:45,989 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1355)) - Job job_local1873026139_0001 running in uber mode : false
    2017-02-09 11:32:45,993 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1362)) -  map 0% reduce 0%
    2017-02-09 11:32:46,040 INFO  [LocalJobRunner Map Task Executor #0] mapred.MapTask (MapTask.java:sortAndSpill(1641)) - Finished spill 0
    2017-02-09 11:32:46,212 INFO  [LocalJobRunner Map Task Executor #0] mapred.Task (Task.java:done(1001)) - Task:attempt_local1873026139_0001_m_000000_0 is done. And is in the process of committing
    2017-02-09 11:32:46,329 INFO  [LocalJobRunner Map Task Executor #0] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - map
    2017-02-09 11:32:46,330 INFO  [LocalJobRunner Map Task Executor #0] mapred.Task (Task.java:sendDone(1121)) - Task 'attempt_local1873026139_0001_m_000000_0' done.
    2017-02-09 11:32:46,330 INFO  [LocalJobRunner Map Task Executor #0] mapred.LocalJobRunner (LocalJobRunner.java:run(249)) - Finishing task: attempt_local1873026139_0001_m_000000_0
    2017-02-09 11:32:46,332 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:runTasks(456)) - map task executor complete.
    2017-02-09 11:32:46,336 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:runTasks(448)) - Waiting for reduce tasks
    2017-02-09 11:32:46,367 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:run(302)) - Starting task: attempt_local1873026139_0001_r_000000_0
    2017-02-09 11:32:46,396 INFO  [pool-6-thread-1] util.ProcfsBasedProcessTree (ProcfsBasedProcessTree.java:isAvailable(181)) - ProcfsBasedProcessTree currently is supported only on Linux.
    2017-02-09 11:32:46,590 INFO  [pool-6-thread-1] mapred.Task (Task.java:initialize(587)) -  Using ResourceCalculatorProcessTree : org.apache.hadoop.yarn.util.WindowsBasedProcessTree@457f9561
    2017-02-09 11:32:46,598 INFO  [pool-6-thread-1] mapred.ReduceTask (ReduceTask.java:run(362)) - Using ShuffleConsumerPlugin: org.apache.hadoop.mapreduce.task.reduce.Shuffle@18c457f7
    2017-02-09 11:32:46,628 INFO  [pool-6-thread-1] reduce.MergeManagerImpl (MergeManagerImpl.java:<init>(193)) - MergerManager: memoryLimit=835295616, maxSingleShuffleLimit=208823904, mergeThreshold=551295104, ioSortFactor=10, memToMemMergeOutputsThreshold=10
    2017-02-09 11:32:46,645 INFO  [EventFetcher for fetching Map Completion Events] reduce.EventFetcher (EventFetcher.java:run(61)) - attempt_local1873026139_0001_r_000000_0 Thread started: EventFetcher for fetching Map Completion Events
    2017-02-09 11:32:46,769 INFO  [localfetcher#1] reduce.LocalFetcher (LocalFetcher.java:copyMapOutput(140)) - localfetcher#1 about to shuffle output of map attempt_local1873026139_0001_m_000000_0 decomp: 13 len: 17 to MEMORY
    2017-02-09 11:32:46,783 INFO  [localfetcher#1] reduce.InMemoryMapOutput (InMemoryMapOutput.java:shuffle(100)) - Read 13 bytes from map-output for attempt_local1873026139_0001_m_000000_0
    2017-02-09 11:32:46,794 INFO  [localfetcher#1] reduce.MergeManagerImpl (MergeManagerImpl.java:closeInMemoryFile(307)) - closeInMemoryFile -> map-output of size: 13, inMemoryMapOutputs.size() -> 1, commitMemory -> 0, usedMemory ->13
    2017-02-09 11:32:46,797 INFO  [EventFetcher for fetching Map Completion Events] reduce.EventFetcher (EventFetcher.java:run(76)) - EventFetcher is interrupted.. Returning
    2017-02-09 11:32:46,805 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - 1 / 1 copied.
    2017-02-09 11:32:46,805 INFO  [pool-6-thread-1] reduce.MergeManagerImpl (MergeManagerImpl.java:finalMerge(667)) - finalMerge called with 1 in-memory map-outputs and 0 on-disk map-outputs
    2017-02-09 11:32:46,832 INFO  [pool-6-thread-1] mapred.Merger (Merger.java:merge(591)) - Merging 1 sorted segments
    2017-02-09 11:32:46,833 INFO  [pool-6-thread-1] mapred.Merger (Merger.java:merge(690)) - Down to the last merge-pass, with 1 segments left of total size: 6 bytes
    2017-02-09 11:32:46,841 INFO  [pool-6-thread-1] reduce.MergeManagerImpl (MergeManagerImpl.java:finalMerge(742)) - Merged 1 segments, 13 bytes to disk to satisfy reduce memory limit
    2017-02-09 11:32:46,843 INFO  [pool-6-thread-1] reduce.MergeManagerImpl (MergeManagerImpl.java:finalMerge(772)) - Merging 1 files, 17 bytes from disk
    2017-02-09 11:32:46,845 INFO  [pool-6-thread-1] reduce.MergeManagerImpl (MergeManagerImpl.java:finalMerge(787)) - Merging 0 segments, 0 bytes from memory into reduce
    2017-02-09 11:32:46,845 INFO  [pool-6-thread-1] mapred.Merger (Merger.java:merge(591)) - Merging 1 sorted segments
    2017-02-09 11:32:46,847 INFO  [pool-6-thread-1] mapred.Merger (Merger.java:merge(690)) - Down to the last merge-pass, with 1 segments left of total size: 6 bytes
    2017-02-09 11:32:46,849 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - 1 / 1 copied.
    2017-02-09 11:32:46,925 INFO  [pool-6-thread-1] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated(1019)) - mapred.skip.on is deprecated. Instead, use mapreduce.job.skiprecords
    2017-02-09 11:32:47,080 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1362)) -  map 100% reduce 0%
    2017-02-09 11:32:47,770 INFO  [pool-6-thread-1] mapred.Task (Task.java:done(1001)) - Task:attempt_local1873026139_0001_r_000000_0 is done. And is in the process of committing
    2017-02-09 11:32:47,775 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - 1 / 1 copied.
    2017-02-09 11:32:47,775 INFO  [pool-6-thread-1] mapred.Task (Task.java:commit(1162)) - Task attempt_local1873026139_0001_r_000000_0 is allowed to commit now
    2017-02-09 11:32:47,822 INFO  [pool-6-thread-1] output.FileOutputCommitter (FileOutputCommitter.java:commitTask(439)) - Saved output of task 'attempt_local1873026139_0001_r_000000_0' to hdfs://localhost:9000/user/wcoutput/_temporary/0/task_local1873026139_0001_r_000000
    2017-02-09 11:32:47,824 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:statusUpdate(591)) - reduce > reduce
    2017-02-09 11:32:47,824 INFO  [pool-6-thread-1] mapred.Task (Task.java:sendDone(1121)) - Task 'attempt_local1873026139_0001_r_000000_0' done.
    2017-02-09 11:32:47,824 INFO  [pool-6-thread-1] mapred.LocalJobRunner (LocalJobRunner.java:run(325)) - Finishing task: attempt_local1873026139_0001_r_000000_0
    2017-02-09 11:32:47,825 INFO  [Thread-3] mapred.LocalJobRunner (LocalJobRunner.java:runTasks(456)) - reduce task executor complete.
    2017-02-09 11:32:48,141 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1362)) -  map 100% reduce 100%
    2017-02-09 11:32:48,141 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1373)) - Job job_local1873026139_0001 completed successfully
    2017-02-09 11:32:48,195 INFO  [main] mapreduce.Job (Job.java:monitorAndPrintJob(1380)) - Counters: 38
        File System Counters
            FILE: Number of bytes read=404
            FILE: Number of bytes written=483189
            FILE: Number of read operations=0
            FILE: Number of large read operations=0
            FILE: Number of write operations=0
            HDFS: Number of bytes read=8
            HDFS: Number of bytes written=7
            HDFS: Number of read operations=15
            HDFS: Number of large read operations=0
            HDFS: Number of write operations=4
        Map-Reduce Framework
            Map input records=1
            Map output records=1
            Map output bytes=9
            Map output materialized bytes=17
            Input split bytes=109
            Combine input records=1
            Combine output records=1
            Reduce input groups=1
            Reduce shuffle bytes=17
            Reduce input records=1
            Reduce output records=1
            Spilled Records=2
            Shuffled Maps =1
            Failed Shuffles=0
            Merged Map outputs=1
            GC time elapsed (ms)=171
            CPU time spent (ms)=0
            Physical memory (bytes) snapshot=0
            Virtual memory (bytes) snapshot=0
            Total committed heap usage (bytes)=482344960
        Shuffle Errors
            BAD_ID=0
            CONNECTION=0
            IO_ERROR=0
            WRONG_LENGTH=0
            WRONG_MAP=0
            WRONG_REDUCE=0
        File Input Format Counters 
            Bytes Read=4
        File Output Format Counters 
            Bytes Written=7
    
    Process finished with exit code 0
    

    六、查看结果

    Paste_Image.png

    hadoop fs -rm -r hdfs://localhost:9000/user/wcoutput 删除输出目录
    参考
    HOW-TO: COMPILE AND DEBUG HADOOP APPLICATIONS WITH INTELLIJ IDEA IN WINDOWS OS (64BIT)

    eclipse/intellij idea 远程调试hadoop 2.6.0

    相关文章

      网友评论

          本文标题:intellij windows7 下运行hadoop

          本文链接:https://www.haomeiwen.com/subject/qidiittx.html