博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenTSDB安装
阅读量:4700 次
发布时间:2019-06-09

本文共 3777 字,大约阅读时间需要 12 分钟。

时序数据库

  • 时序数据库全称为时间序列数据库。主要用于处理带时间标签(按照时间的顺序变化,即时间序列化)的数据,带时间标签的数据也称为时间序列数据。时间序列数据主要由电力行业、化工行业、物联网行业等各类型实时监测、检查与分析设备所采集、产生的数据,这些数据的典型特点是:产生频率快(每一个监测点一秒钟内可产生多条数据)、严重依赖于采集时间(每一条数据均要求对应唯一的时间)、测点多信息量大(常规的实时监测系统均有成千上万的监测点,监测点每秒钟都产生数据,每天产生几十GB的数据量)。

  • 时序数据库最新排名():

  

OpenTSDB介绍

  1. OpenTSDB用HBase存储所有的时序来构建一个分布式、可伸缩的时间序列数据库。它支持秒级数据采集所有metrics,支持永久存储,可以做容量规划,并很容易的接入到现有的报警系统里。OpenTSDB可以从大规模的集群(包括集群中的网络设备、操作系统、应用程序)中获取相应的metrics并进行存储、索引以及服务,从而使得这些数据更容易让人理解,如web化、图形化等。

  2. 底层使用Hbase作为其分布式存储引擎,采用的也是LSM tree。

  • 官网地址:
  • 源代码:

安装

  • 安装依赖
jdkhbase
  • Opentsdb依赖Gnuplot,它 是一个命令行的交互式绘图工具。用户通过输入命令,可以逐步设置或修改绘图环境,并以图形描述数据或函数,使我们可以借由图形做更进一步的分析。
yum install gnuplot
  • 下载源码包:
wget https://github.com/OpenTSDB/opentsdb/releases/download/v2.3.0/opentsdb-2.3.0.tar.gz
  • 解压:
tar zxvf opentsdb-2.3.0.tar.gz
  • 进目录
cd opentsdb-2.3.0
  • 编译安装
./build.sh cd buildmake install

配置OpenTSDB

# vim ./opentsdb.conf# The TCP port TSD should use for communications # *** REQUIRED *** tsd.network.port = 4242 # The location of static files for the HTTP GUI interface. # *** REQUIRED *** tsd.http.staticroot =build/staticroot # Where TSD should write it's cache files to # *** REQUIRED *** tsd.http.cachedir = /tmp/tsd # Whether or not to automatically create UIDs for new metric types, default is False tsd.core.auto_create_metrics = true # A comma separated list of Zookeeper hosts to connect to tsd.storage.hbase.zk_quorum = cdhmanager:2181 # Cover duplicates data tsd.storage.fix_duplicates = true

配置参数优先级:命令行参数 > 配置文件 > 默认值

你可以在命令行中通过--config指定配置文件所在路径,如果没有指定,OpenTSDB会从以下路径寻找配置文件:

  • ./opentsdb.conf
  • /etc/opentsdb.conf
  • /etc/opentsdb/opentsdb.conf
  • /opt/opentsdb/opentsdb.conf
protected void loadConfig() throws IOException { if (config_location != null && !config_location.isEmpty()) { loadConfig(config_location); return; } final ArrayList
file_locations = new ArrayList
(); // search locally first file_locations.add("opentsdb.conf"); // add default locations based on OS if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")) { file_locations.add("C:\\Program Files\\opentsdb\\opentsdb.conf"); file_locations.add("C:\\Program Files (x86)\\opentsdb\\opentsdb.conf"); } else { file_locations.add("/etc/opentsdb.conf"); file_locations.add("/etc/opentsdb/opentsdb.conf"); file_locations.add("/opt/opentsdb/opentsdb.conf"); } for (String file : file_locations) { try { FileInputStream file_stream = new FileInputStream(file); Properties props = new Properties(); props.load(file_stream); // load the hash map loadHashMap(props); } catch (Exception e) { // don't do anything, the file may be missing and that's fine LOG.debug("Unable to find or load " + file, e); continue; } // no exceptions thrown, so save the valid path and exit LOG.info("Successfully loaded configuration file: " + file); config_location = file; return; } LOG.info("No configuration found, will use defaults"); }

创建表

env COMPRESSION=NONE HBASE_HOME=/usr ./src/create_table.sh
  • COMPRESSION=NONE,不使用压缩。如使用则需修改hadoop配置。

  • 脚本会在hbase中自动创建tsdb所用到的表

create 'tsdb-uid',  {
NAME => 'id', COMPRESSION => 'NONE', BLOOMFILTER => 'ROW'}, { NAME => 'name', COMPRESSION => 'NONE', BLOOMFILTER => 'ROW'} 0 row(s) in 3.3470 seconds Hbase::Table - tsdb-uid create 'tsdb', { NAME => 't', VERSIONS => 1, COMPRESSION => 'NONE', BLOOMFILTER => 'ROW'} 0 row(s) in 0.3780 seconds Hbase::Table - tsdb create 'tsdb-tree', { NAME => 't', VERSIONS => 1, COMPRESSION => 'NONE', BLOOMFILTER => 'ROW'} 0 row(s) in 0.4340 seconds Hbase::Table - tsdb-tree create 'tsdb-meta', { NAME => 'name', COMPRESSION => 'NONE', BLOOMFILTER => 'ROW'} 0 row(s) in 0.3780 seconds

log

logback.xml 配置文件放入src目录中即可

start

nohup /opt/opentsdb-2.3.0/build/tsdb tsd --config=/opt/opentsdb-2.3.0/src/opentsdb.conf >/dev/null 2>&1 &

访问页面

转载于:https://www.cnblogs.com/zouhao/p/9864799.html

你可能感兴趣的文章
记一些从数学和程序设计中体会到的思想
查看>>
题目1462:两船载物问题
查看>>
POJ 2378 Tree Cutting(树形DP,水)
查看>>
第二冲刺阶段个人博客5
查看>>
UVA 116 Unidirectional TSP (白书dp)
查看>>
第三方测速工具
查看>>
MySQL 网络访问连接
查看>>
在aws ec2上使用root用户登录
查看>>
数据访问 投票习题
查看>>
cnblog!i'm coming!
查看>>
使用点符号代替溢出的文本
查看>>
Axios 中文说明
查看>>
fatal: remote origin already exists.
查看>>
gridview 自定义value值
查看>>
2018二月实现计划成果及其三月规划
查看>>
类名.class和getClass()区别
查看>>
12/17面试题
查看>>
LeetCode 242. Valid Anagram
查看>>
JSP表单提交乱码
查看>>
如何适应现代雇佣关系
查看>>