graphiteã®ã¤ã³ã¹ãã¼ã«
Graphiteã¯ãã¹ã±ã¼ã©ãã«ãªã¨ã³ã¿ã¼ãã©ã¤ãºåããªã¢ã«ã¿ã¤ã ã»ã°ã©ãã»ã·ã¹ãã ãã ããã ãããã使ãã¨ä½ãããã®ãã¯å¥ã®ãã¹ãã§ã¾ã¨ããã¨ãã¦ãã¤ã³ã¹ãã¼ã«ã®æé ãã¡ã¢ã£ã¦ããããã
ããããµã¤ã http://graphite.wikidot.com/
æ§æ
graphiteã¯djangoã¢ããªã«ããããã³ãã¨ã³ãã¨carbonã¨ããããã±ã³ãããæ§æããããcarbonã¯ç¬èªã®ãããã³ã«(ä½ã§http使ããªãã®ããã¹ã±ã¼ã©ããªãã£ã¼ã®çºã)ã§ã°ã©ã表示ãããã¼ã¿ãåãããã¦ã§ãã¢ããªã¯carbonã管çãããã¼ã¿ãã°ã©ãã¨ãã¦ç¶ºéºã«è¦ãããã°ã©ãã¨ã³ã¸ã³ã¯cairoãä¾åã¢ã¸ã¥ã¼ã«ãå¤ãã¤ã³ã¹ãã¼ã«ã¯ã¡ãã£ã¨é¢åãªã®ã§æ´çãã¦ã¿ãã
graphiteé¢ä¿
https://launchpad.net/graphiteã§å ¥æ
- graphite-webï¼ graphiteã®ããã³ãã¨ã³ããdjangoã«ããã¦ã§ãã¢ããª
- carbonï¼ graphiteã®ããã±ã³ãã表ã«ãããã¼ã¿ãåãDBã«ã³ããããããã¼ã¢ã³ã
- whisper: DBã©ã¤ãã©ãª
cairoã°ã©ãã£ãã¯ã¹ã©ã¤ãã©ãªé¢ä¿
cairographics.orgãæä¾
- pixman
- cairo
- pycairo
æ¨æºdebianã¢ã¸ã¥ã¼ã«
cairoæ§ç¯ã«ãã£ãæ¹ãè¯ããããªããã±ã¼ã¸
- libpng12-dev:
- librsvg2-dev
- libx11-xcb1
ä¸è¬çãªãã®
ã¤ã³ã¹ãã¼ã«
pixman
$ wget http://cairographics.org/releases/pixman-0.24.0.tar.gz
$ tar xzf pixman-0.24.0.tar.gz
$ cd pixman-0.24.0/
$ ./configure
$ make
$ sudo make install
cairo
# cairoãä¾åããã°ã©ãã£ãã¯ã¹ã©ã¤ãã©ãªãå ¥ãã¦ããã¨ãã
$ sudo apt-get install libpng12-dev librsvg2-dev libx11-xcb1
$ wget http://cairographics.org/releases/cairo-1.10.2.tar.gz
$ tar xzf cairo-1.10.2.tar.gz
$ cd cairo-1.10.2/
$ ./configure && make
$ sudo make install
pycairo
- http://cairographics.org/releases/
- wget http://cairographics.org/releases/pycairo-1.8.8.tar.gz
- ./configure; make; make install
ãã¤ã½ã³ã¢ã¸ã¥ã¼ã«ãªã®ã«./configureã graphite webappã¯ããã«ä¾åããããã§ãã¯ã¯ãªããã¤ã³ã¹ãã¼ã«ãå¿ããã¨ã°ã©ãã®é¨åããªã³ã¯åããã¼ã¯ã«ãªããããã«ã¿ããæªããã¨ã«ãã¨ã©ã¼ã¯ãã°ã«æ®ããªããã°ã©ãããªã³ã¯åãããã¨ãã¯ãããå¥ã¿ãã§ç©ºããã¨ã¨ã©ã¼ã¡ãã»ã¼ã¸ãè¦ããã
carbon
- sudo apt-get install python-twisted
- http://launchpad.net/graphiteããcarbon-x.y.z.tar.gzãã¦ã³ãã¼ã (0.9.9)
- sudo python setup.py install
whisper
- http://launchpad.net/graphiteããwhisper-x.y.z.tar.gzãã¦ã³ãã¼ã (0.9.9)
- sudo python setup.py install
django
easy_installãããã¼ã¸ã§ã³ã ã¨django-1.3.1ããã¤ã³ãã¼ãã¨ã©ã¼ãã
ææ°ã®django-tagging-0.3.1.tar.gzã§ãã®åé¡ã解決ãhttp://code.google.com/p/django-tagging/downloads/listãããã¦ã³ãã¼ããã¦ã½ã¼ã¹ããpython setup.py install
ImportError: cannot import name parse_lookup
graphite-web (0.9.9)
- http://launchpad.net/graphiteãããã¦ã³ãã¼ã
- sudo python setup.py install
è¨å®
- ãã°ãDBã®ãããã£ã¬ãã¯ããªãã¦ã§ããµã¼ãããæ¸ãè¾¼ããããã«ãã
sudo chown -R www-data:www-data /opt/graphite/storage/
- django DBãã¤ãã
cd /opt/graphite/webapp/graphite; ./manage.py syncdb
graphite-web, django, apache2
mod_pythonãã¤ã³ã¹ãã¼ã«ããã¦ãããã¨ã確èª
$ ls /etc/apache2/mods-enabled/python.load
apacheè¨å®
/etc/apache2/sites-enabled/graphite.conf
$ sudo /etc/init.d/apache2 restart
ServerName my-graphite-host
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
CustomLog /opt/graphite/storage/log/webapp/access.log common
SetHandler python-program
PythonPath "['/opt/graphite/webapp'] + sys.path"
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE graphite.settings
PythonDebug Off
PythonAutoReload Off
SetHandler None
SetHandler None
Alias /media/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media/"
carbonè¨å®ãã¡ã¤ã«
$ cd /opt/graphite/conf/
# ãä»»ãè¨å®
$ cp carbon.conf.example carbon.conf
$ cp storage-schemas.conf.example storage-schemas.conf
carbonãã¼ã¢ã³èµ·å
$ sudo -u www-data /opt/graphite/bin/carbon-cache.py start
carbonã¯ã©ã¤ã¢ã³ãã§è¡¨ã«ãããã¼ã¿ãcarbonã«éã
ããã¤ã¯system.loadavg_{1,5,15}minã®ãã¼ã¿ãã²ãããã«ã¼ãã³ã«éãç¶ããããã©ã¦ã¶ãhttp://my-graphite-hostã«åããã¨ãGraphiteãã¨ãUser Graphsãã¨ãããã©ã«ããããã空ã ãexample-client.pyãèµ·åãã¦ãã°ããããã¨Graphite->system->loadavg_5minãªã©ã«ãã¼ã¿ãå ¥ãå§ããå³ã«ã°ã©ãã表ãããããAuto-Refreshããæ¼ãã¦ããã¨ãåæã«ã°ã©ããæ´æ°ãã¦ãããã
$ ~/src/graphite-web-0.9.9/examples/example-client.py
sending message
...
ãããè¦ãããæåããã£ã¦ãããã¨ã«ãªããã ããã
åç §
- ãããåèã«ããï¼ http://agiletesting.blogspot.com/2011/04/installing-and-configuring-graphite.html
- graphiteã®HP http://graphite.wikidot.com/
- http://cairographics.org/
ã¢ããªã±ã¼ã·ã§ã³ããã®ãã¼ã¿ãã°ã©ãåããã ãã®ããã«å¤§å·¥äºã«ãªã£ã¦ãã¾ã£ããdjangoã¢ããªãmod_pythonã®ä¸ã§åããã(fcgiã«ã§ããªãã£ãã®ãã)ãã¾ãå¥ããã»ã¹ã§ããã¯ã¨ã³ããåãããã¨ã°ã©ãã£ãã¯ã¹ã©ã¤ãã©ãªã®ä¾åãé¢åããããæªã ããã®ã ã次ã¯statsdã¨ããgraphiteã®åã«ç½®ããµã¼ãã¹ãè¨å®ãããtcpã§åæçãªgraphiteã®APIã«å¯¾ãã¦ã¢ããªã±ã¼ã·ã§ã³ã«ã¨ã£ã¦æ¥½ãªUDPã¤ã³ã¿ã¼ãã§ã¼ã¹ãæä¾ããnode-jsãµã¼ãã¹ã ããããããã¨ãã°ã©ã表示ã®ããã«ããã»ã¹ãä¸ã¤ã管çããªãããããªããã¨ã«ãªããããããã
gnuplotãä½ã使ãã°ãã£ã¨ç°¡æ½ãªã°ã©ããµã¼ãã¹ãã§ããããªæ°ãããã