how-to-install-grafana-on-centos6.6-x86_64
2015-03-13 13:42
549 查看
how-to-install-grafana-on-centos6.6-x86_64
写作缘由:最近看到spark社区有人使用 graphite-grafana监控spark,spark-developers-list Monitoring Spark with Graphite and Grafana
hammerlab Monitoring Spark with Graphite and Grafana
github grafana-spark-dashboards
因为工作中涉及spark监控,故测试一下,记录如下:(本文主要记录部署测试grafana的过程)
首先,看看grafana-web的展示效果:感觉比 ganglia 好一些
自己测试的web展示,对metric的graph 定制操作还不太熟悉,比较原始不美观,先看看grafana website上展示的几张图片。
Rich Graphing Options/丰富的图形选项
Dashboards
Light themes
测试准备-install graphite
具体安装 graphite 请参考:how-to-install-graphite-on-centos6.6-x86_64
service httpd start service httpd status /opt/graphite/bin/carbon-cache.py start /opt/graphite/bin/carbon-cache.py status
1 install grafana
grafana installationhttp://grafana.org/download/
mkdir ~/app cd ~/app #yum install -y zip.x86_64 unzip.x86_64 unzip /docker_vol01/soft/grafana/grafana-1.9.1.zip ln -s ./grafana-1.9.1/ grafana mv grafana-1.9.1 grafana /var/www/html/ //如果放在自定义目录(需要特别配置?),可能存在跨域无权访问问题,Permission denied: access to / denied
更新20153020
如何 自定义 grafana 的目录
示例:移动grafana安装目录到自己规划的目录,如:/var/www/html/grafana->/data/grafana
mv /var/www/html/grafana* /data/
vi /etc/httpd/conf.d/grafana-vhost.conf
<VirtualHost *:61081> #ServerAdmin admin@localhost.com DocumentRoot /data/grafana #ServerName my.grafana.com ErrorLog /var/log/httpd/grafana/error.log CustomLog /var/log/httpd/grafana/access.log common <Directory /data/grafana/> Order deny,allow Allow from all </Directory> </VirtualHost>
2 configure grafana
1)cd grafana
cp config.sample.js config.js
2) configure datasource
Graphite & Elasticsearch setup example
datasources: {
graphite: {
type: ‘graphite’,
url: “http://my.graphite.server.com:8080“,
},
elasticsearch: {
type: ‘elasticsearch’,
url: “http://my.elastic.server.com:9200“,
index: ‘grafana-dash’,
grafanaDB: true,
}
},
If you use Graphite you need Elasticsearch if you want to store & search dashboards. You can also use json and scripted dashboards if you really do not want to setup Elasticsearch.
测试环境使用 graphite ,不使用 elasticsearch
示例:
datasources: {
graphite: {
type: ‘graphite’,
url: “http://monitor1:61080“,
},
elasticsearch: {
type: ‘elasticsearch’,
url: “http://my.elastic.server.com:9200“,
index: ‘grafana-dash’,
grafanaDB: true,
}
},
更新20150320
问题1:测试过程发现,不使用 elasticsearch, grafana 保存自定义的 dashboard 会报错,提示
Save failed
Failed to save to elasticsearch
处理方法1:
安装 elasticsearch, 参考 how-to-install-elasticsearch-on-centos6.6-x86_64,并更新配置
datasources: { graphite: { type: 'graphite', url: "http://monitor1:61080", }, elasticsearch: { type: 'elasticsearch', url: "http://monitor1:9200", index: 'grafana-dash', grafanaDB: true, } },
3) configure apache to provide grafana-web service
cd /etc/httpd
vi conf/httpd.conf
Listen 61081
vi conf.d/grafana-vhost.conf
<VirtualHost *:61081> #ServerAdmin admin@localhost.com DocumentRoot /var/www/html/grafana #ServerName my.grafana.com </VirtualHost>
chown -R apache /var/www/htmlvar/www/html/grafana
3 测试web访问
grafana 官方在线 demo:http://play.grafana.org/#/dashboard/db/grafana-play-home
http://monitor1:61081/
更新:20150320
首页显示如下:
grafana-web首页
在自定义的dashboard上创建自定义graph,可以选择任意想要展示的metrics
自己创建的dashboard,展示了 load, mem, jvm_heap相关的指标
相关文章推荐
- how-to-install-elasticsearch-on-centos6.6-x86_64
- how-to-install-graphite-on-centos6.6-x86_64
- how-to-install-redis-on-centos6.6-x86_64
- how-to-install-nginx-on-centos6.6-x86_64
- how-to-install-ganglia-from-prebuild-rpm-on-centos6.6-x86_64
- how-to-install-kafka-full-distributed-cluaster-on-centos6.6-x86_64
- How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7
- How to install Mediaproxy 2.5.2 on CentOS 6 64 bit
- How to install Mediaproxy 2.5.2 on CentOS 6 64 bit
- How to Install RSyslog+MySQL with LogAnalyzer on CentOS
- How to install debug flash player 11.1 on 64-bit
- How to install squid proxy on centos 6
- How to install Python 2.7.3 on CentOS 6.2
- [转]How to install PHP 5.3 on CentOS
- How to install Python 2.7.3 on CentOS 6.2
- How to Install Apache CouchDB on CentOS 6 (from Source and EPEL)
- How to Install php-mcrypt on CentOS 6.2
- 「2013-1-24」Cadence ic5141 installation on CentOS 5.5 x86_64 (limited to personal use)
- 如何在RHEL6上配置PAM LDAP认证(How to setup LDAP Authentication for PAM on RHEL6 x86_64)