본문 바로가기

Programing/Hadoop

Hadoop(하둡) NotReplicatedYetException


NotReplicatedYetException sleeping /user/neo/exclusive/create_doc.jrs1803 retries left 3

금일 하둡에 local file들을 upload하다가 위와 같은 exception을 만났다. 
google에서 찾다보니 한국 하둡유저 그룹의 아래와 같은 설명이 있다. 

내 경우에는 hadoop dfs의 존재하는 어떤 directory의 모든 파일을 지우고 바로 그 디렉토리에 파일들을 다시 upload 할때 생겼는데 아마도 dfs의 directory에 같은 이름으로 바로 쓰려고 하는데 datanode에서 해당 파일들의 삭제 operation이 완료되지 못했던듯 싶다. 자세한 내용은 더 찾아 봐야 겠지만 아래는 한국 하둡 유저 그룹에 나온 내용이다. 해당 페이지가 지워졌는지 실제로는 google에서 cache해 놓은 페이지로만 접근할 수 있었다; 


================================================================================================
[ 출처 ] 
http://www.hadoop.or.kr/?mid=lecture&listStyle=list&comment_srl=1798&document_srl=6242&sort_index=readed_count&order_type=desc

클라이언트(FileSystem/DFSClient) 에서 hdfs 에 file 을 쓰다가 아래와 같은 exception 이 발생하는 수가 있다.

09/09/30 03:27:41 WARN hdfs.DFSClient:2895 - NotReplicatedYetException  

block 단위로 write 가 끝나면 각 data-node 들은 name-node 에 해당 block 이 저장되었음을 알리게 되는데, 이 notification 이 클라이언트의 addNode 보다 늦게 name-node 에 도착하여 마지막 블록의 replication level 이 min replication level 에 도달하지 못한 경우에 발생한다. 종종 생길 수 있는 상황이며 클라이언트 내에서 일정 주기의 retry 로 해결하고 있다.

다른 해결 방법은 없으며 min replication level 을 0 으로 설정하여 exception 이 발생하는 것을 막을 수는 있다. ("dfs.replication.min")
================================================================================================


아래는 document page의 설명 

================================================================================================
[출처]
http://www.docjar.com/docs/api/org/apache/hadoop/dfs/NotReplicatedYetException.html 



org.apache.hadoop.dfs
public class: NotReplicatedYetException [javadoc | source] 
java.lang.Object
   java.lang.Throwable
      java.lang.Exception
         java.io.IOException
            org.apache.hadoop.dfs.NotReplicatedYetException

All Implemented Interfaces: 
    Serializable

The file has not finished being written to enough datanodes yet.
Constructor:
 public NotReplicatedYetException(String msg) 
Methods from java.lang.Throwable:
fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,  toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
 ================================================================================================