title: Flume agent throws java.net.ConnectException: Connection refused
body: <p>I have been using flume for a while now, I have got agent and collector running on same machine.</p>
  
  <h3>Configuration</h3>
  
  <pre><code>agent: exec("/usr/bin/tail -n +0 -F /path/to/file") | agentE2ESink("hostname", 35855)
  collector: collectorSource(35855) | collector(10000) { collectorSink("/hdfs/path/to/sink","name") }
  </code></pre>
  
  <p>Facing issues in the agent node:</p>
  
  <pre><code>2012-06-04 19:13:33,625 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 0 failed, backoff (1000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
  2012-06-04 19:13:34,625 [logicalNode hostname-19] ERROR connector.DirectDriver: Expected ACTIVE but timed out in state OPENING
  2012-06-04 19:13:34,632 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 1 failed, backoff (2000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
  2012-06-04 19:13:36,635 [naive file wal consumer-27] INFO debug.InsistentOpenDecorator: open attempt 2 failed, backoff (4000ms): Failed to open thrift event sink to hostname:35855 : java.net.ConnectException: Connection refused
  </code></pre>
  
  <p>and then empty ACKs will be sent continuously</p>
  
  <pre><code>2012-06-04 19:19:56,960 [Roll-TriggerThread-0] INFO endtoend.AckListener$Empty: Empty Ack Listener began 20120604-191956958+0530.881565921235084.00000026
  2012-06-04 19:20:07,043 [Roll-TriggerThread-0] INFO hdfs.SeqfileEventSink: closed /tmp/flume-user1/agent/hostname/writing/20120604-191956958+0530.881565921235084.00000026
  </code></pre>
  
  <p>I dont understand why the connection is refused.  Are there any system level changes that needs to be done ?</p>
  
  <p><strong>Note:</strong> the collector is listening to the port but agent is unable to send data through the 35855 port.</p>
  
  <p>Can anyone help me with this problem.</p>
  
  <p>Thanks</p>