Flume错误:连接被拒绝

时间:2013-06-27 23:42:16

标签: flume

请查看以下错误: Flume Code:

local1.channels.mem-ch-1.type = memory

local1.sources.exc-src-1.channels = mem-ch-1
local1.sources.exc-src-1.type = exec
local1.sources.exc-src-1.command =tail -F /u01/accts/a.ntimbadi/flumtest.txt

local1.sinks.avro-snk-1.channel = mem-ch-1
local1.sinks.avro-snk-1.type = avro
local1.sinks.avro-snk-1.hostname = localhost
local1.sinks.avro-snk-1.port = 4141

 local1.sources = exc-src-1
 local1.sinks = avro-snk-1
 local1.channels = mem-ch-1



Error Log:
org.apache.flume.EventDeliveryException: Failed to send events
    at org.apache.flume.sink.AbstractRpcSink.process(AbstractRpcSink.java:382)
    at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
    at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.flume.FlumeException: NettyAvroRpcClient { host: localhost, port: 4141 }: RPC connection error
    at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:145)
    at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:101)
    at org.apache.flume.api.NettyAvroRpcClient.configure(NettyAvroRpcClient.java:564)
    at org.apache.flume.api.RpcClientFactory.getInstance(RpcClientFactory.java:88)
    at org.apache.flume.sink.AvroSink.initializeRpcClient(AvroSink.java:127)
    at org.apache.flume.sink.AbstractRpcSink.createConnection(AbstractRpcSink.java:209)
    at org.apache.flume.sink.AbstractRpcSink.verifyConnection(AbstractRpcSink.java:269)
    at org.apache.flume.sink.AbstractRpcSink.process(AbstractRpcSink.java:339)
    ... 3 more
Caused by: java.io.IOException: Error connecting to localhost/127.0.0.1:4141
    at org.apache.avro.ipc.NettyTransceiver.getChannel(NettyTransceiver.java:261)
    at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:203)
    at org.apache.avro.ipc.NettyTransceiver.<init>(NettyTransceiver.java:152)
    at org.apache.flume.api.NettyAvroRpcClient.connect(NettyAvroRpcClient.java:131)
    ... 10 more
Caused by: java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:599)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.connect(NioClientSocketPipelineSink.java:396)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processSelectedKeys(NioClientSocketPipelineSink.java:358)
    at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:274)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    ... 1 more

如果我做错了,请告诉我。我实际上是想在这里创建一个avro接收器,然后将其与其他代理(其代码不在此处)重定向到HDFS。我似乎错误连接到localhost上的端口。请提出一些解决方案。

1 个答案:

答案 0 :(得分:0)

您的配置是从exec源读取事件并使用Avro on localhost:4141发送它们。

但是,错误日志表明您没有在localhost:4141上运行Avro源。

你需要一个Avro源(可能是另一个代理)监听该端口。