返回介绍

Graphite-Windows

发布于 2021-08-08 13:40:57 字数 6558 浏览 927 评论 0 收藏 0

Install Graphite 0.9.12 on Windows

Reference

1.1 手工下载安装

1.2 pip 安装

  • pip install zope.interface
  • pip install Django==1.5 (暂时不要装最新版)
  • pip install django-tagging
  • pip install pytz
  • pip install whisper
  • pip install carbon --install-option="--prefix=c:\python27\graphite" --install-option="--install-lib=c:\python27\graphite\lib"
  • pip install graphite-web --install-option="--prefix=c:\python27\graphite" --install-option="--install-lib=c:\python27\graphite\webapp"

1.3 后处理

1.配置文件
C:\Python27\graphite\conf 下的storage-schemas.conf.example 和 carbon.conf.example去掉example,
C:\Python27\graphite\webapp\graphite下的local_settings.py.example 去掉example.

2.修改carbon代码,以支持windows
参考了 https://github.com/stephanstapel/carbon ,在springside上做了个更简单的fork https://github.com/springside/carbon/ 修改后的版本,损失了自动记录carbon占用CPU的能力。 可以参考提交记录自行修改,也可以下载下来(版本是0.9.13-SNAPSHOT,不会同步更新),将C:\Python27\graphite\lib\carbon 和 C:\Python27\graphite\examples的内容直接覆盖掉。

3.修改graphite-web 代码,以支持windows
在0.9.12版本上的修改如下:

  • 修改webapp\graphite\thirparty\pytz_init.py 在92行给tz_path赋值 tz_path = 'C:\Python27\Lib\site-packages\pytz\zoneinfo'
  • 修改webapp\graphite\storage.py 在153行metric_path = relative_path.replace('/','.')后面加一行metric_path = metric_path.replace('\','.')

在最新版,修改的是finders.py的fs_to_metric()函数

4.初始化用户
c:\Python27\graphite\webapp\graphite>python manage.py syncdb 输入登录用户名,如root/rootroot,保存在内置的sqllite数据库里。

1.4 启动

  • 启动Carbon: C:\Python27\graphite\Scripts\carbon-cache.py start
  • 启动Web: django-admin.py runserver --pythonpath C:\Python27\graphite\webapp --settings graphite.settings 0.0.0.0:8080
  • 启动example-client:C:\Python27\graphite\examples\example-client.py ,真正定时取得CPU数据。

1.5 查看

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文