OpenTSDB v2.4.0 Intellij IDEA开发环境搭建
发表于:2025-02-01 作者:千家信息网编辑
千家信息网最后更新 2025年02月01日,源码准备1.下载源代码lynn@lynn-ubuntu:/codes/github$ git clone https://github.com/OpenTSDB/opentsdb.gitCloning
千家信息网最后更新 2025年02月01日OpenTSDB v2.4.0 Intellij IDEA开发环境搭建
源码准备
1.下载源代码
lynn@lynn-ubuntu:/codes/github$ git clone https://github.com/OpenTSDB/opentsdb.gitCloning into 'opentsdb'...remote: Enumerating objects: 306, done.remote: Counting objects: 100% (306/306), done.remote: Compressing objects: 100% (122/122), done.remote: Total 33302 (delta 92), reused 273 (delta 86), pack-reused 32996Receiving objects: 100% (33302/33302), 36.25 MiB | 65.00 KiB/s, done.Resolving deltas: 100% (18824/18824), done.
2. 创建分支v2.4.0
查看远程Tags列表:
lynn@lynn-ubuntu:/codes/github/opentsdb$ git tag...v2.3.2v2.4.0v2.4.0RC2
检出分支:
lynn@lynn-ubuntu:/codes/github/opentsdb$ git checkout -b v2.4.0Switched to a new branch 'v2.4.0'lynn@lynn-ubuntu:/codes/github/opentsdb$ git branch master* v2.4.0
编译打包
构建pom.xml配置文件:
lynn@lynn-ubuntu:/codes/github/opentsdb$ sh build.sh pom.xml+ test -f configure+ ./bootstrapautoreconf: Entering directory `.'autoreconf: configure.ac: not using Gettextautoreconf: running: aclocal --force -I build-auxautoreconf: configure.ac: tracingautoreconf: configure.ac: not using Libtoolautoreconf: running: /usr/bin/autoconf --forceautoreconf: configure.ac: not using Autoheaderautoreconf: running: automake --add-missing --copy --force-missingconfigure.ac:19: installing 'build-aux/install-sh'configure.ac:19: installing 'build-aux/missing'Makefile.am:921: warning: whitespace following trailing backslashthird_party/validation-api/include.mk:24: warning: variable 'VALIDATION_API_SOURCES' is defined but no program orthird_party/validation-api/include.mk:24: library has 'VALIDATION_API' as canonical name (possible typo)Makefile.am:983: 'third_party/include.mk' included from herethird_party/include.mk:38: 'third_party/validation-api/include.mk' included from hereautoreconf: Leaving directory `.'+ test -d build+ mkdir build+ cd build+ test -f Makefile+ ../configure pom.xmlconfigure: WARNING: you should use --build, --host, --targetchecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for a thread-safe mkdir -p... /bin/mkdir -pchecking for gawk... nochecking for mawk... mawkchecking whether make sets $(MAKE)... yeschecking whether make supports nested variables... yeschecking for md5sum... /usr/bin/md5sumchecking for java... /usr/lib/jdk1.8.0_172/bin/javachecking for javac... /usr/lib/jdk1.8.0_172/bin/javacchecking for jar... /usr/lib/jdk1.8.0_172/bin/jarchecking for true... /bin/truechecking for javadoc... /usr/lib/jdk1.8.0_172/bin/javadocchecking for wget... /usr/bin/wgetchecking for curl... /opt/anaconda2/bin/curlchecking that generated files are newer than configure... doneconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating opentsdb.specconfig.status: creating build-aux/fetchdep.sh+ MAKE=make+ uname -s+ [ Linux = FreeBSD ]+ exec make pom.xml(cd .. ; ./build-aux/create-src-dir-overlay.sh){ \ echo ''; \ sed <../pom.xml.in \ -e 's/@ASYNCHBASE_VERSION@/1.8.2/' \ -e 's/@ASYNCBIGTABLE_VERSION@/0.0/' \ -e 's/@ASYNCCASSANDRA_VERSION@/0.0/' \ -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/@POWERMOCK_MOCKITO_VERSION@/1.5.4/' \ -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-tmv pom.xml-t ../pom.xml
编译打包:
mvn clean package -Phbase
导入Intellij IDEA
1. 由于本地只有jdk1.8, 因此修改pom.xml文件jdk版本
pom.xml
org.apache.maven.plugins maven-compiler-plugin 2.5.1 1.8 -Xlint **/client/*.java **/TestGraphHandler.java
- 代码冗余报错:
Error:(36, 10) java: duplicate class: tsd.client.EventsHandler
因此将src-main/tsd目录置为Excluded状态。
3. 运行主程序:src-main/net/opentsdb/tools/OpenTSDBMain
或
src-main/net/opentsdb/tools/TSDMain
- 将fat-jar目录置为ResourcesRoot加入Classpath下
- 在HBase中创建相关表格
lynn:lynnlynn:lynn-metalynn:lynn-treelynn:lynn-uid
- 增加如下运行参数:
OpenTSDBMaintsd --zkquorum manager.bigdata.com:2181 --zkbasedir /hbase-unsecure --uidtable lynn:lynn-uid --table lynn:lynn --metatable lynn:lynn-meta --treetable lynn:lynn-tree
TSDMain
--config=/opt/opentsdb-2.4.0/etc/opentsdb/opentsdb.conf
opentsdb.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 = /opt/opentsdb-2.4.0/static/# Where TSD should write it's cache files to# *** REQUIRED ***tsd.http.cachedir = /tmp/opentsdb# --------- CORE ----------# Whether or not to automatically create UIDs for new metric types, default# is Falsetsd.core.auto_create_metrics = true# --------- STORAGE ----------# Whether or not to enable data compaction in HBase, default is True#tsd.storage.enable_compaction = true#Whether or not to append data to columns when writing data points instead of creating new columns for each value. Avoids the need for compactions after each hour but can use more resources on HBase.#tsd.storage.enable_appends = false# How often, in milliseconds, to flush the data point queue to storage,# default is 1,000# tsd.storage.flush_interval = 1000# Name of the HBase table where data points are stored, default is "tsdb"tsd.storage.hbase.data_table = lynn:lynn# Name of the HBase table where UID information is stored, default is "tsdb-uid"tsd.storage.hbase.uid_table = lynn:lynn-uidtsd.storage.hbase.meta_table = lynn:lynn-metatsd.storage.hbase.tree_table = lynn:lynn-tree# Path under which the znode for the -ROOT- region is located, default is "/hbase"tsd.storage.hbase.zk_basedir = /hbase-unsecure# A comma separated list of Zookeeper hosts to connect to, with or without# port specifiers, default is "localhost"tsd.storage.hbase.zk_quorum = manager.bigdata.com:2181
分支
文件
目录
编译
运行
主程序
代码
冗余
参数
只有
源代码
源码
版本
状态
表格
中创
准备
配置
环境
开发
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
认证后端请求电信认证服务器超时
软件开发助理可以做什么
长沙软件开发
邯郸app软件开发哪家好
外码 数据库
互联网科技创新排名
淄川软件开发
两会期间 网络安全
广西网络安全工程包括什么
计算机网络安全方面的知识
台州做软件开发哪里好
宝坻区地铁共享广告软件开发
点餐系统 数据库
昆明服务器总代理
幻塔更新服务器
大数据服务器代理
桂林租房软件开发
全方位网络安全防线构设
数据库round函数怎么用
web网络安全日志分析
三门峡聚源网络技术有限公司
云流量服务器搭建
13000元组装服务器电脑
数据库设计中的逻辑模型
网络技术威胁安全
数据库文件考试
欧卡2服务器管理
重庆渝中区安卓软件开发机构
评价软件开发总结
软件开发公司技术服务费收税