栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

flink轮询写入local节点

flink轮询写入local节点

1.通过分布式表解析数据库名字、local表名、对应集群名称

SELECt engine_full FROM system.tables WHERe database = ? AND name = ?

 String cluster = matcher.group("cluster");
                        String database = matcher.group("database");
                        String table = matcher.group("table");

2.获取集群所有IP地址

SELECt shard_num, host_address, port FROM system.clusters WHERe cluster = ? and replica_num = 1 ORDER BY shard_num ASC

 String host = rs.getString("host_address");
                    int port = getActualHttpPort(host, rs.getInt("port"));
                    urls.add("clickhouse://" + host + ":" + port);

3.通过for去轮询所有得到的IP地址插入到对应的local表

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/744942.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号