美文网首页
OpenTSDB单机部署

OpenTSDB单机部署

作者: Minority | 来源:发表于2021-01-19 14:59 被阅读0次

OpenTSDB单机部署

环境 版本
java OracleJDK (jdk1.8.0_271)
ZooKeeper zookeeper-3.4.11
hbase hbase-2.3.3
opentsdb opentsdb-2.4.0

Java环境部署

Oracle与OpenJDK之间的区别,本次安装Oracle JDK。

登录Oracle官网,手动下载jdk-8u271-linux-x64.tar.gz(不登录无法下载)
mkdir -p /usr/java
tar zvxf jdk-8u271-linux-x64.tar.gz -C /usr/java

# 设置JAVA_HOME
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_271
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

#使环境变量生效
source /etc/profile
#查看配置结果
echo $JAVA_HOME

Zookeeper环境部署

wget http://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
tar -zvxf zookeeper-3.4.11.tar.gz
cd zookeeper-3.4.11/
#创建数据目录
mkdir data
mkdir logs
cd conf/
#新建配置文件
vi zoo.cfg

zoo.cfg的内容如下:

tickTime=2000
dataDir=/usr/single_hbase/zookeeper-3.4.11/data
dataLogDir=/usr/single_hbase/zookeeper-3.4.11/logs
clientPort=3181
cd ../bin/
#启动
./zkServer.sh start

Hbase环境部署

wget https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/stable/hbase-2.3.3-bin.tar.gz
tar -zxf hbase-2.3.3-bin.tar.gz
cd hbase-2.3.3/
#创建数据目录
mkdir data

查看设置的JAVA_HOME

echo $JAVA_HOME
# ====== output info ======
/usr/java/jdk1.8.0_271

修改hbase-env.sh

vi conf/hbase-env.sh
# 修改JAVA_HOME选项为输入路径
export JAVA_HOME=/usr/java/jdk1.8.0_271

注意:如果使用自己安装的zookeeper,再修改hbase-env.sh的以下选项,如果不是直接略过

export HBASE_MANAGES_ZK=false

修改hbase-env.cmd最后一行

vi  hbase-env.cmd
@rem set HBASE_MANAGES_ZK=false

修改hbase-site.xml

vi conf/hbase-site.xml
# 参考内容如下
<configuration>
    <property>  
        <name>hbase.rootdir</name>  
        <value>file:///usr/single_hbase/hbase-2.3.3/data</value>  
    </property>  
    <property> 
        <name>hbase.cluster.distributed</name>  
        <value>true</value>  
    </property>  
    <property>  
        <name>hbase.unsafe.stream.capability.enforce</name>  
        <value>false</value>  
    </property>  
    <property>
        <name>hbase.tmp.dir</name>
        <value>usr/single_hbase/hbase-2.3.3/tmp</value>
    </property>
    <property>  
        <name>hbase.zookeeper.property.clientPort</name>  
        <value>3181</value>  
    </property>  
    <property>  
        <name>hbase.zookeeper.quorum</name>  
        <value>localhost</value>  
    </property> 
    <property>  
        <name>hbase.zookeeper.property.dataDir</name>  
        <value>/usr/single_hbase/zookeeper-3.4.11/data</value>  
    </property>  
    <property>
        <name>hbase.procedure.store.wal.use.hsync</name>
        <value>true</value>
    </property>
</configuration>

解决ERROR [main] master.HMasterCommandLine: Master exiting错误:

配置文件要有,其实刚下载完hbase是有这个选项的,后来我根据网上的教程把这个选项删除了,所以最好不要动原始配置,需要什么就直接添加

<property>  
   <name>hbase.unsafe.stream.capability.enforce</name>  
   <value>false</value>  
</property>  
# 启动hbase
./bin/start-hbase.sh

输入jps,可以看到HMaster,HRegionServer等信息。QuorumPeerMain是zookeeper的集群启动的入口类,我有两个zookeeper集群,所以会显示两个

1140 QuorumPeerMain
9157 QuorumPeerMain
7286 HMaster
10057 Jps
13294 Kafka
7519 HRegionServer

