记录:
用java通过api读取hdfs上面的文件是,出现了
Failed to connect to /xxx.xxx.xxx:50010 for block, add to deadNodes and continue

这是由于本地测试和服务器不在一个局域网,安装的hadoop配置文件是以内网ip作为机器间通信的ip.在这种情况下,我们能够访问到namenode机器,namenode会给我们数据所在机器的ip地址供我们访问数据传输服务,但是返回的的是datanode内网的ip,我们无法根据该IP访问datanode服务器.
让namenode返回给我们datanode的域名,在开发机器的hosts文件中配置datanode对应的外网ip和域名,并且在与hdfs交互的程序中添加如下代码即可
Configuration conf = new Configuration(); //设置通过域名访问datanode conf.set("dfs.client.use.datanode.hostname", "true");

详情可见:这里

Failed to connect to /xxx.xxx.xxx:50010 for block, add to deadNodes and continue相关推荐

  1. fatal: unable to access ‘https://github.com/xxx/‘: Failed to connect to 127.0.0.1 port 7890: Connect

    git clone 项目的时候遇到报错: fatal: unable to access 'https://github.com/xxx/': Failed to connect to 127.0.0 ...

  2. 解决 rsync: failed to connect to xxx.xxx.xxx.85 (xxx.xxx.xxx.85): No route to host (113) 问题

    如果我们在使用 rsync 同步服务器之间文件时报如下错误: rsync: failed to connect to xxx.xxx.xxx.85 (xxx.xxx.xxx.85): No route ...

  3. git clone 出现fatal: unable to access ‘https://github.com/xxx: Failed to connect to github.com

    问题描述: 使用git clone命令时,出现如下错误: fatal: unable to access 'https://github.com/xxx': Failed to connect to ...

  4. Failed to connect to the host via ssh: Control socket connect(/root/.ansible/cp/xxx): Connect

    这里写自定义目录标题 Failed to connect to the host via ssh Failed to connect to the host via ssh 当前环境:ansible ...

  5. Failed to execute goal on project xxx: Could not resolve dependencies for project com

    错误描述: Failed to execute goal on project xxx: Could not resolve dependencies for project com.jd.ka:xx ...

  6. it : Tmaster (hook declined) error: failed to push some refs to https://xxx/biluo/xxx.git

    To https:///biluo/xxx.git! [remote rejected] master -> master (hook declined) error: failed to pu ...

  7. Failed to read artifact descriptor for xxx:jar的问题解决

    Failed to read artifact descriptor for xxx:jar的问题解决 参考文章: (1)Failed to read artifact descriptor for ...

  8. greendao出现Failed to change locale for db ‘/data/data/xxx/databases/xxx.db‘ to ‘zh_CN‘.

    Failed to change locale for db '/data/data/xxx/databases/xxx.db' to 'zh_CN'..属于数据库的错误.可能在低版本的手机上有些系统 ...

  9. Arcgis Server 发布服务报错Failed to start the server machine ‘XXX‘. Error while starting AppServer. Requir

    Arcgis Server 发布服务报错 Failed to start the server machine 'XXX'. Error while starting AppServer. Requi ...

最新文章

  1. 【Qt】重新认识QObject
  2. 2019北京智源大会完整议程重磅揭晓!
  3. HDU 4466 Triangle(计数)
  4. PPP协议的CHAP验证
  5. cogs 1430. [UVa 11300]分金币
  6. python iot平台_Python MQTT连接到Azure Iot中心
  7. LASSO与Item Response Theory模型中的隐变量选择
  8. Python中的向量、矩阵(numpy)
  9. 博客园社区登录帐号和第三方绑定的设置
  10. linux运维常用命令
  11. 游戏需求,猎豹启发!揭秘华为Mate 20 X石墨烯膜散热方案出台始末
  12. 子网掩码换算 - 在线工具
  13. VMWare虚拟机启动失败,显示intel VT-X处于禁用状态
  14. linux命令中ps -ef是什么意思
  15. SEO与SEM是什么?有何区别?
  16. 2022.11.27一周总结
  17. Python爬虫之从网站图片中抓取文字
  18. python 爬虫 requests模块 中的Cookies 验证 通过验证cookies模拟登陆豆瓣登陆
  19. 成人c语言培训,C语言程序设计在成人教育中教学.doc
  20. 计算机cpu多大,电脑的cpu频率多少算正常

热门文章

  1. opencv resize方法总结
  2. Vue2框架 基础知识1
  3. 京东软件测试岗:惨不忍睹的三面,幸好做足了准备,月薪17k,已拿offer
  4. iphonex 满屏html,h5 在全屏iphonex及以上型号中的适配
  5. airpods升系统_如何更新 AirPods / AirPods … - Apple 社区
  6. 今日头条如何申请优质科技领域创作者
  7. PostgreSQL设置主键
  8. FMS代码实现PULL STREAM
  9. 解读阿里云AI产品矩阵:目标是打造最强中国云计算能力
  10. 会计基础-资本与资本公积核算