OpenTSDB-2.0.0 Installation __opentsdb Installation

Source: Internet
Author: User
Tags log log openssl zookeeper git clone opentsdb automake

1. Introduction
OPENTSDB is a real-time monitoring information collection and display platform on the hbase system. It supports all metrics of second-level data acquisition, supports permanent storage, can do capacity planning, and is easy to access to existing alarm systems. Opentsdb can get the appropriate metrics and storage, indexing, and services from large-scale clusters (including network devices, operating systems, applications) in the cluster, making the data easier to understand, such as web, graphical, and so on.

2, installation
Install Gnuplot
Gnuplot is a command line interactive drawing tool (Command-driven interactive function plotting program). By entering commands, the user can gradually set or modify the drawing environment and graphically describe the data or function so that we can make a further analysis by drawing.
Yum Install Gnuplot

If you are downloading compressed packet compression package, after decompression into the directory to execute./configure; Make Make check; Make install

Download the package installation process as follows:

# based on a minimal installation, your need some packages in order to compile, I suggest
Yum install gcc gcc-c++ make libX11 Xauth
Yum install cairo-devel pango-devel freetype-devel gd-devel
cd/usr/local/src/
wget http://sourceforge.net/projects/gnuplot/files/gnuplot/4.4.2/gnuplot-4.4.2.tar.gz/download
CD gnuplot-4.4.2
Less INSTALL
# Start compiling. I usually install self-compiled stuff At/opt/[pkg-name]
./configure--prefix=/opt/gnuplot442
Make
# Make sure the shipped version of Gnuplot was removed (this isn't probably not necessary but version prevents)
Yum Remove gnuplot
Make install
# You might want to add a symlink
Ln-s/opt/gnuplot442/bin/gnuplot/usr/bin/gnuplot


After the installation is complete, perform gnuplot and confirm that PNG is supported: Execute set terminal to view
If not supported, OPENTSDB will complain when drawing

After installation, you can verify that you can draw the PNG picture normally, and draw a sample of PNG pictures as follows:

[Root@centos] #vim Test.log
23:14 506.877
23:19 501.068
23:24 493.254
23:29 469.184
23:34 460.161
23:39 426.065
23:44 429.734
23:49 409.255
23:54 423.512
23:59 390.676

Then write the gnuplot configuration file as follows:

[Root@centos] #vim log.conf
Set terminal png truecolor size 550,250 #指定输出成png图片, with a picture size of 550x250, which requires ligpng support, default color setting
Set output "Log.png" #指定输出png图片的文件名
Set Autoscale #轴向标记自动控制
Set XData time #X轴数据格式为时间
Set timefmt "%h:%m" #时间输入格式为 "Hours: Minutes"
Set style data lines #数据显示方式为连线
Set Xlabel "Time each day" #X轴标题
Set Ylabel "Mbps" #Y轴标题
Set title "Image.tuku.china.com Flow" #图片标题
Set Grid #显示网格
Plot "Test.log" using 1:2 title "Access_flow" reads the first and second columns as x-axis and y-axis data in the #从test. log file, sample name "Log_flow"

Last Run catlog.conf | Gnuplot command, the Log.png file is generated, as follows:

A PNG image needs to have Arial font support, CentOS in Arial font installation method is as follows:

Often run some biological information software, prompt: Could not find/open font when opening font "Arial", using internalnon-scalable font and other information. At this point, the CentOS system lacks the appropriate font files. You need to install the following steps:

1.widonws download font files to Linux

WINDOWS has more fonts and its font files are located in C:\WINDOWS\Fonts. Copy the appropriate font from it to the/usr/share/font/folder under the Linux system. Take Arial font as an example:

# mkdir/usr/share/fonts/arial

# CP arial*.ttf/usr/share/fonts/arial/

2. Set the cache for the font you just added to make it work

# cd/usr/share/font/arial

# Mkfontscale

# Mkfontdir

# FC-CACHE-FV

After this setting, you can select the font in the system-preferences-appearance-font in the Gnome interface.

3. Set the selection path of Gunplot to Arial

