SmartBI对接FusionInsight MRS Clickhouse
准备clickhouse测试数据
首先查看clickhouseserver实例ip
检查测试用户是否有clickhouse的权限
登录客户端,登录所有的clickhouseserver,创建表
Kinit developuser
登录第一个clickhouseserver: clickhouse client --host 172.16.5.53 --port 21423
建表:CREATE TABLE ceshi_TinyLog(uid Int64,uname String,wid Int64,word String,pv Int64,click Int64,cost float,date Date,time String) ENGINE=TinyLog;
登录另一个clickhouseserver: clickhouse client --host 172.16.5.52 --port 21423
建表:CREATE TABLE ceshi_TinyLog(uid Int64,uname String,wid Int64,word String,pv Int64,click Int64,cost float,date Date,time String) ENGINE=TinyLog;
使用命令传数据
clickhouse client -m --host 172.16.5.53 --port 21423 --database="default" --query="insert into default.ceshi_TinyLog FORMAT CSV" < /opt/clickhousenew.csv
clickhouse client -m --host 172.16.5.52 --port 21423 --database="default" --query="insert into default.ceshi_TinyLog FORMAT CSV" < /opt/clickhousenew.csv
样例数据csv
27,花信风,22,图片,6,0,568.1720730083482,2020-03-16,10:07:01
38,侯振宇,3,官网,4,8,539.9461401800766,2020-03-23,18:11:31
31,韩浩月,9,儿童,5,3,473.69330165688615,2020-04-14,00:43:02
61,恭小兵,10,阅读网,5,9,694.1459730283839,2020-04-03,23:17:17
0,李公明,13,全集观看,18,10,837.9050944474849,2020-04-22,08:35:21
74,傅光明,3,官网,20,0,526.4335879041444,2020-03-02,02:38:17
63,高远,17,房屋租赁,17,8,487.0733326823028,2020-03-17,03:37:22
8,李轶男,11,查询网,8,3,275.12075933899723,2020-04-03,06:38:30
81,杜仲华,6,查询电话,12,5,90.02009064670109,2020-03-18,11:55:54
65,郭妮,0,网站大全,18,9,840.7250869772428,2020-03-01,21:32:25
15,洁尘,26,六年,11,8,529.7926355483769,2020-04-01,12:05:25
clickhouse客户端检查数据:
Kinit developuser
clickhouse client --host 172.16.5.53 --port 21423
启动smartbi,创建数据连接
1.Clickhouse
2. 产品内置
3. ru.yandex.clickhouse.ClickHouseDriver
4. jdbc:clickhouse://172.16.5.53:21421
5. clickhouse用户
6. clickhouse用户密码
测试数据连接
创建数据集
查看数据结果
- 点赞
- 收藏
- 关注作者
评论(0)