Skip to content

Instantly share code, notes, and snippets.

@zhuqling
Created October 23, 2018 01:35
Show Gist options
  • Save zhuqling/dd5adbe82c6922533010d6feea341e96 to your computer and use it in GitHub Desktop.
Save zhuqling/dd5adbe82c6922533010d6feea341e96 to your computer and use it in GitHub Desktop.
druid.io实时schema配置
{
"dataSources" : {
"test1" : {
"spec" : {
"dataSchema" : {
"dataSource" : "test1",
"parser" : {
"type" : "string",
"parseSpec" : {
"timestampSpec" : { "column" : "timestamp", "format" : "auto" },
"dimensionsSpec" : {
"dimensions" : ["pm", "user"],
"dimensionExclusions" : []
},
"format" : "json"
}
},
"metricsSpec" : [
{ "name" : "qty", "type" : "longSum", "fieldName" : "qty" },
{ "name" : "total", "type" : "longSum", "fieldName" : "total" }
],
"granularitySpec" : {
"type" : "uniform",
"segmentGranularity" : "day",
"queryGranularity" : "none"
}
},
"tuningConfig" : {
"type" : "realtime",
"maxRowsInMemory" : "100000",
"intermediatePersistPeriod" : "P1D",
"windowPeriod" : "P1D"
}
},
"properties" : {
"task.partitions" : "1",
"task.replicants" : "1"
}
},
"metrics" : {
"spec" : {
"dataSchema" : {
"dataSource" : "metrics",
"parser" : {
"type" : "string",
"parseSpec" : {
"timestampSpec" : {
"column" : "timestamp",
"format" : "auto"
},
"dimensionsSpec" : {
"dimensions" : [],
"dimensionExclusions" : [
"timestamp",
"value"
]
},
"format" : "json"
}
},
"granularitySpec" : {
"type" : "uniform",
"segmentGranularity" : "hour",
"queryGranularity" : "none"
},
"metricsSpec" : [
{
"type" : "count",
"name" : "count"
},
{
"name" : "value_sum",
"type" : "doubleSum",
"fieldName" : "value"
},
{
"fieldName" : "value",
"name" : "value_min",
"type" : "doubleMin"
},
{
"type" : "doubleMax",
"name" : "value_max",
"fieldName" : "value"
}
]
},
"ioConfig" : {
"type" : "realtime"
},
"tuningConfig" : {
"type" : "realtime",
"maxRowsInMemory" : "100000",
"intermediatePersistPeriod" : "PT10M",
"windowPeriod" : "PT10M"
}
},
"properties" : {
"task.partitions" : "1",
"task.replicants" : "1"
}
}
},
"properties" : {
"zookeeper.connect" : "master.example.com",
"druid.discovery.curator.path" : "/druid/discovery",
"druid.selectors.indexing.serviceName" : "druid/overlord",
"http.port" : "8200",
"http.threads" : "8"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment