我对OpenTSDB的一些理解——源码编译

2022-02-10 00:00:00 索引 数据 专区 源码 找不到

OpenTSDB是可伸缩的时间序列数据库,可用于对设备不同时间段状态指标数据的存储、检索和分析。OpenTSDB本身并不存储数据,实际数据是存储于Hbase,自身提供对Hbase做二级索引的服务。目前有流行的对Hbase做二级索引的框架有Elasticsearch和Slor,这两种是对Lucene api的封装并提供一中分布式索引的服务。但OpenTSDB的不同于以上两种,自身的索引是存储于Hbase中,也就是设计Hbase的rowkey,使其达到二级索引的目的。

源码编译的过称如下(linux环境下):

1、通过git克隆源码,git clone github.com/OpenTSDB/ope

2、通过git checkout v2.4.0 和git checkout -b 2.4.0 v2.4.0 建立了2.4.0版本分支

3、通过sh build.sh pom.xml 生成 maven 的pom 文件

4、通过mvn命令编译源码mvn clean package -Phbase -Dmaven.test.skip=true,生成了src-main包。

5、如果是windows开发环境,则将真个目录打包的windows机器上面。

6、导入IDEA。

7、配置opentsdb.conf后,运行net.opentsdb.tools.TSDMain的main文件,启动服务。以下是我的配置

# --------- NETWORK ----------
# The TCP port TSD should use for communications
# *** REQUIRED ***
tsd.network.port = 4399

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

# Disable Nagel's algorithm, default is True
#tsd.network.tcp_no_delay = true

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

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

# Number of worker threads dedicated to Netty, defaults to # of CPUs * 2
#tsd.network.worker_threads = 8

# Whether or not to use NIO or tradditional blocking IO, defaults to True
#tsd.network.async_io = true

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

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

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

# 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
#tsd.storage.enable_compaction = true

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

# Max number of rows to be returned per Scanner round trip
# tsd.storage.hbase.scanner.maxNumRows = 128

# Name of the HBase table where data points are stored, default is "tsdb"
#tsd.storage.hbase.data_table = tsdb

# Name of the HBase table where UID information is stored, default is "tsdb-uid"
#tsd.storage.hbase.uid_table = tsdb-uid

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

# A comma separated list of Zookeeper hosts to connect to, with or without
# port specifiers, default is "localhost"
tsd.storage.hbase.zk_quorum = 192.168.56.102
tsd.storage.compaction.flush_interval = 1000

tsd.core.auto_create_metrics = true
tsd.storage.hbase.data_table = tsdb
tsd.storage.hbase.zk_basedir = /hbase


tsd.http.request.enable_chunked = true
tsd.http.request.max_chunk = 163840
tsd.storage.fix_duplicates=true
# --------- COMPACTIONS ---------------------------------
# Frequency at which compaction thread wakes up to flush stuff in seconds, default 10
# tsd.storage.compaction.flush_interval = 10

# Minimum rows attempted to compact at once, default 100
# tsd.storage.compaction.min_flush_threshold = 100

# Maximum number of rows, compacted concirrently, default 10000
# tsd.storage.compaction.max_concurrent_flushes = 10000

# Compaction flush speed multiplier, default 2
# tsd.storage.compaction.flush_speed = 2

相关文章