Flume to HBase dependencie failure

2019-08-03 04:27发布

I have installed HBase and Flume using Apache Cloudera. I have a flume agent running on a linux server, where the HBase current master is running. I'm trying to write from a spooldir to HBase but I get the following error:

...
ERROR org.apache.flume.node.PollingPropertiesFileConfigurationProvider: Failed to start agent because dependencies were not found in classpath. Error follows.
java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
at  org.apache.flume.sink.hbase.HBaseSink.<init>(HbaseSink.java:116)
...

Flume configuration:

...
#Sinks
tier1.sinks.hbase-sink.channel          = memory-channel
tier1.sinks.hbase-sink.type             = org.apache.flume.sink.hbase.HBaseSink
tier1.sinks.hbase-sink.table            = FlumeTable
tier1.sinks.hbase-sink.columnFamily     = FlumeColumn

I tried to modify the flume-env.sh and set HBASE_HOME HADOOP_HOME, but it changed nothing.

I have succeeded to write to HDFS, but the HBase is making problems.

1条回答
够拽才男人
2楼-- · 2019-08-03 04:56

I could resolve this problem by adding the path of the hbase-libraries to the FLUME_CLASSPATH in the conf/flume-env.sh, i.e., in my case the file looked like:

FLUME_CLASSPATH="/home/USERNAME/hbase-1.0.1.1/lib/*"

Hope it helps.

查看更多
登录 后发表回答