Installing OpenTSDB from Source Files
The following steps describe how to install OpenTSDB from source files.
Prerequisites
Procedure
-
Clone the opentsdb.git project and check out the OpenTSDB branch that you require.
For example:NOTE
$ git clone https://github.com/OpenTSDB/opentsdb.git Cloning into 'opentsdb'... remote: Counting objects: 5625, done. remote: Compressing objects: 100% (76/76), done. remote: Total 5625 (delta 51), reused 64 (delta 30) Receiving objects: 100% (5625/5625), 27.15 MiB | 2.67 MiB/s, done. Resolving deltas: 100% (3755/3755), done. Checking connectivity... done. $ cd opentsdb $ git tag -l mapr-1.1.0-release+5 v1.0.0 v2.0.0 ... $ git checkout v2.0.0 Switched to a new branch 'v2.0.0'
-
Install dependencies for graph generation:
$ yum install autoconf automake gnuplot
-
Replace the
asynchbase.jar
file with the Data Fabric version of that file:$ yum install mapr-asynchbase
-
Run the build script:
./build.sh
- If you want to use OpenTSDB with HPE Ezmeral Data Fabric Database tables, open the create_table.sh file (<OPENTSDB_ROOT_INSTALL_DIR>/src/create_table.sh) and add "/" before the table names so that Data Fabric recognizes them as HPE Ezmeral Data Fabric Database tables: See Example: create_table.sh.
-
Create tables:
env COMPRESSION=NONE;HBASE_HOME=/opt/mapr/hbase/hbase-<version> <OPENTSDB_ROOT_INSTALL_DIR>/src/create_table.sh
-
Run the following command to verify that the tables are created successfully:
hadoop fs -ls /
-
Create a simple metric to store, such as “sys.cpu.user”:
./build/tsdb mkmetric sys.cpu.user --table=/tsdb --uidtable=/tsdb-uid
-
Run the OpenTSDB daemon (tsd).
./build/tsdb tsd --port=4242 --staticroot=build/staticroot --cachedir=/tmp/opentsdb_tmp --zkquorum=10.10.101.50:5181 --table=/tsdb --uidtable=/tsdb-uid
NOTEInstead of providing these options on command line, you can configure the values in the opentsdb.conf file. This file must be in the root folder so the option settings are read when tsd is run. Also note that the staticroot argument points to the static UI files. You do not need to create cachedir because openstdb creates it automatically. Specifying the destination cachedir argument is enough. You do need to explicitly specify tsdb tables (tsdb, tsdb-uid) and Zookeeper quorum nodes. -
Log into the web UI:
http://<TSD_Installed_Node_IP>:<Port>
For example:http://10.10.10.230:4242/
- Run a simple test program that generates data and sends repeated puts for the metric over a socket connection: <UI-IP>:<UI-Port> . See Data Generator Program.
-
Check the plot in the UI.
- Select From date and check autoreload.
-
Fill in the metric (in this case,
sys.cpu.user
) and the Tag keys (cpu, host
) values (webserver 0, webserver 1
). You should see a graph with a random plot.