opentsdb分布式时间序列数据库如何安装
这篇文章将为大家详细讲解有关opentsdb分布式时间序列数据库如何安装,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
创新互联坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站制作、网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的泽普网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
简介:
opentsdb是一个分布式、易扩展的分布式时间序列数据库。基于HBase做存储,一方面使其能支持海量的数据,一方面也非常容易扩展。主要用于一些服务的监控,比如性能等等。
官方文档:
http://opentsdb.net/docs/build/html/installation.html#runtime-requirements
http://opentsdb.net/docs/build/html/user_guide/configuration.html
前期准备:
A Linux system
Java Runtime Environment 1.6 or later
HBase 0.92 or later
GnuPlot 4.2 or later
HBase、ZooKeeper:线上已经安装好,文章不在讲述
安装过程:
1) 依赖库安装:
sudo yum install -y gd gd-devel libpng libpng-devel
2) gnuplot-5.0.1安装:
下载,解压,三步走(./configure & make & make install) #不用指定prefix前缀,会安装到prefix指定目录下的 /share /bin /libexec下
3)安装opentsdb,
下载tar或者git clone , ./build.sh #服务器需要能连接外网
编译日志:
Linking into /home/hadoop/opentsdb/build/gwt/queryui --后面遇到了问题,根据编译日志解决
Link succeeded
Compilation succeeded -- 30.289s
/bin/mkdir -p staticroot
cp ../src/tsd/static/favicon.ico ../src/tsd/static/opentsdb_header.jpg staticroot
find -L staticroot -type l -exec rm {} \;
p=`pwd`/gwt/queryui && cd staticroot \
&& for i in $p/*; do ln -s -f "$i" || break; done
find -L staticroot/gwt -type f | xargs touch
make64[1]: Leaving directory `/home/hadoop/opentsdb/build'
建表:
env COMPRESSION=NONE HBASE_HOME=/home/hadoop/hbase-1.0.0-cdh6.5.1/ ./src/create_table.sh #根据需要自己判断是否使用压缩
修改配置:
OpenTSDB 2.2 works off a configuration file that is shared between the daemon and command line tools. If you compiled from source, copy the ./src/opentsdb.conf file to a proper directory as documented in Configuration and edit the following, required settings: tsd.http.cachedir - Path to write temporary files to tsd.http.staticroot - Path to the static GUI files found in ./build/staticroot tsd.storage.hbase.zk_quorum - If HBase and Zookeeper are not running on the same machine, specify the host and port here. With the config file written, you can start a tsd with the command: You can use the --config command line argument to specify the full path to a configuration file. Otherwise if not specified, OpenTSDB and some of the command-line tools will attempt to search for a valid configuration file in the following locations: ./opentsdb.conf /etc/opentsdb.conf /etc/opentsdb/opentsdb.conf /opt/opentsdb/opentsdb.conf
修改的配置: cp src/opentsdb.conf . #按官方文档,复制配置文件到opentsdb安装目录 tsd.network.port = 8999 #端口修改 # The location of static files for the HTTP GUI interface. # *** REQUIRED *** tsd.http.staticroot = /home/data/opentsdb/static #自己定义的,有问题,看问题2 = /home/hadoop/opentsdb/build/staticroot #正确的 # Where TSD should write it's cache files to # *** REQUIRED *** tsd.http.cachedir = /home/data/opentsdb/cache tsd.storage.hbase.zk_quorum = host1:2181,host:2181,host3:2181
++++++++++++++++++++++++++++++ 遇到的问题和解决办法 ++++++++++++++++++++++++++
问题1:日志目录
16:46:33,197 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Active log file name: /var/log/opentsdb/opentsdb.log
16:46:33,197 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - File property is set to [/var/log/opentsdb/opentsdb.log]
16:46:33,198 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - Failed to create parent directories for [/var/log/opentsdb/opentsdb.log]
16:46:33,199 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[FILE] - openFile(/var/log/opentsdb/opentsdb.log,true) call failed. java.io.FileNotFoundException: /var/log/opentsdb/opentsdb.log (No such file or directory)
修改:src/logback.xml 把日志目录改成自己定义的
问题2:web界面打不开,日志报找不到文件
2016-07-05 16:48:03,362 INFO [OpenTSDB I/O Worker #1] HttpQuery: [id: 0xd617c536, /xxx:xxx:xx:xx:52403 => /xx:xx:xx:xx:8999] HTTP /s/opentsdb_header.jpg done in 0ms
2016-07-05 16:48:03,810 WARN [OpenTSDB I/O Worker #1] HttpQuery: [id: 0xd617c536, /xx:xx:xx:xx:52403 => /xx:xx:xx:xx:8999] File not found: /home/data/opentsdb/static/favicon.ico (No such file or directory)
查看编译时的日志:
Linking into /home/hadoop/opentsdb/build/gwt/queryui
Link succeeded
Compilation succeeded -- 30.289s
/bin/mkdir -p staticroot
cp ../src/tsd/static/favicon.ico ../src/tsd/static/opentsdb_header.jpg staticroot
修改配置:
tsd.http.staticroot = /home/hadoop/opentsdb/build/staticroot
关于“opentsdb分布式时间序列数据库如何安装”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
标题名称:opentsdb分布式时间序列数据库如何安装
当前链接:http://scyanting.com/article/pjspsc.html