安装opentsdb

一、安装hbase

1下载安装包

官方下载地址:http://hbase.apache.org/downloads.html

也可以去镜像下载

wget https://mirrors.ustc.edu.cn/apache/hbase/2.2.2/hbase-2.2.2-bin.tar.gz

解压安装包

tar -xvf hbase-2.2.2-bin.tar.gz

修改配置文件

vim conf/hbase-env.sh

export JAVA_HOME=/opt/java/jdk1.8.0_131 ##指定Java环境

export HBASE_MANAGES_ZK=true  ##使用hbase自带的zookeeper

扫描二维码关注公众号,回复: 7776313 查看本文章

vim conf/hbase-site.xml 将文件中<configuration>按照下面配置即可

<configuration>

  <property>

    <name>hbase.rootdir</name>

    <value>file:///home/testuser/hbase</value>  ##指定hbase的根目录

  </property>

  <property>

    <name>hbase.zookeeper.property.dataDir</name>

    <value>/home/testuser/zookeeper</value>  ##指定zookeeper的目录

  </property>

  <property>

    <name>hbase.unsafe.stream.capability.enforce</name>

    <value>false</value>

  </property>

</configuration>

vim /etc/profile ##添加环境变量,完成之后,source /etc/profile生效

export HBASE_HOME=/data/hbase-2.2.2    ##hbase安装路径

export PATH=$HBASE_HOME/bin:$PATH

启动

./bin/start-hbase.sh ##正常启动之后可以访问http://ip:16010端口

安装opentsdb

下载安装包

下载地址:https://github.com/OpenTSDB/opentsdb/releases

下载自己需要的版本

安装

我这里直接使用rpm安装

yum install https://github.com/OpenTSDB/opentsdb/releases/download/v2.4.0/opentsdb-2.4.0.noarch.rpm -y

之后会帮助安装依赖包,完成后,会安装到/usr/share/opentsdb

安装好之后做几个软连接方便管理

ln -s /usr/local/share/opentsdb/etc/init.d/opentsdb /etc/init.d/

ln -s /usr/local/share/opentsdb/etc/systemd/system/[email protected] /etc/systemd/system/

ln -s /usr/local/share/opentsdb/etc/opentsdb/* /etc/opentsdb/

ln -s /usr/local/share/opentsdb/bin/tsdb /usr/bin/

1、修改配置文件

vim /etc/opentsdb/opentsdb.conf

tsd.network.port = 4242    ##opentsdb监听端口

tsd.http.staticroot = /usr/share/opentsdb/static/  ##tsdb页面资源路径

tsd.http.cachedir = /tmp/opentsdb   ##缓存文件路径

tsd.core.auto_create_metrics = true

tsd.core.plugin_path = /usr/share/opentsdb/plugins

tsd.storage.hbase.zk_quorum = 127.0.0.1:2181    ##安装hbase的监听端口

2、建表

cd /usr/share/opentsdb/tools/

env COMPRESSION=NONE ./create_table.sh

3、启动

service opentsdb start

##正常启动之后可以访问http://ip:4242端口

猜你喜欢

转载自www.cnblogs.com/Christine-ting/p/11812350.html