UserGuide中显示如何设置收集器并向其写入http://archive.cloudera.com/cdh/3/flume/UserGuide/index.html#_tiering_flume_nodes_agents_and_collectors的位具有以下配置:
host : console | agentSink("localhost",35853) ;
collector : collectorSource(35853) | console ;
我将其更改为:
dataSource : console | agentSink("localhost") ;
dataCollector : collectorSource() | console ;
我将节点产生为:
flume node_nowatch -n dataSource
flume node_nowatch -n dataCollector
我在两个系统上试过这个:
Cloudera自己的演示VM在VirtualBox内运行,内存为2GB。 它配备了Flume 0.9.4-cdh3u2
Ubuntu LTS(Lucid)使用debian软件包和openJDK(减去安装的所有hadoop软件包)作为在VirtualBox内运行的VM,带有2GB RAM 按照此处的步骤https://ccp.cloudera.com/display/CDHDOC/Flume+Installation#FlumeInstallation-InstallingtheFlumeRPMorDebianPackages
这是我做的:
flume dump 'collectorSource()'
导致
$ sudo netstat -anp | grep 35853
tcp6 0 0 :::35853 :::* LISTEN 3520/java
$ ps aux | grep java | grep 3520
1000 3520 0.8 2.3 1050508 44676 pts/0 Sl+ 15:38 0:02 java -Dflume.log.dir=/usr/lib/flume/logs -Dflume.log.file=flume.log -Dflume.root.logger=INFO,console -Dzookeeper.root.logger=ERROR,console -Dwatchdog.root.logger=INFO,console -Djava.library.path=/usr/lib/flume/lib::/usr/lib/hadoop/lib/native/Linux-amd64-64 com.cloudera.flume.agent.FlumeNode -1 -s -n dump -c dump: collectorSource() | console;
我的假设是:
flume dump 'collectorSource()'
与运行配置相同:
dump : collectorSource() | console ;
并使用
启动节点flume node -1 -n dump -c "dump: collectorSource() | console;" -s
dataSource : console | agentSink("localhost")
导致
$ sudo netstat -anp | grep 35853
tcp6 0 0 :::35853 :::* LISTEN 3520/java
tcp6 0 0 127.0.0.1:44878 127.0.0.1:35853 ESTABLISHED 3593/java
tcp6 0 0 127.0.0.1:35853 127.0.0.1:44878 ESTABLISHED 3520/java
$ ps aux | grep java | grep 3593
1000 3593 1.2 3.0 1130956 57644 pts/1 Sl+ 15:41 0:07 java -Dflume.log.dir=/usr/lib/flume/logs -Dflume.log.file=flume.log -Dflume.root.logger=INFO,console -Dzookeeper.root.logger=ERROR,console -Dwatchdog.root.logger=INFO,console -Djava.library.path=/usr/lib/flume/lib::/usr/lib/hadoop/lib/native/Linux-amd64-64 com.cloudera.flume.agent.FlumeNode -n dataSource
观察到的行为在 VirtualBox虚拟机中完全相同:
dataSource
的未完成流程2011-12-15 15:27:58,253 [Roll-TriggerThread-1] INFO
durability.NaiveFileWALManager: File lives in
/tmp/flume-cloudera/agent/dataSource/writing/20111215-152748172-0500.1116926245855.00000034
2011-12-15 15:27:58,253 [Roll-TriggerThread-1] INFO
hdfs.SeqfileEventSink: constructed new seqfile event sink:
file=/tmp/flume-cloudera/agent/dataSource/writing/20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:27:58,254 [naive file wal consumer-35] INFO
durability.NaiveFileWALManager: opening log file
20111215-152748172-0500.1116926245855.00000034
2011-12-15 15:27:58,254 [Roll-TriggerThread-1] INFO
endtoend.AckListener$Empty: Empty Ack Listener began
20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:27:58,256 [naive file wal consumer-35] INFO
agent.WALAckManager: Ack for
20111215-152748172-0500.1116926245855.00000034 is queued to be checked
2011-12-15 15:27:58,257 [naive file wal consumer-35] INFO
durability.WALSource: end of file NaiveFileWALManager
(dir=/tmp/flume-cloudera/agent/dataSource )
2011-12-15 15:28:07,874 [Heartbeat] INFO agent.WALAckManager:
Retransmitting 20111215-152657736-0500.1066489868855.00000034 after
being stale for 60048ms
2011-12-15 15:28:07,875 [naive file wal consumer-35] INFO
durability.NaiveFileWALManager: opening log file
20111215-152657736-0500.1066489868855.00000034
2011-12-15 15:28:07,877 [naive file wal consumer-35] INFO
agent.WALAckManager: Ack for
20111215-152657736-0500.1066489868855.00000034 is queued to be checked
2011-12-15 15:28:07,877 [naive file wal consumer-35] INFO
durability.WALSource: end of file NaiveFileWALManager
(dir=/tmp/flume-cloudera/agent/dataSource )
2011-12-15 15:28:08,335 [Roll-TriggerThread-1] INFO
hdfs.SeqfileEventSink: closed
/tmp/flume-cloudera/agent/dataSource/writing/20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:28:08,335 [Roll-TriggerThread-1] INFO
endtoend.AckListener$Empty: Empty Ack Listener ended
20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:28:08,335 [Roll-TriggerThread-1] INFO
durability.NaiveFileWALManager: File lives in
/tmp/flume-cloudera/agent/dataSource/writing/20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:28:08,335 [Roll-TriggerThread-1] INFO
hdfs.SeqfileEventSink: constructed new seqfile event sink:
file=/tmp/flume-cloudera/agent/dataSource/writing/20111215-152808335-0500.1137089135855.00000034
2011-12-15 15:28:08,336 [naive file wal consumer-35] INFO
durability.NaiveFileWALManager: opening log file
20111215-152758253-0500.1127006668855.00000034
2011-12-15 15:28:08,337 [Roll-TriggerThread-1] INFO
endtoend.AckListener$Empty: Empty Ack Listener began
20111215-152808335-0500.1137089135855.00000034
2011-12-15 15:28:08,339 [naive file wal consumer-35] INFO
agent.WALAckManager: Ack for
20111215-152758253-0500.1127006668855.00000034 is queued to be checked
2011-12-15 15:28:08,339 [naive file wal consumer-35] INFO
durability.WALSource: end of file NaiveFileWALManager
(dir=/tmp/flume-cloudera/agent/dataSource )
2011-12-15 15:28:18,421 [Roll-TriggerThread-1] INFO
hdfs.SeqfileEventSink: closed
/tmp/flume-cloudera/agent/dataSource/writing/20111215-152808335-0500.1137089135855.00000034
2011-12-15 15:28:18,421 [Roll-TriggerThread-1] INFO
endtoend.AckListener$Empty: Empty Ack Listener ended
20111215-152808335-0500.1137089135855.00000034
..
2011-12-15 15:35:24,763 [Heartbeat] INFO agent.WALAckManager:
Retransmitting 20111215-152707823-0500.1076576334855.00000034 after
being stale for 60277ms
2011-12-15 15:35:24,763 [Heartbeat] INFO
durability.NaiveFileWALManager: Attempt to retry chunk
'20111215-152707823-0500.1076576334855.00000034' in LOGGED state.
There is no need for state transition.
dataCollector :
的未结束流程localhost [INFO Thu Dec 15 15:31:09 EST 2011] {
AckChecksum : (long)1323981059821 (string) ' 4Ck��' (double)6.54133557402E-312 } { AckTag : 20111215-153059819-0500.1308572847855.00000034 } { AckType : end }
如何获得控制台< - >通过收集器再次正常工作的控制台通信?
答案 0 :(得分:0)
我不确定你的预期行为是什么。
但看起来您可能只绑定到IPv6接口。我知道在Hadoop config你必须解决这个问题:
# Ubuntu wants us to use IPv6. Hadoop doesn't support that, but nevertheless binds to :::50010. Let's tell it we don't agree.
export HADOOP_OPTS="$HADOOP_OPTS -Djava.net.preferIPv4Stack=true"
您可能需要类似的选项。首先,为什么不明确设置主机名和端口号,然后依次关闭每个?
答案 1 :(得分:0)
export UOPTS=-Djava.net.preferIPv4Stack=true
=>你只会收听IP v4地址。