Hadoop reports "cocould only be replicated to 0 nodes, instead of 1"

Source: Internet
Author: User
Tags hadoop fs

Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/hadoop FS-put conf input10/07/18 12:31:05 info HDFS. dfsclient: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

At org. Apache. hadoop. HDFS. server. namenode. fsnamesystem. getadditionalblock (fsnamesystem. Java: 1287)
At org. Apache. hadoop. HDFS. server. namenode. namenode. addblock (namenode. Java: 351)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. IPC. RPC $ server. Call (RPC. Java: 481)
At org. Apache. hadoop. IPC. Server $ handler. Execute (server. Java: 894)

At org. Apache. hadoop. IPC. Client. Call (client. Java: 697)
At org. Apache. hadoop. IPC. RPC $ invoker. Invoke (rpc. Java: 216)
At $ proxy0.addblock (unknown source)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. invokemethod (retryinvocationhandler. Java: 82)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. Invoke (retryinvocationhandler. Java: 59)
At $ proxy0.addblock (unknown source)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. locatefollowingblock (dfsclient. Java: 2823)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. nextblockoutputstream (dfsclient. Java: 2705)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. Access $2000 (dfsclient. Java: 1996)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream $ datastreamer. Run (dfsclient. Java: 2182)

10/07/18 12:31:05 warn HDFS. dfsclient: notreplicatedyetexception sleeping/user/root/input/log4j. properties retries left 4
10/07/18 12:31:05 info HDFS. dfsclient: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

At org. Apache. hadoop. HDFS. server. namenode. fsnamesystem. getadditionalblock (fsnamesystem. Java: 1287)
At org. Apache. hadoop. HDFS. server. namenode. namenode. addblock (namenode. Java: 351)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. IPC. RPC $ server. Call (RPC. Java: 481)
At org. Apache. hadoop. IPC. Server $ handler. Execute (server. Java: 894)

At org. Apache. hadoop. IPC. Client. Call (client. Java: 697)
At org. Apache. hadoop. IPC. RPC $ invoker. Invoke (rpc. Java: 216)
At $ proxy0.addblock (unknown source)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. invokemethod (retryinvocationhandler. Java: 82)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. Invoke (retryinvocationhandler. Java: 59)
At $ proxy0.addblock (unknown source)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. locatefollowingblock (dfsclient. Java: 2823)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. nextblockoutputstream (dfsclient. Java: 2705)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. Access $2000 (dfsclient. Java: 1996)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream $ datastreamer. Run (dfsclient. Java: 2182)

10/07/18 12:31:05 warn HDFS. dfsclient: notreplicatedyetexception sleeping/user/root/input/log4j. properties retries left 3
10/07/18 12:31:06 info HDFS. dfsclient: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

At org. Apache. hadoop. HDFS. server. namenode. fsnamesystem. getadditionalblock (fsnamesystem. Java: 1287)
At org. Apache. hadoop. HDFS. server. namenode. namenode. addblock (namenode. Java: 351)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. IPC. RPC $ server. Call (RPC. Java: 481)
At org. Apache. hadoop. IPC. Server $ handler. Execute (server. Java: 894)

At org. Apache. hadoop. IPC. Client. Call (client. Java: 697)
At org. Apache. hadoop. IPC. RPC $ invoker. Invoke (rpc. Java: 216)
At $ proxy0.addblock (unknown source)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. invokemethod (retryinvocationhandler. Java: 82)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. Invoke (retryinvocationhandler. Java: 59)
At $ proxy0.addblock (unknown source)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. locatefollowingblock (dfsclient. Java: 2823)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. nextblockoutputstream (dfsclient. Java: 2705)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. Access $2000 (dfsclient. Java: 1996)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream $ datastreamer. Run (dfsclient. Java: 2182)

10/07/18 12:31:06 warn HDFS. dfsclient: notreplicatedyetexception sleeping/user/root/input/log4j. properties retries left 2
10/07/18 12:31:08 info HDFS. dfsclient: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

At org. Apache. hadoop. HDFS. server. namenode. fsnamesystem. getadditionalblock (fsnamesystem. Java: 1287)
At org. Apache. hadoop. HDFS. server. namenode. namenode. addblock (namenode. Java: 351)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. IPC. RPC $ server. Call (RPC. Java: 481)
At org. Apache. hadoop. IPC. Server $ handler. Execute (server. Java: 894)

At org. Apache. hadoop. IPC. Client. Call (client. Java: 697)
At org. Apache. hadoop. IPC. RPC $ invoker. Invoke (rpc. Java: 216)
At $ proxy0.addblock (unknown source)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. invokemethod (retryinvocationhandler. Java: 82)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. Invoke (retryinvocationhandler. Java: 59)
At $ proxy0.addblock (unknown source)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. locatefollowingblock (dfsclient. Java: 2823)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. nextblockoutputstream (dfsclient. Java: 2705)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. Access $2000 (dfsclient. Java: 1996)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream $ datastreamer. Run (dfsclient. Java: 2182)

