1. 程式人生 > >HBase major version number must be less than 2 for hbase-sink

HBase major version number must be less than 2 for hbase-sink

浪費了“黃金五年”的Java程式設計師,還有救嗎? >>>   

org.apache.flume.conf.ConfigurationException: HBase major version number must be less than 2 for hbase-sink

環境:

apache-flume-1.9.0-bin
hbase-2.1.2
hadoop-3.1.2
apache-hive-3.1.1-bin
zookeeper-3.4.13

問題:

bin/flume-ng agent --conf conf/ --name agent --conf-file conf/flume-hbase.conf -Dflume.root.logger=DEBUG,console

啟動flume將資料匯入hbase中,出現以下錯誤:

2019-03-05 17:04:04,378 (conf-file-poller-0) [ERROR - org.apache.flume.sink.hbase.HBaseVersionCheck.hasVersionLessThan2(HBaseVersionCheck.java:40)] Invalid HBase version:2.1.2
2019-03-05 17:04:04,379 (conf-file-poller-0) [ERROR - org.apache.flume.node.AbstractConfigurationProvider.loadSinks(AbstractConfigurationProvider.java:469)] Sink hbase-sink has been removed due to an error during configuration
org.apache.flume.conf.ConfigurationException: HBase major version number must be less than 2 for hbase-sink.
	at org.apache.flume.sink.hbase.HBaseSink.configure(HBaseSink.java:203)
	at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
	at org.apache.flume.node.AbstractConfigurationProvider.loadSinks(AbstractConfigurationProvider.java:453)
	at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:106)
	at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:145)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

解決方法:

  • 下載hive-2.3.4,並且解壓,
  • apache-hive-2.3.4-bin/lib下所有hbase-*.jar複製到apache-flume-1.9.0-bin