Install OpenTSDB from Source Files

The following steps describe how to install OpenTSDB from source files.

Be sure to install the OpenTSDB version that is required for your AsyncHBase version. AsyncHBase 1.6 requires OpenTSDB 2.0. AsyncHBase 1.7 requires OpenTSDB 2.2.
  1. Clone the opentsdb.git project and check out the OpenTSDB branch that you require.
    For example:
    $ git clone
    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
    $ git checkout v2.0.0
    Switched to a new branch 'v2.0.0'
  2. Open the opentsdb/ file and add the following MapR dependencies:
    1. BASEMAPRDIR: the root directory of the MapR installation
    2. Hadoop core-site.xml in the classpath for Hadoop-0.2x/Hadoop-2.x: BASEMAPRDIR/hadoop/hadoop-0.20.2/conf or BASEMAPRDIR/hadoop/hadoop-2.x/conf
    3. MapR-specific jars in the classpath: BASEMAPRDIR/hadoop/hadoop-0.20.2/lib/*
  3. Install dependencies for graph generation:
    $ yum install autoconf automake gnuplot
  4. Replace the asynchbase.jar file with the MapR version of that file:
    $ yum install mapr-asynchbase
  5. Run the build script:
  6. If you want to use OpenTSDB with MapR-DB tables, open the file (<OPENTSDB_ROOT_INSTALL_DIR>/src/ and add "/" before the table names so that MapR recognizes them as MapR-DB tables: See Example:
  7. Create tables:
    env COMPRESSION=NONE;HBASE_HOME=/opt/mapr/hbase/hbase-<version>
  8. Run the following command to verify that the tables are created successfully:
    hadoop fs -ls /
  9. Create a simple metric to store, such as “sys.cpu.user”:
    ./build/tsdb mkmetric sys.cpu.user --table=/tsdb --uidtable=/tsdb-uid
  10. Run the OpenTSDB daemon (tsd).
    ./build/tsdb tsd --port=4242 --staticroot=build/staticroot 
    --cachedir=/tmp/opentsdb_tmp --zkquorum= --table=/tsdb 
    Note: Instead 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.
  11. Log into the web UI: http://<TSD_Installed_Node_IP>:<Port>
    For example:
  12. 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.
  13. Check the plot in the UI.
    1. Select From date and check autoreload.
    2. 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.