Running Graphite on Windows

December 9, 2012, with 14 comments
by admin

As mentioned in my previous post, I discovered the Graphite monitoring system and ported it to Windows. That wasn’t as difficult as I initially thought so I’ll explain the steps in detail in this and more upcoming posts so that everyone interested can follow the guide easily.

I got good hints and help from Ron Cordell from Relay Health who previously ported Graphite to Windows in a similar fashion. Thanks a lot, Ron!

Prerequisites for running Graphite are:

  • install Python (in my case: latest release of version 2.7)
  • install pypi/ setuptools (download here)

I forked the official carbon from github and inserted the changes I made. You find the fork here:

https://github.com/stephanstapel/carbon

There are some steps that you need to perform in order to successfully run Graphite on Windows:

  1. Download Carbon (here)
  2. Download Whisper (here)
  3. Download Graphite-web (here)
  4. Install Whisper using setup.py install
    It goes into the Python libs/site-packages directory
  5. Change the path in Carbon’s setup.cfg to a Windows path. In my case:
    prefix = d:\graphite
  6. Run setup.py install
  7. Change local data directory setting: open conf/carbon.conf and change LOCAL_DATA_DIR. Alternatively, you can set following environment variables as specified in carbon.conf file:
    • GRAPHITE_ROOT
    • GRAPHITE_CONF_DIR
    • GRAPHITE_STORAGE_DIR

After committing my changes into the branch, I issued a pull request and hope that it will be approved.

If you find anything not to be working, please let me know.

The second article will cover the Graphite-webapp. This app runs on Windows without any code change but requires some additional packages to be installed.

Aktualisiert am February 14, 2013

14 Kommentare

  1. Hi,
    I’m trying to install Graphite into Windows Server 2012. I have downloaded and installed Python version 3.3.0, but when you say “install pypi (download here)”, the link sends to me to a page with a big list of packages, and I don’t know which packages I should get. Please, could you say me which of them I have to install?, or what do I should install?

    thank you very much,

    Regards
    Carlos Coronel

  2. Carlos,
    which version of the setuptools did you install? I don’t see a listing for python 3.x

  3. hi,
    I am working on the windows process of shinken (monitoring tool based on python and using the nagios conf files). My goal is to provide setups for windows to use shinken. I have some request to install graphite on windows to use it with shinken. Is it possible for me to package your graphite installation into a setup.exe file and put it into the windows shinken setup (i think as an external setup.exe to check and trace the installations)? It will be easier for a lot of windows users to launch a setup.exe than make 3 githubs and other handmade modifications. Of course, i will not change the licence and put a reference of your work and website. Shinken is deliver with AGPL licence.

    Let me know if you want more explanations, or if you have some questions.
    Regards,

    Jean-Francois BUTKIEWICZ
    Veosoft, France

    • Hi Jean-Francois,

      unfortunately, my experience with setup generators is limited. I understand the concern that one has to checkout a couple of github repositories but on the otherhand this gives you always an up-to-date version of the application. It would probably be easier to write a small python script that checks out the projects and then modifies the configuration files as required. So more or less a setup.py.

      Cheers,

      Stephan

  4. Hi,
    I follow the steps you described and got an error while start carbon. May I know how did you resolve this error because it seems that there is not a pwd module on windows? Thanks.

    D:\system\graphite\Scripts>carbon-cache.py start
    Traceback (most recent call last):
    File “D:\system\graphite\Scripts\carbon-cache.py”, line 28, in
    from carbon.util import run_twistd_plugin
    File “D:\system\graphite\lib\carbon\util.py”, line 3, in
    import pwd
    ImportError: No module named pwd

    Regards,
    Paxson Yang

  5. Hi Stephen,

    I’ve followed exactly all the step you provided.
    And got the same error as Paxson Yang. And it was definitely a version from https://github.com/stephanstapel/carbon (and whsiper and graphite-web I also grabbed from https://github.com/stephanstapel/).

    To be more exact:
    https://codeload.github.com/stephanstapel/carbon/zip/master
    https://codeload.github.com/graphite-project/whisper/zip/master
    https://codeload.github.com/graphite-project/graphite-web/zip/master

    c:\carbon\Scripts>carbon-cache.py start
    Traceback (most recent call last):
    File “C:\carbon\Scripts\carbon-cache.py”, line 28, in
    from carbon.util import run_twistd_plugin
    File “C:\carbon\lib\carbon\util.py”, line 17, in
    from twisted.python.util import initgroups
    ImportError: No module named twisted.python.util

    c:\carbon\Scripts>

    Could you please suggest how to solve this?

  6. according to the error message, you are missing the twisted library.
    Please refer to the second post:

    http://www.s2-industries.com/wordpress/2013/01/running-graphite-webapp-on-windows/

    on how to install the dependencies for the web frontend.

  7. Hi Stephan,

    Thanks for the great article. It’s been very helpful as I have Graphite running on a Raspberry Pi but I want to transfer it across to a Windows machine so I can use the Pi in a robot project :)

    I’ve got the carbon and webapp running ok but the metrics are appearing in the browser with a slash in the path. So instead of ‘carbon’ and a sub branch of ‘agents’ I get ‘carbon\agents’.

    It must be due to the Windows backslash but you didn’t have a problem so is it a conf issue?

    Thanks for any help you can provide.
    Rob

    • Hi Rob,

      Unfortunately I haven’t a Graphite installation running currently so I can’t confirm this. Sorry for that. Imho, it would make sense to search for ‘pathsep’ in the code and replace it by ‘/’.

      Cheers,

      Stephan

  8. When I run the whisper and carbon installs, I get syntax errors anywhere that looks like this:

    except whisper.InvalidConfiguration, e:

    If the except has a comma and e after it, that is bad syntax. Not being a Python person, I have no idea how to fix this. I’m using Python 3.3. Do I need to back-level to 2.7?

Schreibe einen Kommentar

Kommentar absenden >>