zoukankan      html  css  js  c++  java
  • Hadoop: failed on connection exception: java.net.ConnectException: Connection refuse

    ssh那些都已经搞了,跑一个书上的例子出现了Connection Refused异常,如下:

    12/04/09 01:00:54 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 0 time(s).
    12/04/09 01:00:56 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 1 time(s).
    12/04/09 01:00:57 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 2 time(s).
    12/04/09 01:00:58 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 3 time(s).
    12/04/09 01:00:59 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 4 time(s).
    12/04/09 01:01:00 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 5 time(s).
    12/04/09 01:01:01 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 6 time(s).
    12/04/09 01:01:02 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 7 time(s).
    12/04/09 01:01:03 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 8 time(s).
    12/04/09 01:01:04 INFO ipc.Client: Retrying connect to server: localhost/127.0.0.1:8020. Already tried 9 time(s).
    Exception in thread "main" java.net.ConnectException: Call to localhost/127.0.0.1:8020 failed on connection exception: java.net.ConnectException: Connection refused
    at org.apache.hadoop.ipc.Client.wrapException(Client.java:1095)
    at org.apache.hadoop.ipc.Client.call(Client.java:1071)
    at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
    at $Proxy1.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:396)
    at org.apache.hadoop.ipc.RPC.getProxy(RPC.java:379)
    at org.apache.hadoop.hdfs.DFSClient.createRPCNamenode(DFSClient.java:119)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:238)
    at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:203)
    at org.apache.hadoop.hdfs.DistributedFileSystem.initialize(DistributedFileSystem.java:89)
    at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:1386)
    at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:66)
    at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:1404)
    at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:254)
    at com.lan.hadoop.FileSystemCat.main(FileSystemCat.java:15)

    .............................

    记得以前也出过这个异常,当时是因为Namenode没有启动,今天的情况是使用hadoop的ls 、mkdir那些都正常,使用jps也发现有namenode进程,telnet localhost 8020失败,但是自己也不知道是为啥失败,最后董问我namenode的端口号是不是8020,我还没反应过来,最后看了下core-site.xml发现我将fs.default.name配置为

    hdfs://localhost:9000了,果然是端口号不对。在代码中把端口号改为9000就OK了

  • 相关阅读:
    现在连Linux都搞不懂,当初我要是这么学习操作系统就好了!
    一时技痒,撸了个动态线程池,源码放Github了
    Java线程池ThreadPoolExecutor使用和分析(一)
    canch----1.对缓存的思考
    1.java 内存数据库--H2数据库使用指南
    What’s the difference between persist, save, merge and update? Which one should you use?
    primary key's generator in JPA entity
    STM32F103驱动M24256 256k存储芯片进行读写
    【Proteus+51单片机学习笔记】-51/52系列单片机简介
    【STM32项目笔记】STM32CubeMX+Keil+Proteus联合实现LED闪烁
  • 原文地址:https://www.cnblogs.com/Evil-Rebe/p/4903924.html
Copyright © 2011-2022 走看看