idea debugging opentsdb source code

Keywords: HBase network xml Makefile

Reference resources:


Download source code:

Compile and pack

Modify file directory

Modify opnetsdb.conf

Running TSDMain

Download source code:

    git clone

Compile and pack

To build the pom.xml configuration file:

[root@Machine1 opentsdb]#cd opentsdb

[root@Machine1 opentsdb]# sh  pom.xml

+ test -f configure

+ ./bootstrap
autoreconf: Entering directory `.'
autoreconf: not using Gettext
autoreconf: running: aclocal --force -I build-aux
autoreconf: tracing
autoreconf: not using Libtool
autoreconf: running: /usr/bin/autoconf --force
autoreconf: not using Autoheader
autoreconf: running: automake --add-missing --copy --force-missing installing 'build-aux/install-sh' installing 'build-aux/missing' warning: whitespace following trailing backslash
third_party/validation-api/ warning: variable 'VALIDATION_API_SOURCES' is defined but no program or
third_party/validation-api/ library has 'VALIDATION_API' as canonical name (possible typo) 'third_party/' included from here
third_party/ 'third_party/validation-api/' included from here
auoreconf: Leaving directory `.'
+ test -d build
+ mkdir build
+ cd build
+ test -f Makefile
+ ../configure pom.xml
configure: WARNING: you should use --build, --host, --target
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for md5sum... /usr/bin/md5sum
checking for java... /usr/lib/jdk1.8.0_172/bin/java
checking for javac... /usr/lib/jdk1.8.0_172/bin/javac
checking for jar... /usr/lib/jdk1.8.0_172/bin/jar
checking for true... /bin/true
checking for javadoc... /usr/lib/jdk1.8.0_172/bin/javadoc
checking for wget... /usr/bin/wget
checking for curl... /opt/anaconda2/bin/curl
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
conig.status: creating opentsdb.spec
config.status: creating build-aux/
+ MAKE=make
+ uname -s
+ [ Linux = FreeBSD ]
+ exec make pom.xml
(cd .. ; ./build-aux/
{ \
echo '<!-- Generated by Makefile on '`date`' -->'; \
sed <../ \
-e 's/@ASYNCHBASE_VERSION@/1.8.2/' \
-e 's/@GUAVA_VERSION@/18.0/' \
-e 's/@GWT_VERSION@/2.6.0/' \
-e 's/@GWT_THEME_VERSION@/1.0.0/' \
-e 's/@HAMCREST_VERSION@/1.3/' \
-e 's/@JACKSON_VERSION@/2.9.5/' \
-e 's/@JAVASSIST_VERSION@/3.21.0-GA/' \
-e 's/@JUNIT_VERSION@/4.11/' \
-e 's/@LOG4J_OVER_SLF4J_VERSION@/1.7.7/' \
-e 's/@LOGBACK_CLASSIC_VERSION@/1.0.13/' \
-e 's/@LOGBACK_CORE_VERSION@/1.0.13/' \
-e 's/@MOCKITO_VERSION@/1.9.5/' \
-e 's/@NETTY_VERSION@/3.10.6.Final/' \
-e 's/@OBJENESIS_VERSION@/1.3/' \
-e 's/@SLF4J_API_VERSION@/1.7.7/' \
-e 's/@SUASYNC_VERSION@/1.4.0/' \
-e 's/@ZOOKEEPER_VERSION@/3.4.6/' \
-e 's/@APACHE_MATH_VERSION@/3.4.1/' \
-e 's/@JEXL_VERSION@/2.1.1/' \
-e 's/@JGRAPHT_VERSION@/0.9.1/' \
-e 's/@spec_title@/OpenTSDB/' \
-e 's/@spec_vendor@/The OpenTSDB Authors/' \
-e 's/@spec_version@/2.4.0/' \
-e 's/@maven_profile_hbase@/true/' \
-e 's/@maven_profile_bigtable@/false/' \
-e 's/@maven_profile_cassandrae@/false/' \
; \
} >pom.xml-t
mv pom.xml-t ../pom.xml


mvn clean package -P hbase

Executing mvn clean package -P hbase during packaging will trigger profile configuration of hbase environment

      <!-- Build for Apache HBase backend -->




Modify file directory

After compiling successfully

Cut some files under the src directory to src main / net / opentsdb, and some to src main / TSD

The success was as follows:


net/opnetsdb is a soft connection of.. / src

Client - >

Copy project to window

Modify opnetsdb.conf

# --------- NETWORK ----------
# The TCP port TSD should use for communications
# *** REQUIRED *** = 4242

# The IPv4 network address to bind to, defaults to all addresses
# =

# Disable Nagel's algorithm, default is True = true

# Determines whether or not to send keepalive packets to peers, default
# is True = true

# Determines if the same socket should be used for new connections, default
# is True = true

# Number of worker threads dedicated to Netty, defaults to # of CPUs * 2 = 8

# Whether or not to use NIO or tradditional blocking IO, defaults to True = true

# ----------- HTTP -----------
# The location of static files for the HTTP GUI interface.
# *** REQUIRED ***
tsd.http.staticroot = /opentsdb/build/staticroot

# Where TSD should write it's cache files to
# *** REQUIRED ***
tsd.http.cachedir = /opentsdb/build/cachedir

# --------- CORE ----------
# Whether or not to automatically create UIDs for new metric types, default
# is False
tsd.core.auto_create_metrics = true

# Whether or not to enable the built-in UI Rpc Plugins, default
# is True
#tsd.core.enable_ui = true

# Whether or not to enable the built-in API Rpc Plugins, default
# is True
#tsd.core.enable_api = true

# --------- STORAGE ----------
# Whether or not to enable data compaction in HBase, default is True = true

# How often, in milliseconds, to flush the data point queue to storage,
# default is 1,000 = 1000

# Max number of rows to be returned per Scanner round trip
# = 128

# Name of the HBase table where data points are stored, default is "tsdb" = tsdb

# Name of the HBase table where UID information is stored, default is "tsdb-uid" = tsdb-uid

# Path under which the znode for the -ROOT- region is located, default is "/hbase" = /hbase

# A comma separated list of Zookeeper hosts to connect to, with or without
# port specifiers, default is "localhost" = localhost = Machine1

# --------- COMPACTIONS ---------------------------------
# Frequency at which compaction thread wakes up to flush stuff in seconds, default 10
# = 10 = 1000

# Minimum rows attempted to compact at once, default 100
# = 100

# Maximum number of rows, compacted concirrently, default 10000
# = 10000

# Compaction flush speed multiplier, default 2
# = 2
tsd.http.request.enable_chunked = true
tsd.http.request.max_chunk = 163840

Directory location:


Running TSDMain

Run the SRC main / net / opentsdb / tools / tsdmain program without adding any running parameters.

The successful operation is as follows:



Posted by makoy on Sat, 09 Nov 2019 07:11:06 -0800