---
title: "一个HDFS Error"
author: "standalone"
date: "2011-06-11T21:53:45Z"
tags: []
categories: ["互联网"]
slug: "hdfs-error"
draft: false
lastmod: "2011-06-11T21:53:45Z"
id: 1077678
url: "https://standalone.iteye.com/blog/1077678"
---

ERROR: hdfs.DFSClient: Exception in createBlockOutputStream java.io.IOException: Bad connect ack with firstBadLink  
While running a job once I got the following exception

10/12/10 21:09:05 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.io.IOException: Bad connect ack with firstBadLink 10.1.73.148:50010  
10/12/10 21:09:05 INFO hdfs.DFSClient: Abandoning block blk\_3623545154924652323\_87440  
10/12/10 21:09:11 INFO hdfs.DFSClient: Exception in createBlockOutputStream java.net.ConnectException: Connection refused  
10/12/10 21:09:11 INFO hdfs.DFSClient: Abandoning block blk\_-4726571439643867938\_87441\\

REASON  
The error contains the IP address (10.1.73.148) of the tasktracker/datanode machine for which the exception is thrown. The exception is thrown because the datanode daemon is not running on that machine; you can check this by logging into this machine, lets use 10.1.73.148 in the example, and running command  
ps -eaf | grep "DataNode" | grep -v "grep"  
If no lines are returned then this means that datanode daemon is not running on 10.1.73.148.

What happened is that machine 10.1.73.148 contain a data block that is required for the job that you are trying to run. If this block is replicated on other machines and those machines are running datanode daemons then this is not a problem, Hadoop will get the data block from some other machine and continue the job but if for any reason the data block is not available on any other node then your job will fail.

RESOLUTION  
Logon to 10.1.73.148 and run the following command  
hadoop-daemon.sh start datanode  
The above command should start the datanode daemon on 10.1.73.148. You can double check this my running command  
ps -eaf | grep "DataNode" | grep -v "grep"  
It should return 1 line

Thats it. Try running the job again. It should not throw exception anymore