Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Second tier Flume agent not binding to first tier

Second tier Flume agent not binding to first tier


Hi Everyone,


I am trying to setup a simple two tier flume agents using the Cloudera VM. 

The code is as follow:

# First-tier agent

agent1.sources = source1 
agent1.sinks = sink1
agent1.channels = channel1

agent1.sources.source1.channels = channel1 = channel1 

agent1.sources.source1.type = spooldir 
agent1.sources.source1.spoolDir = /tmp/spooldir 

agent1.sinks.sink1.type = avro 
agent1.sinks.sink1.hostname = localhost 
agent1.sinks.sink1.port = 10000

agent1.channels.channel1.type = file
agent1.channels.channel1.checkpointDir = /tmp/flume/channel1/check
agent1.channels.channel1.dataDirs = /tmp/flume/channel1/data

# Second-tier agent

agent2.sources = source2 
agent2.sinks = sink2
agent2.channels = channel2

agent2.sources.source2.channels = channel2 = channel2

agent2.sources.source2.type = avro 
agent2.sources.source2.bind = localhost 
agent2.sources.source2.port = 10000

agent2.sinks.sink2.type = hdfs 
agent2.sinks.sink2.hdfs.path = /tmp/flume
agent2.sinks.sink2.hdfs.filePrefix = events
agent2.sinks.sink2.hdfs.fileSuffix = .log
agent2.sinks.sink2.hdfs.fileType = DataStream

agent2.channels.channel2.type = file
agent2.channels.channel2.checkpointDir = /tmp/flume/channel2/check
agent2.channels.channel2.dataDirs = /tmp/flume/channel2/data

The first agent looks OK but as soon as I run the second agent, its source cannot connect to the first agent's sink.

It gives the following error: 

17/10/06 14:35:33 INFO node.Application: Starting Sink sink2
17/10/06 14:35:33 INFO node.Application: Starting Source source2
17/10/06 14:35:33 INFO instrumentation.MonitoredCounterGroup: Monitored counter group for type: SINK, name: sink2: Successfully registered new MBean.
17/10/06 14:35:33 INFO instrumentation.MonitoredCounterGroup: Component type: SINK, name: sink2 started
17/10/06 14:35:33 INFO source.AvroSource: Starting Avro source source2: { bindAddress: localhost, port: 10000 }...
17/10/06 14:35:35 ERROR lifecycle.LifecycleSupervisor: Unable to start EventDrivenSourceRunner: { source:Avro source source2: { bindAddress: localhost, port: 10000 } } - Exception follows. Failed to bind to: localhost/
	at org.jboss.netty.bootstrap.ServerBootstrap.bind(
	at org.apache.avro.ipc.NettyServer.<init>(
	at org.apache.flume.source.AvroSource.start(
	at org.apache.flume.source.EventDrivenSourceRunner.start(
	at org.apache.flume.lifecycle.LifecycleSupervisor$
	at java.util.concurrent.Executors$
	at java.util.concurrent.FutureTask.runAndReset(
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(
	at java.util.concurrent.ScheduledThreadPoolExecutor$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
Caused by: Address already in use
	at Method)
	at org.jboss.netty.util.internal.DeadLockProofWorker$

Does anybbody have any idea why the second flume agent fails to bind? 




Don't have an account?
Coming from Hortonworks? Activate your account here