更新时间:2025-09-28 GMT+08:00
        
          
          
        
      
      
      
      
      
      
      
      
  
      
      
      
        
FlinkSQL HBase数据表开发建议
客户端提交作业时通过with属性添加HBase配置信息
   Flink客户端提交作业,如SQL client提交,在建表语句中添加如下配置: 
   
    
     
   
  
  | 
         配置  | 
       
         说明  | 
      
|---|---|
| 
         'properties.hbase.rpc.protection' = 'authentication'  | 
       
         需和HBase服务端的配置一致。  | 
      
| 
         'properties.zookeeper.znode.parent' = '/hbase'  | 
       
         多服务场景中,会存在hbase1,hbase2,需明确要访问的集群。  | 
      
| 
         'properties.hbase.security.authorization' = 'true'  | 
       
         开启鉴权。  | 
      
| 
         'properties.hbase.security.authentication' = 'kerberos'  | 
       
         开启Kerberos认证。  | 
      
【示例】通过with属性添加HBase配置信息:
CREATE TABLE hsink1 (
      rowkey STRING,
      f1 ROW < q1 STRING >,
      PRIMARY KEY (rowkey) NOT ENFORCED
     ) WITH (
       'connector' = 'hbase-2.2',
       'table-name' = 'cc',
       'zookeeper.quorum' = 'x.x.x.x:clientPort',
       'properties.hbase.rpc.protection' = 'authentication',
       'properties.zookeeper.znode.parent' = '/hbase',
       'properties.hbase.security.authorization' = 'true',
       'properties.hbase.security.authentication' = 'kerberos'
    );
 开启异步Lookup Join提升维表Join性能
在HBase维表with中添加如下属性:
'lookup.async'='true'
调大Lookup Join算子并行度提升维表Join性能
在HBase维表with中添加如下属性:
'lookup.parallelism'='xx'
调大Sink HBase算子并行度提升写入性能
在HBase sink表with中添加如下属性:
'sink.parallelism'='xx'