10/07/18 12:31:08 warn HDFS. dfsclient: notreplicatedyetexception sleeping/user/root/input/log4j. properties retries left 1
10/07/18 12:31:11 warn HDFS. dfsclient: datastreamer exception: Org. apache. hadoop. IPC. remoteException: Java. io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

At org. Apache. hadoop. HDFS. server. namenode. fsnamesystem. getadditionalblock (fsnamesystem. Java: 1287)
At org. Apache. hadoop. HDFS. server. namenode. namenode. addblock (namenode. Java: 351)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. IPC. RPC $ server. Call (RPC. Java: 481)
At org. Apache. hadoop. IPC. Server $ handler. Execute (server. Java: 894)

At org. Apache. hadoop. IPC. Client. Call (client. Java: 697)
At org. Apache. hadoop. IPC. RPC $ invoker. Invoke (rpc. Java: 216)
At $ proxy0.addblock (unknown source)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 597)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. invokemethod (retryinvocationhandler. Java: 82)
At org. Apache. hadoop. Io. Retry. retryinvocationhandler. Invoke (retryinvocationhandler. Java: 59)
At $ proxy0.addblock (unknown source)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. locatefollowingblock (dfsclient. Java: 2823)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. nextblockoutputstream (dfsclient. Java: 2705)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream. Access $2000 (dfsclient. Java: 1996)
At org. Apache. hadoop. HDFS. dfsclient $ dfsoutputstream $ datastreamer. Run (dfsclient. Java: 2182)

10/07/18 12:31:11 warn HDFS. dfsclient: error recovery for block null bad datanode [0] nodes = NULL
10/07/18 12:31:11 warn HDFS. dfsclient: cocould not get block locations. source file "/user/root/input/log4j. properties"-Aborting...
Put: Java. Io. ioexception: File/user/root/input/log4j. properties cocould only be replicated to 0 nodes, instead of 1

 

A long piece of error code, huh, huh. When I first encountered this problem, I searched the internet for the following, and there was no standard solution. In general, it is caused by inconsistency.

There is one method, but the existing data will be lost. Please use it with caution.

1. Stop all services first

2. Format namenode

3. Restart all services

4. You can perform normal operations.

The following are my Solutions

Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/stop-all.sh
Stopping jobtracker
Localhost: Stopping tasktracker
No namenode to stop
Localhost: No datanode to stop
Localhost: Stopping secondarynamenode
Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/hadoop namenode-format
10/07/18 12:46:23 info namenode. namenode: startup_msg:
/*************************************** *********************
Startup_msg: Starting namenode
Startup_msg: host = scutshuxue-desktop/127.0.1.1
Startup_msg: ARGs = [-format]
Startup_msg: version = 0.19.2
Startup_msg: Build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.19-r 789657; compiled by 'root' on Tue Jun 30 12:40:50 EDT 2009
**************************************** ********************/
Re-format filesystem in/tmp/hadoop-root/dfs/name? (Y or N) y
10/07/18 12:46:24 info namenode. fsnamesystem: fsowner = root, root
10/07/18 12:46:24 info namenode. fsnamesystem: supergroup = supergroup
10/07/18 12:46:24 info namenode. fsnamesystem: ispermissionenabled = true
10/07/18 12:46:25 info common. Storage: Image File of size 94 saved in 0 seconds.
10/07/18 12:46:25 info common. Storage: storage directory/tmp/hadoop-root/dfs/name has been successfully formatted.
10/07/18 12:46:25 info namenode. namenode: shutdown_msg:
/*************************************** *********************
Shutdown_msg: Shutting Down namenode at scutshuxue-desktop/127.0.1.1
**************************************** ********************/
Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # ls
Bin docs lib readme.txt
Build. xml hadoop-0.19.2-ant.jar libhdfs SRC
C ++ hadoop-0.19.2-core.jar librecordio test-txt
Changes.txt hadoop-0.19.2-examples.jar license.txt webapps
Conf hadoop-0.19.2-test.jar (logs)
Contrib hadoop-0.19.2-tools.jar notice.txt
Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/start-all.sh
Starting namenode, logging to/home/root/hadoop-0.19.2/bin/../logs/hadoop-root-namenode-scutshuxue-desktop.out
Localhost: Starting datanode, logging to/home/root/hadoop-0.19.2/bin/../logs/hadoop-root-datanode-scutshuxue-desktop.out
Localhost: Starting secondarynamenode, logging to/home/root/hadoop-0.19.2/bin/../logs/hadoop-root-secondarynamenode-scutshuxue-desktop.out
Starting jobtracker, logging to/home/root/hadoop-0.19.2/bin/../logs/hadoop-root-jobtracker-scutshuxue-desktop.out
Localhost: Starting tasktracker, logging to/home/root/hadoop-0.19.2/bin/../logs/hadoop-root-tasktracker-scutshuxue-desktop.out
Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/hadoop FS-put conf Input
Root @ scutshuxue-desktop:/home/root/hadoop-0.19.2 # bin/hadoop DFS-ls
Found 1 items
Drwxr-XR-X-root supergroup 0 2010-07-18 :47/user/root/Input

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.