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使用入门)