您的位置:首页 > 产品设计 > UI/UE

Druid Tranquility使用(上篇)

2017-08-02 00:00 204 查看
1、Tranquility 是单独的http server服务,需要另行下载,下载地址
http://druid.io/downloads.html
2、启动tranquilty

nohup bin/tranquility server -configFile ./conf/pageviews.json >start.log &

json 文件如下:

{
"dataSources" : {
"pageviews" : {
"spec" : {
"dataSchema" : {

"dataSource" : "pageviews",
"parser" : {
"type" : "string",
"parseSpec" : {

"timestampSpec" : {
"column" : "time",
"format" : "auto"
},
"dimensionsSpec" : {

"dimensions" : ["url", "user"],
"dimensionExclusions" : [
"timestamp",
"value"
]
},
"format" : "json"
}
},
"granularitySpec" : {
"type" : "uniform",
"segmentGranularity" : "hour",
"queryGranularity" : "none"
},

"metricsSpec" : [
{
"name": "views",
"type": "count"
},
{
"name": "latencyMs",
"type": "doubleSum",
"fieldName": "latencyMs"
}
]
},
"ioConfig" : {
"type" : "realtime"
},
"tuningConfig" : {
"type" : "realtime",
"maxRowsInMemory" : "100000",
"intermediatePersistPeriod" : "PT10M",
"windowPeriod" : "PT10M"
}
},
"properties" : {
"task.partitions" : "1",
"task.replicants" : "1"
}
}
},
"properties" : {
"zookeeper.connect" : "localhost",
"druid.discovery.curator.path" : "/druid/discovery",
"druid.selectors.indexing.serviceName" : "druid/overlord",
"http.port" : "8200",
"http.threads" : "8"
}
}

3、通过http 直接发送数据 http://192.168.2.41:8200/v1/post/pageviews
{"time": 1501650962363, "url": "/foo/bar", "user": "alice", "latencyMs": 32}



pageviews :datasource

发送成功后 {
"result": {
"received": 5,
"sent": 5
}
}

如果 sent :0 则,数据未正常发送到druid ,未正常发送原因

1、druid 问题 检查middleManger overlord 节点配置内存

2、发送的时间戳,需要在10分钟内
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Druid Tranquility