Skip to main content
 首页 » 编程设计

linux之如何在ui上查看 Graphite 图

2023年11月22日57kuangbin

之前我使用 Ganglia 来监控一堆节点,但现在我们正在转向 Graphite,并将使用 RRDtool 作为我们的存储引擎。我已经从源代码构建了所有与 Graphite 相关的文件,并且可以启动碳和 Graphite 守护进程。但是如何在 ui 上查看这些图表呢?

请您参考如下方法:

这是一个非常宽泛的问题。尽管如此-

Graphite 栈由三部分组成-

  1. Carbon(聚合工具)
  2. Whisper(基于 sqlite3 的 RRD)
  3. Graphite-web(基于 django 的网络应用程序)

Graphite web 将通过读取 whisper 的目录树来显示图表。默认情况下,堆栈将自身无缝安装在 /opt/graphite 中,其中 /opt/graphite/storage/whisper 是 RRD 目录树的默认位置。

您必须做的另一件事是您需要进入您的网络服务器的虚拟主机区域。如果你使用的是 apache,你可以做一些类似的事情-

<IfModule !wsgi_module.c> 
    LoadModule wsgi_module modules/mod_wsgi.so 
</IfModule> 
 
# XXX You need to set this up! 
# Read http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGISocketPrefix 
WSGISocketPrefix run/wsgi 
 
<VirtualHost *:80> 
        ServerName 54.28.2.2 
        DocumentRoot "/opt/graphite/webapp" 
        ErrorLog /opt/graphite/storage/log/webapp/error.log 
        CustomLog /opt/graphite/storage/log/webapp/access.log common 
 
        WSGIDaemonProcess graphite processes=5 threads=5 display-name='%{GROUP}' inactivity-timeout=120 
        WSGIProcessGroup graphite 
        WSGIApplicationGroup %{GLOBAL} 
        WSGIImportScript /opt/graphite/conf/graphite.wsgi process-group=graphite application-group=%{GLOBAL} 
 
        WSGIScriptAlias / /opt/graphite/conf/graphite.wsgi 
 
        Alias /content/ /opt/graphite/webapp/content/ 
        <Location "/content/"> 
                SetHandler None 
        </Location> 
 
        Alias /media/ "@DJANGO_ROOT@/contrib/admin/media/" 
        <Location "/media/"> 
                SetHandler None 
        </Location> 
 
        <Directory /opt/graphite/conf/> 
                Order deny,allow 
                Allow from all 
        </Directory> 
 
</VirtualHost> 

在大多数情况下,这是设置堆栈所需的所有自定义。我建议你看一些git gists关于您的架构和发行版。