一、组件介绍
1.opentsdb
OpenTSDB is a distributed, scalable Time Series Database (TSDB) written on top of HBase. OpenTSDBwas written to address a common need: store, index and serve metrics collected from computer systems (network gear, operating systems, applications) at a large scale, and make this data easily accessible andgraphable.
2.telegraf
Telegraf is part of the TICK Stack and is a plugin-driven server agent for collecting and reporting metrics. Telegrafhas integrations to source a variety of metrics, events, and logs directly from the containers and systems it’s running on, pull metrics from third-party APIs, or even listen for metrics via a StatsDand Kafka consumer services. It also has output plugins to send metrics to a variety of other datastores,services, and message queues, including InfluxDB,Graphite, OpenTSDB, Datadog, Librato,Kafka, MQTT, NSQ, and many others.
3.grafana
Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB,Prometheus and InfluxDB.
二、安装
1.opentsdb
1.在openTSDB官网下载opentsdb-2.3.1.tar.gz
2.安装openTSDB依赖包gnuplotyum install gnuplot
3.解压tar-xzvfopentsdb-2.3.1.tar.gzmv opentsdb-2.3.1 opentsdb
4.编译cd/opentsdb& cp -Rthird_party./build/ & ./build.sh
5.验证查看build目录下是否生成tsdb-2.3.1.jar文件
6.建HBASE表
envCOMPRESSION=NONE HBASE_HOME=/opt/cloudera/parcels/CDH/lib/hbase./src/create_table.sh
7.配置cp ./src/opentsdb.conf./build/ & vim opentsdb.conf
tsd.network.port =4399
tsd.http.staticroot=./staticroot
tsd.http.cachedir=/opt/software/sloan/opentsdb/build/opentsdbTemp
tsd.core.auto_create_metrics =true
tsd.storage.hbase.data_table = tsdb
tsd.storage.hbase.zk_basedir =/hbase
tsd.storage.hbase.zk_quorum =hadoop1,hadoop2,hadoop3
8.启动/build/tsdb tsd&
2.telegraf
1.在influxdb官网下载telegraf-1.7.3_linux_amd64.tar.gz
2.解压tar-xzvftelegraf-1.7.3_linux_amd64.tar.gz
3.生成配置文件cd /telegraf/usr/bin./telegraf--input-filter cpu:mem:redis--output-filter opentsdb config> telegraf.conf
4.修改配置文件telegraf.conf
outputs.opentsdb
host = "10.0.192.132"
port = 4399inputs.redis
servers = ["tcp://:sloan@10.0.192.132:7004","tcp://:sloan@10.0.192.132:7005","tcp://:sloan@10.0.192.132:7006"]
5.启动/telegraf/usr/bin/telegraf --config ~/telegraf/usr/bin/telegraf.conf&
6.验证访问http://localhost:4399查看采集数据或hbase集群新建的tsdb表中是否有数据进入,如下图:
3.grafana
1.在grafana官网下载grafana-5.2.2.linux-amd64.tar.gz
2.解压tar-xzvfgrafana-5.2.2.linux-amd64.tar.gzmv grafana-5.2.2 grafana
3.启动~/grafana/bin/grafana-server&
4.验证访问http://10.0.192.132:3000 用户名/密码:admin/admin