OpenTSDB环境部署

# 安装Gnuplot
apt install gnuplot
wget https://github.com/OpenTSDB/opentsdb/releases/download/v2.4.0/opentsdb-2.4.0.tar.gz
tar -xvzf opentsdb-2.4.0.tar.gz
# 此步随意
mv opentsdb-2.4.0/ ./hbase-2.3.3/
# 此步必须
cp -r third_party ./build
./build.sh
# 编辑配置文件
vi src/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 = /usr/single_hbase/hbase-2.3.3/opentsdb-2.4.0/build/staticroot
#
tsd.http.request.enable_chunked = true
tsd.http.request.max_chunk = 102400000
# # Where TSD should write it's cache files to
# # *** REQUIRED ***
tsd.http.cachedir = /tmp/opentsdb
# #sd.core.plugin_path = /usr/share/opentsdb/plugins
# #tsd.storage.hbase.data_table = tsdb
# # --------- CORE ----------
# # Whether or not to automatically create UIDs for new metric types, default
# # is False
tsd.core.auto_create_metrics = true
tsd.storage.fix_duplicates = true
#
# # Whether or not to enable the built-in UI Rpc Plugins, default
# # is True
# #tsd.core.enable_ui = true
tsd.query.filter.expansion_limit = 65535
# # 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 = false
#
# # 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 = 127.0.0.1:3181    
#
# # --------- 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
#

解决opentsdb执行./build.sh报错:

cp -r third_party ./build
# 执行脚本,在hbase中创建opentsdb相关表,根目录下执行
 env COMPRESSION=NONE HBASE_HOME=/usr/single_hbase/hbase-2.3.3/ ./src/create_table.sh

进入hbase根目录,执行bin/hbase shell ,再执行list,可以看到有四张表

hbase(main):001:0> list
TABLE
tsdb
tsdb-meta
tsdb-tree
tsdb-uid
4 row(s)
Took 0.4887 seconds
=> ["tsdb", "tsdb-meta", "tsdb-tree", "tsdb-uid"]
hbase(main):002:0>

进入opentsdb根目录,运行以下命令启动TSD

./build/tsdb tsd   --config=./src/opentsdb.conf   

相关文章

  • OpenTSDB单机部署

    OpenTSDB单机部署 环境版本javaOracleJDK (jdk1.8.0_271)ZooKeeperzo...

  • OpenTSDB部署

    1 安装 本次安装是从 Github下载源码进行编译安装 2 运行环境 Linux 系统(本次使用CentOS6....

  • OpenTsDb安装

    1.版本 zookeeper: 3.4.10hbase: 1.2.6单机安装opentsdb: 2.3.1 2.安...

  • opentsdb+hbase的安装部署

    以下安装部署都是在centos 7系统下安装部署的。 OpenTSDB是基于HBase存储时间序列数据的一...

  • Hbase+opentsdb 单机版搭建

    hbase+opentsdb 单机版搭建 安装环境: 这里没有用HDFS,生产环境的话,hbase还是要把数据存到...

  • Centos7搭建SkyWalking监控单机及集群服务器

    Skywalking最新发布版5.0.0 beta2的单机及集群安装说明 1. 单机部署 单机部署组件需求:H2或...

  • ActiveMQ(二)ActiveMQ集群部署与应用

    本文主要讲解ActiveMQ的集群部署及主从切换演示,单机版部署及入门请移步ActiveMQ(一)单机部署与应用,...

  • 2.Tomcat集群、Nginx负载均衡

    Tomcat集群包括单机多部署应用和多机单部署应用两种,在本文当中使用的是单机多部署的方式。多机部署正常部署即可,...

  • 部署步骤

    部署 Collector 单机模式 集群模式 部署 webui server,doc 部署 Java Agent,...

  • Nacos系列:Nacos的三种部署模式

    三种部署模式 Nacos支持三种部署模式 1、单机模式:可用于测试和单机使用,生产环境切忌使用单机模式(满足不了高...

网友评论

      本文标题:OpenTSDB单机部署

      本文链接:https://www.haomeiwen.com/subject/lloqzktx.html