복붙노트

[HADOOP] 600 초 동안 상태를보고하지 못했습니다. 죽이는! hadoop의 진행 상황보고

HADOOP

600 초 동안 상태를보고하지 못했습니다. 죽이는! hadoop의 진행 상황보고

다음 오류가 나타납니다.

Task attempt_201304161625_0028_m_000000_0 failed to report status for 600 seconds. Killing! 

내지도 작업. 이 질문은 this, this 및 this와 유사합니다. 그러나, 나는 hadoop이 진행 상황을보고하지 않는 작업을 죽이기 전에 기본 시간을 늘리고 싶지 않습니다. 즉,

Configuration conf=new Configuration();
long milliSeconds = 1000*60*60;
conf.setLong("mapred.task.timeout", milliSeconds);

대신, context.progress (), context.setStatus ( "Some Message") 또는 context.getCounter (SOME_ENUM.PROGRESS) .increment (1) 또는 비슷한 것을 사용하여 진행 상황을 주기적으로보고하고자합니다. 그러나 이는 여전히 작업을 중지시킵니다. 다음은 진행 상황을보고하려고 시도하는 코드 스 니펫입니다. 매퍼 :

protected void map(Key key, Value value, Context context) throws IOException, InterruptedException {

    //do some things
    Optimiser optimiser = new Optimiser();
    optimiser.optimiseFurther(<some parameters>, context);
    //more things
    context.write(newKey, newValue);
}

Optimiser 클래스 내의 optimiseFurther 메소드 :

public void optimiseFurther(<Some parameters>, TaskAttemptContext context) {

    int count = 0;
    while(something is true) {
        //optimise

        //try to report progress
        context.setStatus("Progressing:" + count);
        System.out.println("Optimise Progress:" + context.getStatus());
        context.progress();
        count++;
    }
}

매퍼의 출력은 상태가 업데이트되었음을 ​​나타냅니다.

Optimise Progress:Progressing:0
Optimise Progress:Progressing:1
Optimise Progress:Progressing:2
...

그러나 기본 시간 후에 작업이 여전히 종료됩니다. 문맥을 잘못 사용하고 있습니까? 진행 상황을 성공적으로보고하기 위해 작업 설정에서해야 할 일이 있습니까?

해결법

  1. ==============================

    1.이 문제는 Hadoop 0.20의 버그와 관련이 있습니다. context.setStatus () 및 context.progress ()에 대한 호출이 기본 프레임 워크에보고되지 않습니다 (다양한 카운터를 설정하는 호출이 작동하지 않음). 사용 가능한 패치가 있기 때문에 새로운 버전의 Hadoop으로 업데이트하면이를 수정해야합니다.

    이 문제는 Hadoop 0.20의 버그와 관련이 있습니다. context.setStatus () 및 context.progress ()에 대한 호출이 기본 프레임 워크에보고되지 않습니다 (다양한 카운터를 설정하는 호출이 작동하지 않음). 사용 가능한 패치가 있기 때문에 새로운 버전의 Hadoop으로 업데이트하면이를 수정해야합니다.

  2. ==============================

    2.일어날 수있는 일은 컨텍스트 내에서 발견되는 Reporter 자체에서 이러한 진행 방법을 호출해야하며 컨텍스트에서 호출 할 수 없을 수도 있습니다.

    일어날 수있는 일은 컨텍스트 내에서 발견되는 Reporter 자체에서 이러한 진행 방법을 호출해야하며 컨텍스트에서 호출 할 수 없을 수도 있습니다.

    Cloudera에서

    진행 상황보고

    작업이 10 분 동안 진행 상황을보고하지 않으면 (mapred.task.timeout 속성 참조) Hadoop에 의해 종료됩니다. 대부분의 작업은 입력을 읽거나 출력을 작성하여 암시 적으로 진행 상황을보고하기 때문에 이러한 상황이 발생하지 않습니다. 그러나 이러한 방식으로 레코드를 처리하지 않는 일부 작업은이 동작에 위배되어 작업이 중단 될 수 있습니다. 시뮬레이션은 각 맵에서 많은 CPU 집약적 처리를 수행하고 일반적으로 계산이 끝나면 결과를 기록하기 때문에 좋은 예입니다. 정기적으로 진행 상황을보고하는 방식으로 작성해야합니다 (매 10 분보다 더 자주). 이것은 여러 가지 방법으로 달성 될 수 있습니다 :

    Call setStatus() on Reporter to set a human-readable description of
    the task’s progress
    Call incrCounter() on Reporter to increment a user counter
    Call progress() on Reporter to tell Hadoop that your task is 
    still there (and making progress)
    

    Cloudera 팁

    public Context(Configuration conf, TaskAttemptID taskid,
                   RecordReader<KEYIN,VALUEIN> reader,
                   RecordWriter<KEYOUT,VALUEOUT> writer,
                   OutputCommitter committer,
                   StatusReporter reporter,
                   InputSplit split)
    
  3. from https://stackoverflow.com/questions/16056707/failed-to-report-status-for-600-seconds-killing-reporting-progress-in-hadoop by cc-by-sa and MIT license