flume syslogtcp未输出到控制台

ufj5ltwl  于 2021-06-04  发布在  Flume
关注(0)|答案(1)|浏览(452)

我是flume的新手,正在阅读flume用户指南。我在尝试运行这个页面上显示的简单syslogtcp演示时被卡住了。
在一个终端我运行 flume dump 'syslogTcp(5140)' 在我运行的第二个终端上: $ echo "hello via syslog" | nc -t localhost 5140 但是我没有得到控制台的输出(就像我在测试其他源代码(如tail或file)时得到的那样)
Flume看起来运行正常,我可以通过5140端口上的telnet连接到它,当我运行lsof时,我看到它:

$output for lsof -i :5140<br />
COMMAND  PID   USER   FD   TYPE DEVICE SIZE/OFF NODE NAME<br />
java    5195 ubuntu   80u  IPv6 412244      0t0  TCP *:5140 (LISTEN)<br />

$ java -version<br/>
java version "1.7.0_147-icedtea"<br />
OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1)<br />
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)<br />

running on Ubuntu 10.11 oneiric

你知道我怎么调试这个吗?
雅里夫阿扎奇
p、 这是启动flume syslogtcp时的输出:

$ flume dump 'syslogTcp(5140)'

2012-05-02 08:25:43,826 [main] INFO agent.FlumeNode: Flume 0.9.4-cdh3u3
2012-05-02 08:25:43,827 [main] INFO agent.FlumeNode:  rev unknown
2012-05-02 08:25:43,827 [main] INFO agent.FlumeNode: Compiled  on 20120126-1114
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property flume.log.file=flume.log
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property java.runtime.name=OpenJDK Runtime Environment
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property sun.boot.library.path=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property java.vm.version=21.0b17
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property zookeeper.root.logger=ERROR,console
2012-05-02 08:25:43,828 [main] INFO agent.FlumeNode: System property java.vm.vendor=Oracle Corporation
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property java.vendor.url=http://java.oracle.com/
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property path.separator=:
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property java.vm.name=OpenJDK 64-Bit Server VM
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property file.encoding.pkg=sun.io
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property user.country=US
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property sun.java.launcher=SUN_STANDARD
2012-05-02 08:25:43,829 [main] INFO agent.FlumeNode: System property sun.os.patch.level=unknown
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property java.vm.specification.name=Java Virtual Machine Specification
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property user.dir=/home/ubuntu
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property java.runtime.version=1.7.0_147-icedtea-b147
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property flume.log.dir=/usr/lib/flume/logs
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property java.endorsed.dirs=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/endorsed
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property os.arch=amd64
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property java.io.tmpdir=/tmp
2012-05-02 08:25:43,830 [main] INFO agent.FlumeNode: System property line.separator=

