Graphite安装

1. 安装cairo和pycairo

yum -y install cairo pycairo

2. pip安装方式

pip是python的一个组件,安装pip的方法可以参考pip安装和使用教程

pip install django django-tagging carbon whisper graphite-web

2. 安装文件布局

Graphite安装之后,在安装位置(默认为/opt/graphite)的文件布局如下:

  • bin  - 二进制文件目录,包括carbon-cache.py、carbon-relay.py、validate-storage-schemas.py、carbon-aggregator.py、carbon-client.py等程序
  • build
  • conf  - 配置文件目录
  • lib  - 库目录
  • storage  - 数据存放目录,包括log,whisper数据库,索引,rrd数据等
  • webapp – webapp文件存放目录

3. 设置Graphite配置文件

cp carbon.conf.example carbon.conf
cp whitelist.conf.example whitelist.conf
  • /opt/graphite/conf是配置文件存放目录
  • carbon.conf是carbon的配置文件,分三个片段cache、relay和aggregator。需要使用到的配置项后面在必要的时候会讲到
  • storage-schemas.conf配置文件定义数据的存储。
  • graphite.wsgi配置文件配置django。

4. uwsgi和nginx安装

wget http://projects.unbit.it/downloads/uwsgi-1.9.20.tar.gz; tar xzvf uwsgi-1.9.20.tar.gz; cd uwsgi-1.9.20; python setup.py install
yum -y install nginx

5. nginx配置和uwsgi配置

vim /etc/nginx/conf.d/graphite.conf

server {
    listen 1988;
    server_name graphite;


    access_log /opt/graphite/storage/log/webapp/access.log ;
    error_log /opt/graphite/storage/log/webapp/error.log ;


    location / {
        uwsgi_pass 0.0.0.0:1999;
        include uwsgi_params;
        proxy_connect_timeout 300;
        proxy_send_timeout 300;
        proxy_read_timeout 300;
    }
}

vim /opt/graphite/webapp/graphite/wsgi_graphite.xml
<uwsgi>
    <socket>0.0.0.0:1999</socket>
    <workers>1</workers>
    <processes>1</processes>
    <listen>100</listen>
    <chdir>/opt/graphite/webapp/graphite</chdir>
    <pythonpath>..</pythonpath>
    <module>wsgi</module>
    <pidfile>graphite.pid</pidfile>
    <master>true</master>
    <enable-threads>true</enable-threads>
    <logdate>true</logdate>
    <daemonize>/var/log/uwsgi_graphite.log</daemonize>
</uwsgi>

6. 启动nginx和应用程序

service nginx start; uwsgi -x /opt/graphite/webapp/graphite/wsgi_graphite.xml





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值