wget https://github.com/prometheus/prometheus/releases/download/v2.1.0/prometheus-2.1.0.linux-amd64.tar.gz
tar -zxvf prometheus-2.1.0.linux-amd64.tar.gz -C /prometheus --strip-components=1
cd /prometheus
# Start Prometheus. # By default, Prometheus stores its database in ./data (flag --storage.tsdb.path). ./prometheus --config.file=prometheus.yml
在瀏覽器輸入localhost:9090node
wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.3-1.x86_64.rpm sudo yum localinstall grafana-4.6.3-1.x86_64.rpm
啓動服務linux
$ sudo service grafana-server start
開機啓動git
$ sudo /sbin/chkconfig --add grafana-server
安裝完成。瀏覽器打開 http://192.168.0.15:3000 ,輸入默認用戶名密碼 (admin/admin) 能夠進入 Grafana 。github
Prometheus: URL: localhost:9090/web
便可完成 Prometheus 和 Grafana 的對接。redis
wget https://github.com/oliver006/redis_exporter/releases/download/v0.15.0/redis_exporter-v0.15.0.linux-amd64.tar.gz
tar -zxvf redis_exporter-v0.15.0.linux-amd64.tar.gz -C /prometheus_exporters --strip-components=1
wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz
tar -zxvf redis_exporter-v0.15.2.linux-amd64.tar.gz -C /prometheus_exporters --strip-components=1
啓動json
cd /prometheus_exporters
./node_exporter &
./redis_exporter redis//localhost:6379 & -web.listenaddress 0.0.0.0:9122
配置prometheus.yml 加入api
- job_name: redis_exporter static_configs: - targets: ['192.168.0.17:9122']
注意prometheus.yml中縮進不能有tab。瀏覽器
下載grafana的redis的prometheus-redis_rev1.json模板服務器
wget https://grafana.com/api/dashboards/763/revisions/1/download
在grafana中導入json模板
啓動redis
在redis安裝路徑執行
src/redis-server