使用Dinky flink cdc把数据写入到hase中报错:hbase-default.xml file seems to be for an older version

提问者:帅平 问题分类:大数据
把数据写入到hbase中报错:
Caused by: java.lang.RuntimeException: hbase-default.xml file seems to be for an older version of HBase (1.2.3), this version is 2.2.3
	at org.apache.flink.hbase.shaded.org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:74)
	at org.apache.flink.hbase.shaded.org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:84)
	at org.apache.flink.hbase.shaded.org.apache.hadoop.hbase.HBaseConfiguration.create(HBaseConfiguration.java:98)
	at org.apache.flink.connector.hbase.util.HBaseConfigurationUtil.getHBaseConfiguration(HBaseConfigurationUtil.java:49)
	at org.apache.flink.connector.hbase.table.HBaseConnectorOptionsUtil.getHBaseConfiguration(HBaseConnectorOptionsUtil.java:100)
	at org.apache.flink.connector.hbase2.HBase2DynamicTableFactory.createDynamicTableSink(HBase2DynamicTableFactory.java:123)
	at org.apache.flink.table.factories.FactoryUtil.createDynamicTableSink(FactoryUtil.java:319)
	... 157 more

应该怎么办?

 您阅读本篇文章共花了: 

4 个回答
呜咽少女
呜咽少女
从新打包下flink-sql-connector-hbase的包,把源码目录下的hbase-site.xml里面的下面部分修改下,设置为true即可,默认是false:
<property>
    <name>hbase.defaults.for.version.skip</name>
    <value>true</value>
</property>

源码下载:
https://github.com/apache/flink-connector-hbase

备注:
1、在这个源码所有的子项目中创建src/main/resources目录,然后把带有skip的hbase-site.xml放到每一个项目的src/main/resources目录下再进行打包
发布于:4周前 (03-20) IP属地:未知
我来回答