1.版本
zookeeper: 3.4.10
hbase: 1.2.6单机安装
opentsdb: 2.3.1
2.安装
1.安装zookeeper + hbase单机版地址
https://www.jianshu.com/p/8387d891eb1f
2.安装opentsdb
1.解压编译
进入上传目录cd /usr/local
解压tar -zxvf opentsdb-2.3.1.tar.gz -C /usr/local
进入解压目录cd /usr/local/opentsdb-2.3.1
编译./build.sh
编译报错如下
sd/BadRequestException.java ../src/tsd/ConnectionManager.java ../src/tsd/DropCachesRpc.java ../src/tsd/GnuplotException.java ../src/tsd/GraphHandler.java ../src/tsd/HttpJsonSerializer.java ../src/tsd/HttpSerializer.java ../src/tsd/HttpQuery.java ../src/tsd/HttpRpc.java ../src/tsd/HttpRpcPlugin.java ../src/tsd/HttpRpcPluginQuery.java ../src/tsd/LineBasedFrameDecoder.java ../src/tsd/LogsRpc.java ../src/tsd/PipelineFactory.java ../src/tsd/PutDataPointRpc.java ../src/tsd/QueryExecutor.java ../src/tsd/QueryRpc.java ../src/tsd/RpcHandler.java ../src/tsd/RpcPlugin.java ../src/tsd/RpcManager.java ../src/tsd/RpcUtil.java ../src/tsd/RTPublisher.java ../src/tsd/SearchRpc.java ../src/tsd/StaticFileRpc.java ../src/tsd/StatsRpc.java ../src/tsd/StorageExceptionHandler.java ../src/tsd/SuggestRpc.java ../src/tsd/TelnetRpc.java ../src/tsd/TreeRpc.java ../src/tsd/UniqueIdRpc.java ../src/tsd/WordSplitter.java ../src/uid/FailedToAssignUniqueIdException.java ../src/uid/NoSuchUniqueId.java ../src/uid/NoSuchUniqueName.java ../src/uid/RandomUniqueId.java ../src/uid/UniqueId.java ../src/uid/UniqueIdFilterPlugin.java ../src/uid/UniqueIdInterface.java ../src/utils/ByteArrayPair.java ../src/utils/ByteSet.java ../src/utils/Config.java ../src/utils/DateTime.java ../src/utils/Exceptions.java ../src/utils/FileSystem.java ../src/utils/JSON.java ../src/utils/JSONException.java ../src/utils/Pair.java ../src/utils/PluginLoader.java ../src/utils/Threads.java ../src/tools/BuildData.java ./src/net/opentsdb/query/expression/parser/*.java
javac: file not found: ./src/net/opentsdb/query/expression/parser/*.java
Usage: javac <options> <source files>
use -help for a list of possible options
make[1]: *** [.javac-stamp] Error 2
make[1]: Leaving directory `/usr/local/opentsdb-2.3.0/build'
make: *** [all] Error 2
解决方法,创建build
目录,拷贝third_party
到build
目录,再次执行./build
mkdir build
cp -r third_party ./build
./build.sh
2.创建表
执行脚本,在hbase中创建opentsdb相关表
env COMPRESSION=NONE HBASE_HOME=/usr/local/hbase-1.2.6 ./src/create_table.sh
进入hbase
目录cd /usr/local/hbase-1.2.6/bin
进入hbase
控制台hbase shell
查看是否创建了表list
3.opentsdb配置
进入opentsdb
目录cd /usr/local/opentsdb-2.3.1
移动conf
到build
目录mv opentsdb.conf build/opentsdb.conf
配置conf
,配置含义可以自行百度
# --------- NETWORK ----------
# The TCP port TSD should use for communications
# *** REQUIRED ***
tsd.network.port = 4242
# The IPv4 network address to bind to, defaults to all addresses
#tsd.network.bind = 0.0.0.0
# 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 = ./staticroot
# Where TSD should write it's cache files to
# *** REQUIRED ***
tsd.http.cachedir = /usr/local/opentsdb-2.3.1/cache
# --------- 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
#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 = localhost:2181
# --------- 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
3.启动&测试
预先启动zookeeper和hbase,参考上方安装链接
进入build
目录cd /usr/local/opentsdb-2.3.1/build
启动./tsdb tsd &
ctrl + c
退出控制台jps
查看进程
4.集群
需要预先启动hadoop + hbase集群
每台机器重复上方配置启动即可,连接地址根据集群情况填写
网友评论