FlinkServer对接多套互信HBase集群

举报
yd_225397023 发表于 2025/04/26 15:58:01 2025/04/26
【摘要】 FlinkServer对接多套互信HBase集群

1、创建任务如下:

create table datagen1(uuid INT, name VARCHAR(10), age INT) WITH(
  'connector' = 'datagen',
  'rows-per-second' = '2',
  'fields.uuid.kind' = 'sequence',
  'fields.uuid.start' = '100100',
  'fields.uuid.end' = '100200',
  'fields.name.length' = '10',
  'fields.age.min' = '1',
  'fields.age.max' = '100'
);
CREATE TABLE hbasesink1 (
  rowkey STRING,
  f1 ROW < name STRING,
  age INT >,
  PRIMARY KEY (rowkey) NOT ENFORCED
) WITH (
  'connector' = 'hbase-2.2',
  'table-name' = 'default:hbase_sink',
  'zookeeper.quorum' = 'A集群quorum地址:24002',
  'properties.hbase.regionserver.kerberos.principal' = 'hbase/hadoop.zsc_bdp_zjrcu@ZSC_BDP_ZJRCU',
  'properties.hbase.master.kerberos.principal' = 'hbase/hadoop.zsc_bdp_zjrcu@ZSC_BDP_ZJRCU',
  'properties.hbase.rpc.protection' = 'authentication',
  'properties.zookeeper.znode.parent' = '/hbase',
  'properties.hbase.security.authorization' = 'true',
  'properties.hbase.security.authentication' = 'kerberos'
);
CREATE TABLE hbasesink2 (
  rowkey STRING,
  f1 ROW < name STRING,
  age INT >,
  PRIMARY KEY (rowkey) NOT ENFORCED
) WITH (
  'connector' = 'hbase-2.2',
  'table-name' = 'default:hbase_sink',
  'zookeeper.quorum' = 'B集群quorum地址:24002',
  'properties.hbase.regionserver.kerberos.principal' = 'hbase/hadoop.cs_bdp_zjrcu@CS_BDP_ZJRCU',
  'properties.hbase.master.kerberos.principal' = 'hbase/hadoop.cs_bdp_zjrcu@CS_BDP_ZJRCU',
  'properties.hbase.rpc.protection' = 'authentication',
  'properties.zookeeper.znode.parent' = '/hbase',
  'properties.hbase.security.authorization' = 'true',
  'properties.hbase.security.authentication' = 'kerberos'
);
insert into
  hbasesink1
select
  concat('rowkey_', cast(uuid as STRING)) as rowkey,
  ROW(name, age) as f1
from
  datagen1;
insert into
  hbasesink2
select
  concat('rowkey_', cast(uuid as STRING)) as rowkey,
  ROW(name, age) as f1
from
  datagen1;

111.png

2、数据写入情况验证

A集群写入情况113.pngB集群写入情况114.png

【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。