(三)常用命令以及查询的模板

3 篇文章 0 订阅
3 篇文章 0 订阅

1.sql带有时间的模式:

select count(*) from "behavior-h5sdk" where "__time" BETWEEN TIMESTAMP '2019-01-30 00:00:00' AND TIMESTAMP '2019-01-30 23:59:59'  

##所有的时间相关的查询的列都是用"__time"这个字段
时间格式的函数:

select DATE_TRUNC('day',"__time"),count(*) from "updates-tutorial" group by DATE_TRUNC('day',"__time")     ##把时间戳 2019-02-04T00:00:00.000Z 转换成 day的级别 2019-02-04

2.上传数据:

curl -X 'POST' -H 'Content-Type:application/json' -d @/data/upload/example-index.json http://prestoslave01:8090/druid/indexer/v1/task
##  /data/upload/example-index.json 为druid中data角色的节点的目录,example-index.json 为上传数据的json格式文件。
## prestoslave01:8090 为druid 的active的主节点的地址

3.查询数据:

curl -X POST 'prestoslave02:8082/druid/v2/?pretty' -H 'Content-Type:application/json' -H 'Accept:application/json' -d @quickstart/wikipedia-top-pages.json
## prestoslave02:8082 为druid中的查询节点,也就是query节点的地址和端口
## quickstart/wikipedia-top-pages.json 这个是采用的相对路径的文件来进行查询

4.获取所有的实时数据流的supervise: curl http://prestoslave01:8081/druid/indexer/v1/supervisor?full

5.查询某台服务器是否为druid的leader:

curl -H 'Content-Type:application/json' http://prestoslave01:8081/druid/coordinator/v1/leader

6.supervise的信息获取的命令
获取指定supervise id的Spec :

 curl http://prestoslave01:8081/druid/indexer/v1/supervisor/behavior-h5sdk
 # 这里的supervise id为 behavior-h5sdk
 获取druid消费kafka数据的offset以及延迟的基本情况报告    curl http://prestoslave01:8081/druid/indexer/v1/supervisor/behavior-h5sdk/status # 这里的supervise id为 behavior-h5sdk
 获取指定supervisor id的历史spec :  curl http://prestoslave01:8081/druid/indexer/v1/supervisor/behavior-h5sdk/history
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值