Hadoop Cook Book: URLCat Error Info

在Hadoop部署成功后,运行Hadoop cookbook chapter2的例子:URLCat,出现以下错误:

[cloud@hdn01 hadoop-1.2.1]$ bin/hadoop URLCat hdfs://hdn01:9000/user/cloud/in/file1.txt

Warning: $HADOOP_HOME is deprecated.


13/12/09 16:13:35 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 0 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:36 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 1 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:37 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 2 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:38 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 3 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:39 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 4 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:40 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 5 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:41 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 6 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:42 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 7 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:43 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 8 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
13/12/09 16:13:44 INFO ipc.Client: Retrying connect to server: hdn01/10.1.1.10:9000. Already tried 9 time(s); retry policy is RetryUpToMaximumCountWithFixedSleep(maxRetries=10, sleepTime=1 SECONDS)
Exception in thread "main" java.net.ConnectException: Call to hdn01/10.1.1.10:9000 failed on connection exception: java.net.ConnectException: Connection refused
        at org.apache.hadoop.ipc.Client.wrapException(Client.java:1142)
        at org.apache.hadoop.ipc.Client.call(Client.java:1118)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:229)
        at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:85)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:62)
        at com.sun.proxy.$Proxy1.getProtocolVersion(Unknown Source)
        at org.apache.hadoop.ipc.RPC.checkVersion(RPC.java:422)
        at org.apache.hadoop.hdfs.DFSClient.createNamenode(DFSClient.java:183)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:281)
        at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:245)
        at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:100)
        at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1446)
        at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:67)
        at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1464)
        at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:263)
        at org.apache.hadoop.fs.FsUrlConnection.connect(FsUrlConnection.java:45)
        at org.apache.hadoop.fs.FsUrlConnection.getInputStream(FsUrlConnection.java:56)
        at java.net.URL.openStream(URL.java:1037)
        at URLCat.main(URLCat.java:12)
Caused by: java.net.ConnectException: Connection refused
        at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
        at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:735)
        at org.apache.hadoop.net.SocketIOWithTimeout.connect(SocketIOWithTimeout.java:206)
        at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:511)
        at org.apache.hadoop.net.NetUtils.connect(NetUtils.java:481)
        at org.apache.hadoop.ipc.Client$Connection.setupConnection(Client.java:457)
        at org.apache.hadoop.ipc.Client$Connection.setupIOstreams(Client.java:583)
        at org.apache.hadoop.ipc.Client$Connection.access$2200(Client.java:205)
        at org.apache.hadoop.ipc.Client.getConnection(Client.java:1249)
        at org.apache.hadoop.ipc.Client.call(Client.java:1093)

        ... 22 more

(1)查看Hadoop进程:

[cloud@hdn01 hadoop-1.2.1]$ jps
16396 Jps
原来Hadoop还没有运行,晕!

[cloud@hdn01 hadoop-1.2.1]$ bin/start-all.sh
Warning: $HADOOP_HOME is deprecated.


starting namenode, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-namenode-hdn01.out
hdd01: starting datanode, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-datanode-hdd01.out
hdd02: starting datanode, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-datanode-hdd02.out
hdn02: starting secondarynamenode, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-secondarynamenode-hdn02.out
starting jobtracker, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-jobtracker-hdn01.out
hdd01: starting tasktracker, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-tasktracker-hdd01.out
hdd02: starting tasktracker, logging to /opt/hadoop-1.2.1/libexec/../logs/hadoop-cloud-tasktracker-hdd02.out

(2)重新查看Hadoop进程:

[cloud@hdn01 hadoop-1.2.1]$ jps
16647 JobTracker
16467 NameNode
16747 Jps

(3)重新运行URLCat示例:

[cloud@hdn01 hadoop-1.2.1]$ bin/hadoop URLCat hdfs://hdn01:9000/user/cloud/in/file1.txt
Warning: $HADOOP_HOME is deprecated.


Hello, world
[cloud@hdn01 hadoop-1.2.1]$

O了!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值