`

Linux安装graphite(nginx+uwsgi)过程

阅读更多

由于需要测量程序的各种指标,使用dropwizard metrics,数据直接输出到graphite.

看了很多别人安装graphite的文章,回馈下,写下自己的安装过程。

 

1、查看系统版本

cat /proc/version

Linux version 4.4.10-1-pve (root@elsa) (gcc version 4.9.2 (Debian 4.9.2-10) ) 

 

2、git下载源码

 

Graphite-web: git clone https://github.com/graphite-project/graphite-web.git

Carbon: git clone https://github.com/graphite-project/carbon.git

Whisper: git clone https://github.com/graphite-project/whisper.git

Ceres: git clone https://github.com/graphite-project/ceres.git

 

3、安装各种requirement

yum install python-devel

yum install pycairo-devel

(pycairo-devel.x86_64.0.1.8.10-8.el7)

yum install cairo-devel

(cairo-devel-1.14.2)

pip install django

(django-1.9.9,注意django必须是1.9.9,1.8和1.10都失败!)

pip install django-tagging

(django-tagging-0.4.3)

pip install python-memcached

(python-memcached-1.58 six-1.10.0)

 

yum install openldap-devel

(openldap-devel-2.4.40-9.el7_2.x86_64)

pip install python-ldap

(python-ldap-2.4.27)

 

yum install rrdtool rrdtool-devel

(rrdtool.x86_64 0:1.4.8-9.el7)

pip install rrdtool

(rrdtool-0.1.5)

 

pip install pytz

(pytz-2016.6.1)

pip install pyparsing

(pyparsing-2.1.8)

pip install txamqp

(txAMQP-0.6.2.tar.gz)

 

pip install whitenoise

(whitenoise-3.2.1)

 

yum install pcre

 

4、检查依赖,并安装

./graphite-web/check-dependencies.py

显示:[REQUIRED] Unable to import the 'cairocffi' module, attempting to fall back to pycairo

All optional dependencies are met.

All necessary dependencies are met.

 

Graphite-web,Carbon,Whisper,Ceres,上面模块安装到缺省的位置(/opt/graphite/),分别执行python setup.py install

 

5、修改配置

配置 graphite-web: cd /opt/graphite/webapp/graphite; cp local_settings.py.example local_settings.py; 修改 local_settings.py 设置 TIME_ZONE = 'Asia/Shanghai'

 

6、创建数据库

PYTHONPATH=/opt/graphite/webapp django-admin.py migrate --settings=graphite.settings --run-syncdb

7、生成静态文件目录static目录

PYTHONPATH=/opt/graphite/webapp django-admin.py collectstatic --noinput --settings=graphite.settings

 

8、安装nginx或者tengine

安装nginx,

wget http://nginx.org/download/nginx-1.10.1.tar.gz

wget http://zlib.net/zlib-1.2.8.tar.gz

wget https://sourceforge.net/projects/pcre/files/pcre/8.39/pcre-8.39.tar.gz/download

yum install openssl

wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz

 

./configure --sbin-path=/usr/local/nginx/nginx --conf-path=/usr/local/nginx/nginx.conf --pid-path=/usr/local/nginx/nginx.pid  --with-http_ssl_module --with-pcre=../pcre-8.39 --with-zlib=../zlib-1.2.8 --with-openssl=../openssl-1.0.2h

 

make

make install

 

nginx安装完毕

 

9、安装uwsgi并配置

 

pip install uwsgi

 

配置graphite.ini

[uwsgi]

#post-buffering = 32768

#buffer-size = 32768

chdir=/opt/graphite/conf/

wsgi-file=graphite.wsgi

master=true

pidfile=/tmp/graphite.pid

vacuum=true

#max-requests=10000

daemonize=/opt/graphite/log/access_graphite.log

#processes=15

socket=127.0.0.1:43210

#stats=127.0.0.1:1234

#listen=1024

 

测试时可以使用该命令:uwsgi --chdir /opt/graphite/conf/ --wsgi-file graphite.wsgi --socket 127.0.0.1:43210

 

10、配置nginx

 

编辑nginx.conf,配置upstream,listen,server等

 

11、修改store规则

cd /opt/graphite/conf

copy模板文件: ls | awk '{a=$1;sub(/.example/,"",a);print "cp "$1" "a;}'|sh

修改/opt/graphite/conf/storage-schema.conf 增加自己的业务单元[xxxxx]

 

12、启动

启动carbon /opt/graphite/bin/carbon-cache.py start

(如果提示service_identity, 执行pip install service_identity)

 

启动uwsgi, uwsgi graphite.ini

启动nginx, nginx

访问http://xx.xx.xx.xx/ 或者 http://xx.xx.xx.xx/graphite/

成功之后,启动/opt/graphite/examples/python example-client.py,然后再去web查看测试数据是否显示正确。

 

 

注意业务配置:

1、storage-schemas.conf 指标保存的周期,和过期后向更粗粒度聚合后的保存周期。

2、storage-aggregation.conf 指标过期后的聚合规则

3、aggregation-rules.conf 实时的指标聚合规则,根据接收到的指标生成新指标并保存。需要运行carbon-aggregator.py

4、rewrite-rules.conf 重写指标名称,根据正则表达式。

1
0
分享到:
评论

相关推荐

    docker-graphite, 在 Docker 图像中,Graphite + 碳.zip

    docker-graphite, 在 Docker 图像中,Graphite + 碳 Graphite + 碳运行 Graphite 和碳缓存的all-in-one映像。 版本: 0.9.12.这里映像包含 Graphite 和碳缓存的默认默认配置。 启动这里容器将默认绑定下列主机端口:...

    graphite_exporter-0.12.0.linux-amd64.tar.gz

    这个“graphite_exporter-0.12.0.linux-amd64.tar.gz”文件是一个针对Linux 64位系统的版本,版本号为0.12.0。在IT运维领域,特别是在监控和性能分析中,它扮演着重要的角色。 Prometheus是一款流行的开源监控系统...

    docker-graphite-api-grafana

    对于小型安装,所有内容都在一台服务器上运行并使用默认端口和位置,默认设置将开箱即用。 如果您需要覆盖它们,请使用lincolnloop/graphite-api-grafana作为基础编写新的 Dockerfile 或在运行时添加卷: docker...

    graphite2-devel-1.3.10-10.el8.aarch64.rpm

    离线安装包,亲测可用

    graphite-nginx-module:Nginx模块,用于将统计信息收集到Graphite中

    Nginx模块,用于将位置统计信息收集到Graphite中。 该模块不随Nginx源一起分发。 请参阅。 特征 位置,服务器或http指标的汇总 百分位数的计算 通过UDP或TCP以非阻塞方式将数据发送到Graphite 从lua发送自定义指标...

    graphite-soft

    2. **配置文件**:安装过程中,可能需要对Graphite的配置文件进行调整,以适应特定环境,如数据库设置、监听端口、数据存储路径等。 3. **启动脚本和服务定义**:为了使Graphite能够作为后台服务运行,压缩包可能...

    Python + Statsd + Graphite 搭建监控平台

    在网上找了很久,没有一篇很完整很清晰地介绍Statsd+Graphite搭建监控平台,正好边摸索边尝试边写下来,方便大家。 (Notice: 一开始我是在macOs Sierra下安装, 后来在Ubuntu上也安装)

    graphite安装依赖组件

    graphite安装依赖组件

    docker-graphite-statsd, 用于 Graphite & Statsd的Docker 图像.zip

    docker-graphite-statsd, 用于 Graphite & Statsd的Docker 图像 用于 Graphite & Statsd的 Docker 映像立即运行 Graphite & StatsdGraphite & Statsd可能对安装程序很复杂。 这个映像将在几分钟内运行&

    Graphite工具

    Graphite工具是一款强大的计算机图形学和3D建模软件,主要应用于数值几何的研究与实践。在数字艺术、游戏开发、工业设计以及科学研究等领域,Graphite都展现出了其强大的功能和灵活性。这款工具允许用户处理.obj文件...

    graphite2-1.3.10-1.el7_3.i686.rpm

    官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装

    graphite-project.github.io, Graphite 项目的未来网站.zip

    graphite-project.github.io, Graphite 项目的未来网站 Graphite安装bundle install 或者'gem 安装 scss_lint github页面"'npm install正在运行/开发运行Grunt任务并启动osm服务器grunt serve建筑grunt

    metrics-graphite-3.1.5-API文档-中文版.zip

    赠送jar包:metrics-graphite-3.1.5.jar; 赠送原API文档:metrics-graphite-3.1.5-javadoc.jar; 赠送源代码:metrics-graphite-3.1.5-sources.jar; 赠送Maven依赖信息文件:metrics-graphite-3.1.5.pom; 包含...

    graphite0.9.9相关安装包

    7. 构建和安装graphite-web: ``` cd ../graphite-web-0.9.9 python setup.py install ``` 8. 配置graphite-web:修改`/etc/graphite/webapp/graphite/local_settings.py`,配置数据库连接、碳缓存地址等。 9....

    InfluxDB(influxdb2-2.1.1-linux-amd64.tar.gz)

    InfluxDB(influxdb2-2.1.1-linux-amd64.tar.gz)适用于Linux x86_64系统。 InfluxDB 是一个开源的时间序列数据库,能应付极高的写和查询并发数,主要用于存储大规模的时间戳数据(每条记录自动附加时间戳),如 ...

    docker-grafana-graphite:带有StatsD,Graphite,Grafana 2和Kamon仪表板的Docker映像

    该映像下发布,并且您需要做的所有前提条件是将docker , docker-compose和make安装在您的计算机上。 容器公开以下端口: 80 :Grafana Web界面。 81 :Graphite Web端口 2003 :石墨数据端口 8125 :StatsD端口。...

    graphite-api, Graphite的ruby API工具包.zip

    graphite-api, Graphite的ruby API工具包 描述使用收费 GraphiteAPI,可以提供两种方式与 Graphite 守护进程交互,第一种方法是使用收费的GraphiteAPI::Client 守护进程,第二个方法实现 Graphite 纯文本协议,这两...

    PyPI 官网下载 | graphite-web-1.1.3.tar.gz

    从这个压缩包中解压后,你可以找到构建和安装 Graphite Web 应用所需的所有文件。 安装 Graphite Web 需要一定的前置知识,包括 Python 开发环境以及对 Web 服务和数据库的基本理解。Python 库标签表明这个项目依赖...

    Graphite网站实时信息采集和统计 v1.1.10.zip

    2. **安装**:解压下载的文件,然后使用pip或其他方式安装Graphite的各个组件。 3. **配置**:修改`graphite/conf/settings.py`以连接到你的Carbon服务器和数据源,设置存储路径等。 4. **启动服务**:启动Carbon和...

Global site tag (gtag.js) - Google Analytics