Задание Hadoop завершено без карты и сокращено на кластере Hadoop (один намод, 12 датоде) - PullRequest
1 голос
/ 11 июня 2011

описание

Я написал программу Hadoop и запустил ее на одной машине, она работала хорошо.Но возникли следующие проблемы (задание не было запущено и завершено сразу после запуска карты), когда я перенес его в кластер (один namenode, 12 datanode)

команда выполнялась на терминале:

hadoop jar VOConeSearch.jar ввод-вывод 142.82 -3.32 1

(здесь input - это каталог в hdfs для ввода, output - это программа записи каталога hdfs, в hdfs нет каталога выводаперед выполнением, и 142.82, -3.32, 1 - три дополнительных параметра)

информация о кластере, когда я запустил программу, входной каталог содержит 167537 файлов

11/06/11 09:33:49 INFO security.Groups: Group mapping impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping; cacheTimeout=300000
11/06/11 09:33:50 WARN conf.Configuration: mapred.task.id is deprecated. Instead, use mapreduce.task.attempt.id
11/06/11 09:33:50 WARN mapreduce.JobSubmitter: Use GenericOptionsParser for parsing the arguments. Applications should implement Tool for the same.
11/06/11 09:33:57 INFO input.FileInputFormat: Total input paths to process : 167537
11/06/11 09:37:36 WARN conf.Configuration: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps
11/06/11 09:37:36 INFO mapreduce.JobSubmitter: number of splits:1
11/06/11 09:37:36 INFO mapreduce.JobSubmitter: adding the following namenodes' delegation tokens:null
11/06/11 09:37:36 INFO mapreduce.Job: Running job: job_201106081653_0011
11/06/11 09:37:37 INFO mapreduce.Job:  map 0% reduce 0%
11/06/11 09:37:37 INFO mapreduce.Job: Job complete: job_201106081653_0011
11/06/11 09:37:37 INFO mapreduce.Job: Counters: 4
    Job Counters 
        Total time spent by all maps waiting after reserving slots (ms)=0
        Total time spent by all reduces waiting after reserving slots (ms)=0
        SLOTS_MILLIS_MAPS=0
        SLOTS_MILLIS_REDUCES=0

Кажется, что задание выполнено в0 секунд, но в hdfs нет выходного каталога.Одна и та же программа работала на одном компьютере (namenode, datanode существуют на одном компьютере), но во входном каталоге (hdfs) есть только один файл.

информация об одном узле с одним файлом во входном каталоге

11/06/11 10:07:54 INFO security.Groups: Group mapping
impl=org.apache.hadoop.security.ShellBasedUnixGroupsMapping; cacheTimeout=300000
11/06/11 10:07:54 WARN conf.Configuration: mapred.task.id is deprecated. Instead, use
mapreduce.task.attempt.id
11/06/11 10:07:54 WARN mapreduce.JobSubmitter: Use GenericOptionsParser for parsing
the arguments. Applications should implement Tool for the same.
11/06/11 10:07:54 INFO input.FileInputFormat: Total input paths to process : 1
11/06/11 10:07:54 WARN conf.Configuration: mapred.map.tasks is deprecated. Instead,
use mapreduce.job.maps
11/06/11 10:07:54 INFO mapreduce.JobSubmitter: number of splits:1
11/06/11 10:07:55 INFO mapreduce.JobSubmitter: adding the following namenodes'
delegation tokens:null
11/06/11 10:07:55 INFO mapreduce.Job: Running job: job_201106111004_0001
11/06/11 10:07:56 INFO mapreduce.Job:  map 0% reduce 0%
11/06/11 10:08:11 INFO mapreduce.Job:  map 100% reduce 0%
11/06/11 10:08:17 INFO mapreduce.Job:  map 100% reduce 100%
11/06/11 10:08:19 INFO mapreduce.Job: Job complete: job_201106111004_0001
11/06/11 10:08:19 INFO mapreduce.Job: Counters: 33
    FileInputFormatCounters
        BYTES_READ=66580278
    FileSystemCounters
        FILE_BYTES_READ=6562
        FILE_BYTES_WRITTEN=13156
        HDFS_BYTES_READ=66580392
        HDFS_BYTES_WRITTEN=6941
    Shuffle Errors
        BAD_ID=0
        CONNECTION=0
        IO_ERROR=0
        WRONG_LENGTH=0
        WRONG_MAP=0
        WRONG_REDUCE=0
    Job Counters 
        Data-local map tasks=1
        Total time spent by all maps waiting after reserving slots (ms)=0
        Total time spent by all reduces waiting after reserving slots (ms)=0
        SLOTS_MILLIS_MAPS=8744
        SLOTS_MILLIS_REDUCES=3189
        Launched map tasks=1
        Launched reduce tasks=1
    Map-Reduce Framework
        Combine input records=0
        Combine output records=0
        Failed Shuffles=0
        GC time elapsed (ms)=867
        Map input records=118249
        Map output bytes=6512
        Map output records=11
        Merged Map outputs=1
        Reduce input groups=1
        Reduce input records=11
        Reduce output records=11
        Reduce shuffle bytes=6562
        Shuffled Maps =1
        Spilled Records=22
        SPLIT_RAW_BYTES=114

часть программы hadoop

public static void main(String[] args) throws Exception {

    if(args.length != 5)
    {
        System.out.println("Usage : HadoopTest <input path> <output path> <ra> <dec> <sr>");
        System.exit(-1);
    }


    Job job = new Job();

    job.setJarByClass(HadoopTest.class);
    Configuration conf = job.getConfiguration();

    if(!isDouble(args[2])||!isDouble(args[3])||!isDouble(args[4]))
    {
        System.out.println("RA DEC SR should be real number");
        System.exit(-1);
    }

    DefaultStringifier.store(conf, new DoubleWritable(Double.parseDouble(args[2])), "ra");
    DefaultStringifier.store(conf, new DoubleWritable(Double.parseDouble(args[3])), "dec");
    DefaultStringifier.store(conf, new DoubleWritable(Double.parseDouble(args[4])), "sr");


    FileInputFormat.addInputPath(job,new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1]));

    job.setMapperClass(ConeSearchMap.class);
    job.setMapOutputKeyClass(ScircleWritableComparable.class);
    job.setMapOutputValueClass(Text.class);

    job.setReducerClass(ConeSearchReduce.class);

    job.setOutputKeyClass(ScircleWritableComparable.class);
    job.setOutputValueClass(Text.class);

    System.exit(job.waitForCompletion(true)? 0 : 1);
}

Заранее спасибо

1 Ответ

0 голосов
/ 12 июня 2011

Идея состоит в том, чтобы установить формат ввода в вашем объекте задания:

   SequenceFileInputFormat.addInputPath(job, in);
   SequenceFileOutputFormat.setOutputPath(job, out);
   job.setInputFormatClass(SequenceFileInputFormat.class);
   job.setOutputFormatClass(SequenceFileOutputFormat.class);

Таким образом, вы должны заменить его конкретным подклассом FileInputFormat, например TextFileInputFormat или SequenceFileInputFormat.

То же самое с вашим выводом.

...