容器化定制opentsdb
dockerfile
FROM armdocker.rnd.ericsson.se/dockerhub-ericsson-remote/centos:7.5.1804
#更新环境
RUN yum install -y autoconf make java java-devel \
&& mkdir -p /data/opentsdb \
&& mkdir -p /home/hbase/data/
ENV COMPRESSION=NONE HBASE_HOME=/home/hbase
WORKDIR /home/
COPY tar .
RUN rm -rf /etc/profile \
&& mv /home/profile /etc/ \
&& source /etc/profile \
&& sh /home/hbase/bin/start-hbase.sh \
&& cd /home/opentsdb/ \
&& ./build.sh \
&& chmod +x /home/run.sh
ENTRYPOINT sh /home/run.sh
修改
vim /hbase/confhbase-site.xml
添加需要换成自己的路径
<configuration>
<property>
<name>hbase.rootdir</name>
<value>file:///home/hbase/data</value>
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>/home/test/zookeeper</value>
</property>
</configuration>
修改
vim opentsdb/build/opentsdb.conf
添加参数
tsd.network.keep_alive = true
tsd.core.auto_create_metrics = true
tsd.storage.hbase.data_table = tsdb
tsd.storage.hbase.zk_basedir = /hbase
tsd.storage.hbase.zk_quorum = xxx.xxx.xx.x:2181 需要换成zp的Ip地址,可以自己搭建zookep。或者hbase自带的
run.sh
#!/bin/bash
cd /home/hbase/bin/
sh start-hbase.sh
cd /home/opentsdb/
env COMPRESSION=NONE HBASE_HOME=/home/hbase ./src/create_table.sh
cd /home/opentsdb/build
sh /home/opentsdb/build/tsdb tsd --config=./opentsdb.conf