opentsdb使用入门

文章出自:http://blog.csdn.net/eryk86/article/details/9317677

使用snappy压缩方式建表语句,需要hbase集群安装了snappy
env COMPRESSION=snappy ./opentsdb/src/create_table.sh

启动方式
nohup opentsdb/build/tsdb tsd --port=4242 --staticroot=opentsdb/build/staticroot --cachedir="/tmp/tsdtmp" --auto-metric  --zkquorum ZOOKEEPERQUORUM &
参数说明
./opentsdb/build/tsdb tsd

Usage: tsd --port=PORT --staticroot=PATH --cachedir=PATH
Starts the TSD, the Time Series Daemon
  --auto-metric         Automatically add metrics to tsdb as they are inserted.  Warning: this may cause unexpected metrics to be tracked
  --cachedir=PATH       Directory under which to cache result of requests.
  --flush-interval=MSEC Maximum time for which a new data point can be buffered (default: 1000).
  --port=NUM            TCP port to listen on.
  --staticroot=PATH     Web root from which to serve static files (/s URLs).
  --table=TABLE         Name of the HBase table where to store the time series (default: tsdb).
  --uidtable=TABLE      Name of the HBase table to use for Unique IDs (default: tsdb-uid).
  --zkbasedir=PATH      Path under which is the znode for the -ROOT- region (default: /hbase).
  --zkquorum=SPEC       Specification of the ZooKeeper quorum to use (default: localhost).

如果加了--auto-metric 选项,发送到tsd服务器的metrics如果不存在就会自动创建,如果tsd服务器收到未创建的metrics会报错。
手工创建metrics方式:
opentsdb/build/tsdb mkmetric
Usage: uid <subcommand> args
Sub commands:
  grep [kind] <RE>: Finds matching IDs.
  assign <kind> <name> [names]: Assign an ID for the given name(s).
  rename <kind> <name> <newname>: Renames this UID.
  fsck: Checks the consistency of UIDs.
  [kind] <name>: Lookup the ID of this name.
  [kind] <ID>: Lookup the name of this ID.

Example values for [kind]: metric, tagk (tag name), tagv (tag value).
kind在用java api创建时会用到。
OpenTSDB旨在在查询执行期间有效地组合多个不同的时间序列。这样做的原因是,当用户查看他们的数据时,他们通常会从较高的级别开始询问诸如“数据中心的总吞吐量是多少?”之类的问题。或“按地区划分的当前用功耗是多少?”。在查看这些高级别值之后,可能会出现一个或多个值,因此用户可以深入研究更详细的数据集,例如“我的LAX数据中心主机的吞吐量是多少?”。我们希望能够轻松回答这些高级问题,但仍然可以深入了解更多细节。 但是,如何将多个单独的时间序列合并为一个系列的数据呢?聚合函数提供了将不同时间序列数学方式将不同时间序列合并为一个的方法。过滤器用于按标签对结果进行分组,然后将聚合应用于每个组。聚合类似于SQL的GROUP BY子句,其中用户选择预定义的聚合函数以将多个记录合并为单个结果。但是在TSD中,每个时间戳和组聚合一组记录。 每个聚合器都有两个组件: 功能 - 应用的数学计算,例如对所有值求和,计算平均值或选择最高值。 插值 - 一种处理缺失值的方法,例如当时间序列A的值为T1但时间序列B没有值时。 本文档重点介绍如何在一个组中按上下文使用聚合器,即将多个时间序列合并为一个时。此外,聚合器可用于下采样时间序列(即返回较低分辨率的结果集)。有关更多信息,请参阅下采样。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值