Running Graphite on Windows
December 9, 2012, with 21 commentsAs 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:
- Download Carbon (here)
- Download Whisper (here)
- Download Graphite-web (here)
- Install Whisper using setup.py install
It goes into the Python libs/site-packages directory - Change the path in Carbon’s setup.cfg to a Windows path. In my case:
prefix = d:\graphite - Run setup.py install
- 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
Carlos schrieb am
February 14, 2013 um 10:37 amHi,
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
stephan schrieb am
February 14, 2013 um 10:56 amHi Carlos,
You are right. The link was a bit misleading. You should rather download the setuptools (which including pypi):
http://pypi.python.org/pypi/setuptools
Please note that I only tried with Python 2.7, not 3.x. I’m eager to learn if there are any compatibility issues.
Noel schrieb am
April 23, 2013 um 9:32 pmCarlos,
which version of the setuptools did you install? I don’t see a listing for python 3.x
stephan schrieb am
April 23, 2013 um 9:41 pmHi Noel,
try this one:
http://www.pip-installer.org/
jean-francois BUTKIEWICZ schrieb am
May 23, 2013 um 10:28 pmhi,
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
stephan schrieb am
May 24, 2013 um 4:44 pmHi 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
Paxson Yang schrieb am
September 10, 2013 um 12:43 pmHi,
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
stephan schrieb am
September 10, 2013 um 7:05 pmHi Paxson,
I guess you are using the standard version of Graphite, not my fork.
As a reference, please take a look as the changed util.py:
https://github.com/stephanstapel/carbon/blob/master/lib/carbon/util.py#L3
which points to crossplatform library as the pwd library is not available on Windows. Let me know if you have any questions downloading my fork!
Cheers,
Stephan
Yanek schrieb am
November 13, 2013 um 2:10 pmHi 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?
stephan schrieb am
November 13, 2013 um 9:21 pmaccording 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.
|Rob schrieb am
February 8, 2014 um 7:18 pmHi 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
stephan schrieb am
February 8, 2014 um 8:29 pmHi 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
Mike schrieb am
April 10, 2014 um 5:54 pmWhen 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?
stephan schrieb am
April 10, 2014 um 7:25 pmplease use Python 2.7
Amir schrieb am
May 9, 2014 um 9:48 amI get an error like this
Traceback (most recent call last):
File “setup.py”, line 96, in
**setup_kwargs
File “C:\Python27\lib\distutils\core.py”, line 152, in setup
dist.run_commands()
File “C:\Python27\lib\distutils\dist.py”, line 953, in run_commands
self.run_command(cmd)
File “C:\Python27\lib\distutils\dist.py”, line 971, in run_command
cmd_obj.ensure_finalized()
File “C:\Python27\lib\distutils\cmd.py”, line 109, in ensure_finalized
self.finalize_options()
File “C:\Python27\lib\distutils\command\install.py”, line 353, in finalize_opt
ions
‘userbase’, ‘usersite’)
File “C:\Python27\lib\distutils\command\install.py”, line 504, in convert_path
s
setattr(self, attr, convert_path(getattr(self, attr)))
File “C:\Python27\lib\distutils\util.py”, line 124, in convert_path
raise ValueError, “path ‘%s’ cannot be absolute” % pathname
ValueError: path ‘/opt/graphite/webapp’ cannot be absolute
stephan schrieb am
May 9, 2014 um 6:17 pmIs there eventually a configuration entry you forgot to change? Search for /opt/graphite/webapp
Rhuan Karlus schrieb am
June 2, 2014 um 3:11 pmHello, i can’t find the specified file in my system: conf/carbon.conf
There’s another file in this directory. It’s conf/carbon.conf.example should I modify this last?
stephan schrieb am
June 2, 2014 um 8:24 pmyes, please do that!
Hiko schrieb am
October 7, 2014 um 10:15 amI cannot install carbon package, I modified setup.cfg to local path and then I run setup.py install that show below message
C:\Work\git\carbon>setup.py install
C:\Work\Python27\Lib\distutils\dist.py:267: UserWarning: Unknown distribution option: ‘install_requires’
warnings.warn(msg)
running install ………..
And I check by pip list that doesn’t have carbon package in list.
Please advise me.
stephan schrieb am
October 7, 2014 um 9:24 pmHi Hiko,
In the meantime, there was a good suggestion on github for a different way to run Graphite on Windows.
Please see this post:
https://github.com/graphite-project/carbon/pull/49#issuecomment-52241953
Cheers,
Stephan
Volodymyr schrieb am
March 24, 2016 um 2:14 pmHi Stephan,
is anything changed from the time you posted the Graphite installation on Windows guide?
I ran Windows 7, with Anaconda Python (very new installation), and I run into errors when installing Carbon and then Graphite web.
Can you help me there?
Thank you in advance,
Volodymyr