2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property java.vm.specification.vendor=Oracle Corporation
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property os.name=Linux
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property sun.jnu.encoding=UTF-8
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property java.library.path=/usr/lib/flume/lib::/usr/lib/hadoop/lib/native/Linux-amd64-64
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property java.specification.name=Java Platform API Specification
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property java.class.version=51.0
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property sun.management.compiler=HotSpot 64-Bit Tiered Compilers
2012-05-02 08:25:43,831 [main] INFO agent.FlumeNode: System property watchdog.root.logger=INFO,console
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property os.version=3.0.0-16-virtual
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property user.home=/home/ubuntu
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property user.timezone=Etc/UTC
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property java.awt.printerjob=sun.print.PSPrinterJob
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property file.encoding=UTF-8
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property java.specification.version=1.7
2012-05-02 08:25:43,832 [main] INFO agent.FlumeNode: System property java.class.path=/etc/flume/conf:/usr/lib/hadoop/conf:/usr/lib/hadoop/hadoop-core-0.20.2-cdh3u3.jar
/usr/lib/hadoop/hadoop-core.jar:/usr/lib/flume/lib/activation-1.1.jar:/usr/lib/flume/lib/ahocorasick-2.x.jar:/usr/lib/flume/lib/ant-1.6.5.jar:/usr/lib/flume/lib/antlr-3.2.jar:/usr/lib/flume/lib/antlr-runtime-3.2.jar:/usr/lib/flume/lib/asm-3.1.jar:/usr/lib/flume/lib/automaton-1.0.0.jar:/usr/lib/flume/lib/avro-1.5.4.jar:/usr/lib/flume/lib/avro-compiler-1.5.4.jar:/usr/lib/flume/lib/avro-ipc-1.5.4.jar:/usr/lib/flume/lib/commons-cli-1.2.jar:/usr/lib/flume/lib/commons-codec-1.3.jar:/usr/lib/flume/lib/commons-codec-1.4.jar:/usr/lib/flume/lib/commons-collections-3.1.jar:/usr/lib/flume/lib/commons-el-1.0.jar:/usr/lib/flume/lib/commons-httpclient-3.0.1.jar:/usr/lib/flume/lib/commons-httpclient-3.1.jar:/usr/lib/flume/lib/commons-lang-2.5.jar:/usr/lib/flume/lib/commons-logging-1.0.4.jar:/usr/lib/flume/lib/commons-net-1.4.1.jar:/usr/lib/flume/lib/core-3.1.1.jar:/usr/lib/flume/lib/emr-hadoop-core-0.20.jar:/usr/lib/flume/lib/flume-core-0.9.4-cdh3u3.jar:/usr/lib/flume/lib/guava-r07.jar:/usr/lib/flume/lib/guava-r09-jarjar.jar:/usr/lib/flume/lib/hadoop-core.jar:/usr/lib/flume/lib/hsqldb-1.8.0.7.jar:/usr/lib/flume/lib/irclib-1.0.0.jar:/usr/lib/flume/lib/jackson-core-asl-1.5.2.jar:/usr/lib/flume/lib/jackson-jaxrs-1.5.5.jar:/usr/lib/flume/lib/jackson-mapper-asl-1.5.2.jar:/usr/lib/flume/lib/jackson-xc-1.5.5.jar:/usr/lib/flume/lib/jasper-compiler-5.5.23.jar:/usr/lib/flume/lib/jasper-runtime-5.5.23.jar:/usr/lib/flume/lib/jaxb-api-2.1.jar:/usr/lib/flume/lib/jaxb-impl-2.1.12.jar:/usr/lib/flume/lib/jersey-core-1.4.jar:/usr/lib/flume/lib/jersey-json-1.4.jar:/usr/lib/flume/lib/jersey-server-1.4.jar:/usr/lib/flume/lib/jets3t-0.6.1.jar:/usr/lib/flume/lib/jettison-1.2.jar:/usr/lib/flume/lib/jetty-6.1.26.jar:/usr/lib/flume/lib/jetty-util-6.1.26.jar:/usr/lib/flume/lib/jline-0.9.94.jar:/usr/lib/flume/lib/jms-1.1.jar:/usr/lib/flume/lib/jsp-api-2.0.jar:/usr/lib/flume/lib/jsp-api-2.1.jar:/usr/lib/flume/lib/libthrift-0.6.0-cdh.jar:/usr/lib/flume/lib/log4j-1.2.15.jar:/usr/lib/flume/lib/mail-1.4.jar:/usr/lib/flume/lib/netty-3.2.4.Final.jar:/usr/lib/flume/lib/oro-2.0.8.jar:/usr/lib/flume/lib/paranamer-2.3.jar:/usr/lib/flume/lib/servlet-api-2.5-20081211.jar:/usr/lib/flume/lib/servlet-api-2.5.jar:/usr/lib/flume/lib/slf4j-api-1.5.11.jar:/usr/lib/flume/lib/slf4j-log4j12-1.5.11.jar:/usr/lib/flume/lib/snappy-java-1.0.3.2.jar:/usr/lib/flume/lib/stax-api-1.0.1.jar:/usr/lib/flume/lib/stax-api-1.0-2.jar:/usr/lib/flume/lib/stringtemplate-3.2.jar:/usr/lib/flume/lib/velocity-1.5.jar:/usr/lib/flume/lib/xmlenc-0.52.jar:/lib/tools.jar:/usr/lib/zookeeper/zookeeper-3.3.4-cdh3u3.jar:/usr/lib/zookeeper/zookeeper.jar:/usr/lib/flume/build/classes
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property user.name=ubuntu
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property flume.root.logger=INFO,console
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property java.vm.specification.version=1.7
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property sun.java.command=com.cloudera.flume.agent.FlumeNode -1 -s -n dump -c dump: syslogTcp(5140) | console; 
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property java.home=/usr/lib/jvm/java-7-openjdk-amd64/jre
2012-05-02 08:25:43,833 [main] INFO agent.FlumeNode: System property sun.arch.data.model=64
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property user.language=en
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property java.specification.vendor=Oracle Corporation
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property awt.toolkit=sun.awt.X11.XToolkit
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property java.vm.info=mixed mode
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property java.version=1.7.0_147-icedtea
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property java.ext.dirs=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property sun.boot.class.path=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/netx.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/plugin.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rhino.jar:/usr/lib/jvm/java-7-openjdk-amd64/jre/classes
2012-05-02 08:25:43,834 [main] INFO agent.FlumeNode: System property java.vendor=Oracle Corporation
2012-05-02 08:25:43,835 [main] INFO agent.FlumeNode: System property file.separator=/
2012-05-02 08:25:43,835 [main] INFO agent.FlumeNode: System property java.vendor.url.bug=http://bugreport.sun.com/bugreport/
2012-05-02 08:25:43,835 [main] INFO agent.FlumeNode: System property sun.io.unicode.encoding=UnicodeLittle
2012-05-02 08:25:43,835 [main] INFO agent.FlumeNode: System property sun.cpu.endian=little
2012-05-02 08:25:43,835 [main] INFO agent.FlumeNode: System property sun.cpu.isalist=
2012-05-02 08:25:43,850 [main] INFO agent.FlumeNode: Starting flume agent on: ip-10-118-98-95.ec2.internal
2012-05-02 08:25:43,856 [main] INFO agent.FlumeNode:  Working directory is: /home/ubuntu/.
2012-05-02 08:25:43,910 [main] INFO conf.FlumeConfiguration: Loading configurations from /etc/flume/conf
2012-05-02 08:25:44,574 [main] WARN text.FormatFactory: Unable to load output format plugin class  - Class not found
2012-05-02 08:25:44,596 [main] INFO agent.FlumeNode: Loading spec from command line: 'dump: syslogTcp(5140) | console; '
2012-05-02 08:25:44,931 [main] INFO agent.LogicalNodeManager: creating new logical node dump
2012-05-02 08:25:44,941 [main] INFO agent.LogicalNodeManager: Loading node name with FlumeConfigData: {srcVer:'Thu Jan 01 00:00:00 UTC 1970' snkVer:'Thu Jan 01 00:00:00 UTC 1970'  ts='Thu Jan 01 00:00:00 UTC 1970' flowId:'null' source:'syslogTcp( 5140 )' sink:'console' }
2012-05-02 08:25:44,956 [main] INFO agent.LogicalNode: Node config successfully set to FlumeConfigData: {srcVer:'Thu Jan 01 00:00:00 UTC 1970' snkVer:'Thu Jan 01 00:00:00 UTC 1970'  ts='Thu Jan 01 00:00:00 UTC 1970' flowId:'null' source:'syslogTcp( 5140 )' sink:'console' }
2012-05-02 08:25:44,960 [logicalNode dump-9] INFO syslog.SyslogTcpSourceThreads: Opening com.cloudera.flume.handlers.syslog.SyslogTcpSourceThreads@50c91c07
2012-05-02 08:25:44,970 [main] WARN agent.FlumeNode: Flume is using Hadoop core 0.20 which does not support Security / Authentication: org.apache.hadoop.security.UserGroupInformation.isSecurityEnabled()
2012-05-02 08:25:44,970 [logicalNode dump-9] INFO debug.ConsoleEventSink: ConsoleEventSink( debug ) opened
icomxhvb

icomxhvb1#

echo "<1>hello via syslog" | nc -t localhost 5140

由于您没有发送syslog优先级,flume不会打印该消息。这就是syslog ng将使用的格式。

相关问题