---
title: "Hadoop异常：Bad connect ack with firstBadLink"
author: "flyPig"
date: "2011-11-24T11:10:39Z"
tags: []
categories: ["开源软件"]
slug: "hadoop-bad-connect-ack-with-firstbadlink"
draft: false
lastmod: "2011-11-24T11:10:39Z"
id: 1276554
url: "https://flypig.iteye.com/blog/1276554"
---

hadoop抛出如下异常：
```java
[info] Exception in createBlockOutputStream java.io.IOException: Bad connect ack with firstBadLink xxx.xxx.xxx.xxx:50010
[info] Abandoning block blk_6251991629364444942_18501788
```


同时在Datanode上看到如下异常：

```java
INFO org.apache.hadoop.dfs.DataNode: Receiving
block blk_4171702026185885604 src: /xxx.xxx.xxx.xxx:36669
dest: /xxx.xxx.xxx.xxx:50010
INFO org.apache.hadoop.dfs.DataNode: writeBlock
blk_4171702026185885604 received exception
java.net.NoRouteToHostException: No route to host
ERROR org.apache.hadoop.dfs.DataNode:
xxx.xxx.xxx.xxx:50010:DataXceiver: java.net.NoRouteToHostException: No
route to host
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect
(SocketChannelImpl.java:574)
at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:100)
at org.apache.hadoop.dfs.DataNode$DataXceiver.writeBlock
(DataNode.java:1150)
at org.apache.hadoop.dfs.DataNode$DataXceiver.run(DataNode.java:994)
at java.lang.Thread.run(Thread.java:619)
```


经查证是做link copy connect出现的问题，关掉所有Datanode上的iptables,发现恢复正常。