The error on the first page of this article is due to the program call Gunplot, you must let Gunplot recognize the path of the Arial font.

$ exportgdfontpath=/usr/share/fonts/arial

$ exportgnuplot_default_gdfont= "Arial"

Gnuplot Drawing Skills

http://blog.csdn.net/wdzxl198/article/details/8970521

Install autoconf
Autoconf is a tool for generating shell scripts that can automatically configure software source code packs to accommodate a variety of Unix-class systems. The configuration scripts generated by autoconf are not related to autoconf when they are run, which means that the user who configured the script does not need to have autoconf.
Yum Install autoconf


Install Git
Yum-y Install Zlib-devel openssl-devel perl cpio expat-devel Gettext-devel
Yum Install git


Download opentsdb2.0.0 Source
git clone git://github.com/stumbleupon/opentsdb.git

Https://github.com/OpenTSDB/opentsdb/releases/tag/v2.0.0RC1
CD Opentsdb
./build.sh

The execution error message is as follows
Can ' t exec "aclocal": No such file or directory at/usr/share/autoconf/autom4te/fileutils.pm line 326.

Search on the Internet, found the lack of automake tools
Yum Install Automake
After installing Antomake, enter the Opentsdb directory to perform again
./build.sh

3. Set & Run
Start Hadoop and hbase clusters first
Configure the environment variable and execute the following command in the shell:
Env Compression=none hbase_home=/usr/hadoop/bbase0941

./opentsdb/src/create_table.sh
In the hbase pseudo distribution environment looks like to modify create_table.sh, otherwise the table will be stuck:

Exec "$HBH/bin/hbase" Shell <<eof

Create ' $UID _table ', ' id ', ' name '

# {NAME => ' id ', COMPRESSION => ' $COMPRESSION ', Bloomfilter => ' $BLOOMFILTER '},

# {Name => ' name ', COMPRESSION => ' $COMPRESSION ', Bloomfilter => ' $BLOOMFILTER '}

Create ' $TSDB _table ', ' t '

# {NAME => ' t ', versions => 1,compression => ' $COMPRESSION ', Bloomfilter => ' $BLOOMFILTER '}

Create ' $TREE _table ', ' t '

# {NAME => ' t ', versions => 1,compression => ' $COMPRESSION ', Bloomfilter => ' $BLOOMFILTER '}

Create ' $META _table ', ' name '

# {Name => ' name ', COMPRESSION => ' $COMPRESSION ', Bloomfilter => ' $BLOOMFILTER '}


Start the TSD service
./build/tsdb TSD--port=4242--staticroot=build/staticroot--cachedir=/tmp/tsdtmp–zkquorum=localhost

TSD Service operation parameter Description:
USAGE:TSD--port=port--staticroot=path--cachedir=path
Starts the TSD, the time Series Daemon
--async-io=true|false Use async NIO (default true) or traditionalblocking IO
--auto-metric automatically add metrics to tsdb as they are. Warning:this may cause unexpected metrics to be tracked
--cachedir=path Directory Underwhich To cache result of requests.
--flush-interval=msec Maximum time to which a new data point canbe buffered (default:1000).
--port=num TCPPort to listen on.
--staticroot=path Web root from which toserve static files (/s URLs).
--table=table nameof the HBase table where to store the time series (DEFAULT:TSDB).
--uidtable=table Name of Thehbase TABLE to use for Unique IDs (DEFAULT:TSDB-UID).
--worker-threads=num number for async IO workers (DEFAULT:CPU * 2).
--zkbasedir=path PATH Underwhich is the Znode for the-root-region (default:/hbase).
--zkquorum=spec specificationof The Zookeeper quorum to use (Default:localhost).


Here are the commands that TSDB can run
Usage:tsdb <command> [args]
Valid commands:fsck, import, mkmetric, query, TSD, scan, UID


4. Test

Save label

./build/tsdb Mkmetric Proc.loadavg.1mproc.loadavg.5m


