flume配置java异常

时间:2014-05-28 23:29:40

标签: java hadoop configuration flume

我在运行水槽代理时遇到问题(来自apache flume网站的基本示例)。我正在运行的命令是


./bin/flume-ng agent --conf conf --conf-file test.conf --name a1 -Dflume.root.logger=INFO,console

我的test.conf文件看起来像

# example.conf: A single-node Flume configuration

# Name the components on this agent
a1.sources = r1
a1.sinks = k1
a1.channels = c1

# Describe/configure the source
a1.sources.r1.type = netcat
a1.sources.r1.bind = localhost
a1.sources.r1.port = 44444

# Describe the sink
a1.sinks.k1.type = logger

# Use a channel which buffers events in memory
a1.channels.c1.type = memory
a1.channels.c1.capacity = 1000
a1.channels.c1.transactionCapacity = 100

# Bind the source and sink to the channel
a1.sources.r1.channels = c1
a1.sinks.k1.channel = c1

我的env vars在这里:

TERM_PROGRAM=Apple_Terminal
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/qf/lnn77ppn1mv51vg67hlljpqw0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-h7JcOn/Render
TERM_PROGRAM_VERSION=309
OLDPWD=/Users/wolf/Downloads/apache-flume-1.5.0-src/conf
TERM_SESSION_ID=58D255EF-6DF2-4887-8598-844F2BBF0370
USER=wolf
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-OdJEdz/Listeners
Apple_Ubiquity_Message=/tmp/launch-x6Ws50/Apple_Ubiquity_Message
__CF_USER_TEXT_ENCODING=0x1F5:0:0
MAVEN_OPTS=-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
PWD=/Users/wolf/Downloads/apache-flume-1.5.0-src
JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
LANG=en_US.UTF-8

我得到的错误是

Info: Sourcing environment configuration script /Users/wolf/Downloads/apache-flume-1.5.0-   src/conf/flume-env.sh
Info: Including Hadoop libraries found via (/usr/local/bin/hadoop) for HDFS access
Exception in thread "main" java.lang.NoClassDefFoundError:  org/apache/flume/tools/GetJavaProperty
Caused by: java.lang.ClassNotFoundException: org.apache.flume.tools.GetJavaProperty
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

-Djava.library.path= org.apache.flume.node.Application --conf-file test.conf --name a1
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/flume/node/Application
 Caused by: java.lang.ClassNotFoundException: org.apache.flume.node.Application
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

有人知道我可能缺少什么吗?

2 个答案:

答案 0 :(得分:0)

那太棒了。

我将说明显而易见的事:Java没有找到Flume库。

我正在搜索flume-ng脚本,看看为什么它没有正确的类路径。

答案 1 :(得分:0)

从Cloudera工程师处获得此补丁/信息。去看看它是否解决了这个问题。 https://issues.apache.org/jira/secure/attachment/12628911/HBASE-10518.00.patch