解压flink的安装包后,在lib目录添加以下jar包
flink-connector-hbase-2.2_2.12-1.15.1.jar
flink-connector-hbase-base_2.12-1.15.1.jar
hbase-client-2.3.4.jar
hbase-common-2.3.4.jar
hbase-protocol-2.3.4.jar
hbase-protocol-shaded-2.3.4.jar
hbase-shaded-miscellaneous-3.3.0.jar
hbase-shaded-netty-3.3.0.jar
hbase-shaded-protobuf-3.3.0.jar
其中 flink-sql-connector-hbase-2.2_2.12-1.15.1.jar
不要放,因为可能会因为hbase-common-2.3.4.jar
和flink-sql-connector-hbase-2.2_2.12-1.15.1.jar
中的hbase-default.xml不兼容导致任务报错
以上操作可以解决的异常有:
class org.apache.hadoop.hbase.client.ClusterStatusListener$MulticastListener not org.apache.flink.hbase.shaded.org.apache.hadoop.hbase.client.ClusterStatusListener$Listener
hbase-default.xml file seems to be for an older version of HBase (2.2.3), this version is 2.3.4