Druid Tranquility使用(上篇)

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}

163435_2XpD_3247419.png

pageviews :datasource

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

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

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

2、发送的时间戳,需要在10分钟内

 

转载于:https://my.oschina.net/u/3247419/blog/1499673

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值