Write Scripts and run
Cat >loadavg-collector.sh <<\eof
#!/bin/bash
Set-e
While true; Todo
Awk-v now= ' Date +%s '-v host= ' hostname '
' {print ' Put proc.loadavg.1m ' now ' ' host= ' host;
Print "Put Proc.loadavg.5m" Now "$" host= "host}"/proc/loadavg
Sleep 15
Done | Nc-w 30 192.168.145.1294242
Eof
chmod +x loadavg-collector.sh
Nohup./loadavg-collector.sh &
The red Word part is replaced with the server IP and port that starts the TSD service

Vimnohup.out may display-bash nc:not command found need to install NC

Yuminstall NC


The following information is output every 15 seconds to TSD
Put Proc.loadavg.1m 1288946927 0.36 Host=foo
Put Proc.loadavg.5m 1288946927 0.62 Host=foo
Put Proc.loadavg.1m 1288946942 0.43 Host=foo
Put Proc.loadavg.5m 1288946942 0.62 Host=foo

Using the browser login 192.168.145.129:4242, in from and to in the selection of a good time range, in the metrics input "proc.loadavg.1m", you can see in the chart monitoring information, the following figure

5. Summary of the OPENTSDB table design features can meet the time series of data stored in the HBase and can be second-level corresponding. Suitable for data acquisition at fixed time intervals, such as system software and hardware monitoring. Combined with Logstash, you can monitor the application log log information.

attached 1:centos installation opentsdb

Official website: http://opentsdb.net/getting-started.html (update Autoconf,automake to latest edition)

1. Install gnuplot-4.4.6:http://www.gnuplot.info/

Wgethttp://nchc.dl.sourceforge.net/project/gnuplot/gnuplot/4.6.0/gnuplot-4.6.0.tar.gz

CD gnuplot-4.4.6

./configure

Make

Make install

2. Install git:http://my.oschina.net/lgc/blog/5370

Yum-y Install zlib-devel openssl-devel perlcpio expat-devel

Wgethttp://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz

Tar xzvf git-latest.tar.gz

CD Git-{date}

Autoconf

./configure--with-curl=/usr/local

Make & make Install

3. Install Opentsdb

Git clonegit://github.com/stumbleupon/opentsdb.git

CD Opentsdb

./build.sh

Env compression=nonehbase_home=path/to/hbase-0.92.x./src/create_table.sh

Modify/usr/local/opentsdb/build/tsdb

Vi/usr/local/opentsdb/build/tsdb

Will

Abs_srcdir=

Abs_builddir=

Modified to read as follows

Abs_srcdir= '/usr/local/opentsdb/build/... ' (Opentsdb installation location)

Abs_builddir= '/usr/local/opentsdb/build ' (opentsdb installation location)

tsdtmp=${tmpdir-'/tmp '}/TSD # forbest performance, make sure

Mkdir-p "$tsdtmp" # Your temporary directory uses TMPFS

./build/tsdb TSD--port=4242--staticroot=build/staticroot--cachedir= "$tsdtmp"--zkquorum= 10.96.80.156,10.96.80.152

Zkquorum represents the position of the zookeeper

eclipse configuration with 2:opentsdb

compile-time:
MainClass:com.google.gwt.dev.Compiler
Arguments:-war staticroot  queryui, The staticroot is the storage directory of the compiled static files; The
Queryui is the QueryUi.gwt.xml name and must be placed in the SRC directory. The classpath in the Debug configuration for

Eclipse must include the SRC directory because compiler requires source code. The contents of the


QueryUi.gwt.xml are as follows:
<?xml version= "1.0" encoding= "UTF-8"
<module>
   <inherits name= "Com.google.gwt.user.User"/>
  <inheritsname= " Com.google.gwt.user.theme.standard.Standard "/>
  <inherits name=" Com.google.gwt.http.HTTP "/
  <inherits name= "Com.google.gwt.json.JSON"/>
  <entry-point class= " Tsd.client.QueryUi "/>
  <source path=" TSD "/>
</module>
Where, Tsd.client.QueryUi is the full name of the class. The name of the class must have a client.




Development period Eclipse run:
MainClass:
net.opentsdb.tools.TSDMain
Arguments:
--port=4242
--staticroot=staticroot/queryui
--cachedir=cachedir
--zkquorum=192.168

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.