设为首页 收藏本站
查看: 851|回复: 2

[经验分享] CentOS 5.5 安装Graphite

[复制链接]

尚未签到

发表于 2013-6-28 09:43:38 | 显示全部楼层 |阅读模式

CentOS 5.5 安装Graphite


1.系统信息汇总

[iyunv@cc-monitor conf]# uname -a
Linux cc-monitor 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25 EST  2011 x86_64 x86_64 x86_64 GNU/Linux

[iyunv@cc-monitor conf]# python -V
Python 2.4.3

[iyunv@cc-monitor conf]# getenforce
Disabled

2.安装Graphite依赖包

添加额外的源
除了CentOS源base、updates、extra之外,再添加两个源:epel和rpmforge。
# 安装epel源
yum install epel-release-5-4.noarch.rpm
# 安装rpmforge源
yum install rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

安装依赖包
依赖包相当多,争取一次搞定
yum -y install bitmap bitmap-fonts Django pycairo python-devel  python-ldap python-memcached mod_wsgi python-sqlite2 glibc-devel gcc gcc-c++  git openssl-devel python-zope-interface httpd memcached python-hashlib   django-tagging python-twisted python-simplejson

这里还是做一下简单说明:
cairo是graphite的绘图库,是必须的软件。
bitmap-fonts字体也是需要的,否则可能图形显示不正常
python-twisted必须安装rpmforge源的python-twisted-core-8.2.0-1.el5.rf,这也是为什么添加rpmforge源的原因。
mod_wsgi是apache的模块

3.安装Graphite组件

Graphite组件包括三个部分:carbon、whisper和graphite-web
下载地址:

# install graphite-web

tar zxvf graphite-web-0.9.10.tar.gz

cd graphite-web-0.9.10

python setup.py install

cd ..

# install whisper

tar zxvf whisper-0.9.10.tar.gz

cd whisper-0.9.10

python setup.py install

cd ..

# install carbon

tar zxvf carbon-0.9.10.tar.gz

cd carbon-0.9.10

python setup.py install



4.配置apache服务

创建 Graphite 的虚拟主机配置:/etc/httpd/conf.d/graphite.conf,创建方法如下:

cat > /etc/httpd/conf.d/graphite.conf

Listen 8080


# You may need to manually edit  this file to fit your needs.

# This configuration assumes  the default installation prefix

# of /opt/graphite/, if you  installed graphite somewhere else

# you will need to change all  the occurances of /opt/graphite/

# in this file to your chosen  install location.

<VirtualHost *:8080>

ServerName graphite

DocumentRoot  "/opt/graphite/webapp"


# I've found that an  equal number of processes & threads tends

# to show the best  performance for Graphite (ymmv).

WSGIDaemonProcess  graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120

WSGIProcessGroup graphite


# You will need to create  this file! There is a graphite.wsgi.example

# file in this directory  that you can safely use, just copy it to graphite.wgsi

WSGIScriptAlias /  /opt/graphite/conf/graphite.wsgi


Alias /content/  /opt/graphite/webapp/content/

<Location  "/content/">

SetHandler None

</Location>


# NOTE: In order for the  django admin site media to work you

# must change  @DJANGO_ROOT@ to be the path to your django

# installation, which is  probably something like:

#  /usr/lib/python2.6/site-packages/django

Alias /media/  "/usr/lib/python2.4/site-packages/django/contrib/admin/media/"

<Location  "/media/">

SetHandler None

</Location>


# The graphite.wsgi file  has to be accessible by apache. It won't

# be visible to clients  because of the DocumentRoot though.

<Directory  /opt/graphite/conf/>

Order deny,allow

Allow from all

</Directory>


</VirtualHost>


配置mod_wsgi模块

在  /etc/httpd/conf.d/wsgi.conf文件中添加以下两行:

LoadModule wsgi_module  modules/mod_wsgi.so

WSGISocketPrefix /var/run/wsgi



5.配置Graphite

运行以下命令创建配置文件
cd /opt/graphite/conf/
for i in graphite.wsgi carbon.conf  storage-schemas.conf storage-aggregation.conf; do cp $i.example $i; done
cd /opt/graphite/webapp/graphite/
cp local_settings.py.example  local_settings.py

运行以下命令创建数据库:
cd /opt/graphite/webapp/graphite/
python manage.py syncdb
chown -R apache:apache /opt/graphite/



6.启动服务和程序

service httpd start
/opt/graphite/bin/carbon-cache.py start
安装已经完成。在浏览器中使用http://ip:8080,使用安装graphite的主机的ip代替。可以访问即可以肯定的告诉你CentOS 5安装Graphite成功了

7.安装node-js和statsd

#先安装python2.6
yum install bzip2* glibc-devel
cd Python-2.6.8
make clean
./configure
make
make install
ln -s /usr/local/bin/python  /usr/bin/python

#再安装node-js
cd node-v0.8.7
./configure
make
make install

#验证安装是否成功
[iyunv@cc-monitor statsd-2.0.1]# node -v
v0.8.7

#安装statsd
cp -R statsd /opt/graphite/


#Create /opt/graphite/statsd/local.js
[iyunv@cc-monitor statsd]# cat local.js
{
  graphitePort: 2003
, graphiteHost: "localhost"
, port: 8124
}

#start nodejs/statsd
cd /opt/graphite/statsd
nohup /usr/local/bin/node stats.js  local.js &




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-6848-1-1.html 上篇帖子: HDFS的安装和部署 下篇帖子: centos 6.4 x64 minimal安装后的基本操作

尚未签到

发表于 2013-8-19 22:07:54 | 显示全部楼层
月经不仅仅是女人的痛苦,也是男人的痛苦。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-12-12 15:03:38 | 显示全部楼层
我把心烧成火焰让怕黑的你拥着温暖入眠

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表