一、組件介紹
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官網(wǎng)下載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.驗(yàn)證查看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.啟動(dòng)/build/tsdb tsd&
2.telegraf
1.在influxdb官網(wǎng)下載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.啟動(dòng)/telegraf/usr/bin/telegraf --config ~/telegraf/usr/bin/telegraf.conf&
6.驗(yàn)證訪問http://localhost:4399查看采集數(shù)據(jù)或hbase集群新建的tsdb表中是否有數(shù)據(jù)進(jìn)入,如下圖:
3.grafana
1.在grafana官網(wǎng)下載grafana-5.2.2.linux-amd64.tar.gz
2.解壓tar-xzvfgrafana-5.2.2.linux-amd64.tar.gzmv grafana-5.2.2 grafana
3.啟動(dòng)~/grafana/bin/grafana-server&
4.驗(yàn)證訪問http://10.0.192.132:3000?用戶名/密碼:admin/admin