Apache Druid常用API

简介: Apache Druid常用API

1.查询某个Meta Datasource下所有的segments

GET http://coordinator_hostname:8081/druid/coordinator/v1/metadata/datasources/datasource_name/segments/

GET http://coordinator_hostname:8062/druid/coordinator/v1/metadata/datasources/T24R16_RATE1/segments/

["T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T0
9:53:03.923Z_1","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z_10","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00
.000Z_2018-11-30T09:53:03.923Z_11","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z_12"]

2.查询某个Meta Datasource下某个segment

GET http://coordinator_hostname:8081/druid/coordinator/v1/metadata/datasources/datasource_name/segments/segment_id

GET http://coordinator_hostname:8062/druid/coordinator/v1/metadata/datasources/T24R16_RATE1/segments/T24R16_RATE1_2018-12-12T00:00:00.000Z_2018-12-13T00:00:00.000Z_2018-12-11T16:02:01.049Z_11

{"dataSource":"T24R16_RATE1","interval":"2018-12-12T00:00:00.000Z/2018-12-13T00:00:00.000Z","version":"2018-12-11T16:02:01.049Z","loadSpec":{"type":"hdfs","path":"hdfs://namenodea.bos.opmbd.com:8020/druid/segments/T24R16_RATE1/20181212T000000.000Z_20181213T000000.000Z/2018-12-11T16_02_01.049Z/11_4a80ec61-cb8e-4fc0-ab0b-802f57fd4b4a_index.zip"},"dimensions":"appName,nodeName,isFundTrans,transType,requestTime,channelSubSystem,errorCode,errorMessage,hour,day,year,month","metrics":"TotalTransCount,SuccessTransCount,FaildTransCount,MaxProcessTime,MinProcessTime,TotalProcessTime","shardSpec":{"type":"numbered","partitionNum":11,"partitions":0},"binaryVersion":9,"size":3569916,"identifier":"T24R16_RATE1_2018-12-12T00:00:00.000Z_2018-12-13T00:00:00.000Z_2018-12-11T16:02:01.049Z_11"}

3.删除某个Datasource下的某个segment

DELETE http://coordinator_hostname:8081/druid/coordinator/v1/metadata/datasources/datasource_name/segments/segment_id

4.停止流任务

POST http://overlord_hostname:8090/druid/indexer/v1/supervisor/datasource_name/shutdown

5.查看流任务状态

GET http://overlord_hostname:8090/druid/indexer/v1/supervisor/datasource_name/status

GET  http://overlord_hostname:8065/druid/indexer/v1/supervisor/T24R16_RATE1/status

{"id":"T24R16_RATE1","generationTime":"2018-12-12T10:27:17.774Z","payload":{"dataSource":"T24R16_RATE1","topic":"T24R16APP4","partitions":1,"replicas":1,"durationSeconds":3600,"activeTasks":[{"id":"index_kafka_T24R16_RATE1_aad49f137ceda5f_habbdajf","startingOffsets":{"0":256596818},"startTime":"2018-12-12T09:27:57.321Z","remainingSeconds":39,"type":"ACTIVE","currentOffsets":{"0":257093461},"lag":{"0":0}}],"publishingTasks":[],"latestOffsets":{"0":257093461},"minimumLag":{"0":0},"aggregateLag":0,"offsetsLastUpdated":"2018-12-12T10:26:58.085Z"}}

6.查看Meta Datasource信息

GET http://coordinator_hostname:8081/druid/coordinator/v1/metadata/datasources/datasource_name/

GET http://coordinator_hostname:8062/druid/coordinator/v1/metadata/datasources/T24R16_RATE1

{"name":"T24R16_RATE1","properties":{"created":"2018-12-12T10:27:44.208Z"},"segments":[{"dataSource":"T24R16_RATE1","interval":"2018-11-27T00:00:00.000Z/2018-11-28T00:00:00.000Z","version":"2018-11-30T09:53:03.923Z","loadSpec":{"type":"hdfs","path":"hdfs://namenodea.bos.opmbd.com:8020/druid/segments/T24R16_RATE1/20181127T000000.000Z_20181128T000000.000Z/2018-11-30T09_53_03.923Z/0_aedd22eb-1c30-428c-9ab4-e346d84150e0_index.zip"},"dimensions":"appName,nodeName,isFundTrans,transType,requestTime,channelSubSystem,errorCode,errorMessage","metrics":"TotalTransCount,SuccessTransCount,FaildTransCount,MaxProcessTime,MinProcessTime,TotalProcessTime","shardSpec":{"type":"numbered","partitionNum":0,"partitions":0},"binaryVersion":9,"size":3603204,"identifier":"T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z"},{"dataSource":"T24R16_RATE1","interval":"2018-11-27T00:00:00.000Z/2018-11-28T00:00:00.000Z","version":"2018-11-30T09:53:03.923Z","loadSpec":{"type":"hdfs","path":"hdfs://namenodea.bos.opmbd.com:8020/druid/segments/T24R16_RATE1/20181127T000000.000Z_20181128T000000.000Z/2018-11-30T09_53_03.923Z/1_34ff3724-af5d-43ea-903d-e2ec7c0d3ccd_index.zip"},"dimensions":"appName,nodeName,isFundTrans,transType,requestTime,channelSubSystem,errorCode,errorMessage","metrics":"TotalTransCount,SuccessTransCount,FaildTransCount,MaxProcessTime,MinProcessTime,TotalProcessTime","shardSpec":{"type":"numbered","partitionNum":1,"partitions":0},"binaryVersion":9,"size":3609845,"identifier":"T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z_1"}]}

7.查看DataSource Rule

GET http://coordinator_hostname:8081/druid/coordinator/v1/rules/datasource_name>

GET http://coordinator_hostname:8062/druid/coordinator/v1/rules

{"_default":[{"tieredReplicants":{"_default_tier":1},"type":"loadForever"},{"type":"dropForever"}],"APP_T24_HOUR":[],"T24R16_TransMonitor":[],"APP_T24_MINUTE":[]}

GET http://coordinator_hostname:8062/druid/coordinator/v1/rules/T24R16_RATE1
[]

8.查看Datasource信息

GET http://coordinator_hostname:8081/druid/coordinator/v1/datasources/datasource_name

GET http://coordinator_hostname:8062/druid/coordinator/v1/datasources/T24R16_RATE1

{"tiers":{"_default_tier":{"size":3658919489,"segmentCount":1163}},"segments":{"maxTime":"2018-12-13T00:00:00.000Z","size":3658919489,"minTime":"2018-11-27T00:00:00.000Z","count":1163}}

9.查看某个Datasource下所有的segments

GET http://coordinator_hostname:8081/druid/coordinator/v1/datasources/datasource_name/segments

GET http://coordinator_hostname:8062/druid/coordinator/v1/datasources/T24R16_RATE1/segments

["T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z_1","T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z_10"]

10.查看某个Datasource下某个segment

GET http://coordinator_hostname:8081/druid/coordinator/v1/datasources/datasource_name/segments/

GET http://coordinator_hostname:8062/druid/coordinator/v1/datasources/T24R16_RATE1/segments/T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z

{"metadata":{"dataSource":"T24R16_RATE1","interval":"2018-11-27T00:00:00.000Z/2018-11-28T00:00:00.000Z","version":"2018-11-30T09:53:03.923Z","loadSpec":{"type":"hdfs","path":"hdfs://namenodea.bos.opmbd.com:8020/druid/segments/T24R16_RATE1/20181127T000000.000Z_20181128T000000.000Z/2018-11-30T09_53_03.923Z/0_aedd22eb-1c30-428c-9ab4-e346d84150e0_index.zip"},"dimensions":"appName,nodeName,isFundTrans,transType,requestTime,channelSubSystem,errorCode,errorMessage","metrics":"TotalTransCount,SuccessTransCount,FaildTransCount,MaxProcessTime,MinProcessTime,TotalProcessTime","shardSpec":{"type":"numbered","partitionNum":0,"partitions":0},"binaryVersion":9,"size":3603204,"identifier":"T24R16_RATE1_2018-11-27T00:00:00.000Z_2018-11-28T00:00:00.000Z_2018-11-30T09:53:03.923Z"},"servers":["datanode3.bos.opmbd.com:8063"]}

11.删除Task任务状态

POST http://overlord_hostname:8090/druid/indexer/v1/task/taskId/shutdown

12.查看Task任务状态

GET http://overlord_hostname:8090/druid/indexer/v1/task/taskId/status

GET  http://overlord_hostname:8065/druid/indexer/v1/task/index_kafka_APP_T24_HOUR_d95f44c20fab354_pinifbki/status

{"task":"index_kafka_APP_T24_HOUR_d95f44c20fab354_pinifbki","status":{"id":"index_kafka_APP_T24_HOUR_d95f44c20fab354_pinifbki","status":"RUNNING","duration":-1}}

13.查看Task任务的所有segments

GET http://overlord_hostname:8090/druid/indexer/v1/task/taskId/segments

GET  http://overlord_hostname:8065/druid/indexer/v1/task/index_kafka_APP_T24_MINUTE_54cae6981ec8880_cfigommg/segments

[{"dataSource":"APP_T24_MINUTE","interval":"2018-12-12T00:00:00.000Z/2018-12-13T00:00:00.000Z","version":"2018-12-11T16:02:01.042Z","loadSpec":{"type":"hdfs","path":"hdfs://namenodea.bos.opmbd.com:8020/druid/segments/APP_T24_MINUTE/20181212T000000.000Z_20181213T000000.000Z/2018-12-11T16_02_01.042Z/18_76923693-dc73-4a05-931d-fe0488be7cbd_index.zip"},"dimensions":"appName,nodeName,isFundTrans,transType","metrics":"TotalTransCount,SuccessTransCount,FaildTransCount,MaxProcessTime,MinProcessTime,TotalProcessTime","shardSpec":{"type":"numbered","partitionNum":18,"partitions":0},"binaryVersion":9,"size":109031,"identifier":"APP_T24_MINUTE_2018-12-12T00:00:00.000Z_2018-12-13T00:00:00.000Z_2018-12-11T16:02:01.042Z_18"}]

14.查看正在进行的任务

GET http://overlord_hostname:8090/druid/indexer/v1/runningTasks

GET  http://overlord_hostname:8065/druid/indexer/v1/runningTasks

[{"id":"index_kafka_APP_T24_HOUR_d95f44c20fab354_pinifbki","createdTime":"2018-12-12T06:04:32.957Z","queueInsertionTime":"2018-12-12T06:04:32.960Z","statusCode":null,"duration":null,"location":{"host":"datanode3.bos.opmbd.com","port":8103,"tlsPort":-1}},{"id":"index_kafka_APP_T24_MINUTE_d3b476e5aca2159_mohihhoi","createdTime":"2018-12-12T10:37:47.789Z","queueInsertionTime":"2018-12-12T10:37:47.791Z","statusCode":null,"duration":null,"location":{"host":"datanode3.bos.opmbd.com","port":8102,"tlsPort":-1}},{"id":"index_kafka_T24R16_RATE1_1a2bfc23f45339e_mijfgcje","createdTime":"2018-12-12T10:27:58.430Z","queueInsertionTime":"2018-12-12T10:27:58.432Z","statusCode":null,"duration":null,"location":{"host":"datanode3.bos.opmbd.com","port":8101,"tlsPort":-1}},{"id":"index_kafka_T24R16_TransMonitor_df0b26842cf98c8_llfmpjpg","createdTime":"2018-12-12T10:38:28.626Z","queueInsertionTime":"2018-12-12T10:38:28.628Z","statusCode":null,"duration":null,"location":{"host":"datanode3.bos.opmbd.com","port":8104,"tlsPort":-1}}]

15.查看正在等待的任务

GET http://overlord_hostname:8090/druid/indexer/v1/waitingTasks

GET  http://localhost:8065/druid/indexer/v1/waitingTasks

16.查看正在挂起的任务

GET http://overlord_hostname:8090/druid/indexer/v1/pendingTasks

GET  http://localhost:8065/druid/indexer/v1/pendingTasks

17.查看所有Datasources

GET http://coordinator_hostname:8081/druid/coordinator/v1/datasources/

GET http://coordinator_hostname:8062/druid/coordinator/v1/datasources/

["APP_T24_HOUR","APP_T24_MINUTE","T24R16_RATE1","T24R16_TransMonitor","wikiticker"]

18.查看完成的任务

GET http://overlord_hostname:8090/druid/indexer/v1/completeTasks

GET  http://overlord_hostname:8065/druid/indexer/v1/completeTasks

[{"id":"index_kafka_T24R16_TransMonitor_ec92905e89f1403_eaaplohe","createdTime":"2018-12-12T09:38:18.598Z","queueInsertionTime":"1970-01-01T00:00:00.000Z","statusCode":"SUCCESS","duration":3670040,"location":{"host":null,"port":-1,"tlsPort":-1}},{"id":"index_kafka_APP_T24_MINUTE_54cae6981ec8880_cfigommg","createdTime":"2018-12-12T09:37:38.075Z","queueInsertionTime":"1970-01-01T00:00:00.000Z","statusCode":"SUCCESS","duration":3729859,"location":{"host":null,"port":-1,"tlsPort":-1}},{"id":"index_kafka_T24R16_RATE1_aad49f137ceda5f_habbdajf","createdTime":"2018-12-12T09:27:48.518Z","queueInsertionTime":"1970-01-01T00:00:00.000Z","statusCode":"SUCCESS","duration":3729979,"location":{"host":null,"port":-1,"tlsPort":-1}},{"id":"index_kafka_T24R16_TransMonitor_58f6e0029909c7e_ldnbhmff","createdTime":"2018-12-12T08:38:08.720Z","queueInsertionTime":"1970-01-01T00:00:00.000Z","statusCode":"SUCCESS","duration":3669990,"location":{"host":null,"port":-1,"tlsPort":-1}},{"id":"index_kafka_APP_T24_MINUTE_48ae762357d6961_fkgeeied","createdTime":"2018-12-12T08:37:28.253Z","queueInsertionTime":"1970-01-01T00:00:00.000Z","statusCode":"SUCCESS","duration":3669934,"location":{"host":null,"port":-1,"tlsPort":-1}}]

19.查看集群所有节点信息

GET http://coordinator_hostname:8081/druid/coordinator/v1/servers?simple

GET http://coordinator_hostname:8062/druid/coordinator/v1/servers?simple

[{"host":"datanode3.bos.opmbd.com:8102","tier":"_default_tier","type":"indexer-executor","priority":0,"currSize":0,"maxSize":0},{"host":"datanode3.bos.opmbd.com:8101","tier":"_default_tier","type":"indexer-executor","priority":0,"currSize":0,"maxSize":0},{"host":"datanode3.bos.opmbd.com:8104","tier":"_default_tier","type":"indexer-executor","priority":0,"currSize":0,"maxSize":0},{"host":"datanode3.bos.opmbd.com:8103","tier":"_default_tier","type":"indexer-executor","priority":0,"currSize":0,"maxSize":0},{"host":"datanode3.bos.opmbd.com:8063","tier":"_default_tier","type":"historical","priority":0,"currSize":3794792640,"maxSize":130000000000}]

20.重启任务

curl -X 'POST' -H 'Content-Type:application/json' -d @supervisor/T24R16-rate-index.json overlord_hostname:8065/druid/indexer/v1/supervisor

目录
相关文章
|
1月前
|
监控 负载均衡 API
Apache Apisix轻松打造亿级流量Api网关
Apache APISIX 是一个动态、实时、高性能的 API 网关,提供负载均衡、动态上行、灰度发布、熔断、鉴权、可观测等丰富的流量管理功能。适用于处理传统南北向流量、服务间东西向流量及 k8s 入口控制。Airflow 是一个可编程、调度和监控的工作流平台,基于有向无环图 (DAG) 定义和执行任务,提供丰富的命令行工具和 Web 管理界面,方便系统运维和管理。
Apache Apisix轻松打造亿级流量Api网关
|
2月前
|
存储 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
43 1
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(一)
|
2月前
|
存储 分布式计算 druid
大数据-149 Apache Druid 基本介绍 技术特点 应用场景
大数据-149 Apache Druid 基本介绍 技术特点 应用场景
67 1
大数据-149 Apache Druid 基本介绍 技术特点 应用场景
|
2月前
|
消息中间件 存储 druid
大数据-156 Apache Druid 案例实战 Scala Kafka 订单统计
大数据-156 Apache Druid 案例实战 Scala Kafka 订单统计
45 3
|
2月前
|
存储 分布式计算 druid
大数据-155 Apache Druid 架构与原理详解 数据存储 索引服务 压缩机制
大数据-155 Apache Druid 架构与原理详解 数据存储 索引服务 压缩机制
65 3
|
2月前
|
消息中间件 分布式计算 druid
大数据-154 Apache Druid 架构与原理详解 基础架构、架构演进
大数据-154 Apache Druid 架构与原理详解 基础架构、架构演进
55 2
|
2月前
|
消息中间件 druid 大数据
大数据-153 Apache Druid 案例 从 Kafka 中加载数据并分析(二)
大数据-153 Apache Druid 案例 从 Kafka 中加载数据并分析(二)
35 2
|
2月前
|
消息中间件 分布式计算 druid
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
大数据-152 Apache Druid 集群模式 配置启动【下篇】 超详细!(二)
42 2
|
2月前
|
消息中间件 分布式计算 druid
大数据-153 Apache Druid 案例 从 Kafka 中加载数据并分析(一)
大数据-153 Apache Druid 案例 从 Kafka 中加载数据并分析(一)
56 1
|
2月前
|
存储 消息中间件 druid
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
大数据-151 Apache Druid 集群模式 配置启动【上篇】 超详细!
88 1

热门文章

最新文章

推荐镜像

更多