2013-06-27 129 views
1

請看一看以下錯誤: 水槽代碼:水槽錯誤:連接被拒絕

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 

讓我知道如果我做錯了什麼。實際上,我試圖在這裏創建一個虛擬接收器,然後將其與其他代理(其代碼不在此處)重定向到HDFS。我似乎有連接到本地端口的錯誤。請提出一些解決方案。

回答

0

你的配置是從exec源讀取事件並在localhost:4141上使用Avro發送它們。

但是,錯誤日誌表明您沒有在localhost:4141上運行的Avro源代碼。

您將需要一個Avro源(可能是另一個代理)在該端口上偵聽。

+0

我知道。我有一個實際配置爲在該端口上讀取的代理。你是否也需要它的代碼?爲了簡潔,我沒有包含它。 – RazorProgrammer

+0

該代理程序肯定沒有正確啓動。 Conf文件和日誌片段會很有幫助,是的。 – Sarge

相關問題