I have statsd+graphite running in my Windows environment using the C# client NStatsD.
Here are my notes for getting the Linux VM setup:
Note: I know enough Linux to be dangerous but am otherwise a noob and could be doing something unwittingly horrible.
Install Ubuntu Server 12.04. I used VirtualBox for dev and then later EC2 for prod.
Download graphite-fabric to your home folder. This is a script that will download, compile and install graphite and statsd. It expects a clean box and uses nginx for the web server.
The next steps are a download, compile and install which can take some time. It is worthwhile setting a keep alive on any putty ssh session before continuing.
Now install as per gingerlime's instructions in the README.md - including the requirements section.
Install statsd as per gingerlime's instructions.
Reboot
Execute netstat -nulp and observe 8125 is in use to confirm statsd is listening.
Check carbon is running tail /opt/graphite/storage/log/carbon-cache/carbon-cache-a/listener.log. If it isn't, try sudo /etc/init.d/carbon start
Now you have your server running, try throwing some counters at it with the NStatsD client.
Timezone fix:
This will fix graphite to graph times in your local zone
sudo chown www-data:www-data local_settings.py (check with ls -l that permissions look right)
sudo pico local_settings.py Set TIME_ZONE to something like Australia/Sydney. Discover what timezones you can use in /usr/share/zoneinfo/
Save and restart the box (not sure how to make it pick up the change without restart)
EC2 Notes
root is disabled on EC2. Fabric prompts for a root password which you don't have. Use the -i keyfile argument with fab to give it your ssh keyfile instead.
VirtualBox Notes
VBoxVMService was handy to automatically run the VM as a service in my Windows dev environment.
statsd.net is a scalable statsd clone with lots of cool extras, and designed for windows-centric environments. First production release is on the 29th of May, 2013
statsd-csharp-client is a lightweight statsd and statsd.net client, available for .net 3.5, 4.0 and 4.5 via nuget.
Full Disclosure: I'm the author of these two projects and I wrote them because I couldn't take etsy's statsd service to production - my organisation isn't ready to deploy and support nodejs-based services.
I had the same problem in my organisation - we're a windows-centric environment that wants to collect stats from all over the world into a single graphite repository. I had initially thought of using etsy's statsd but my company is not yet ready to roll with nodejs services in production. Along the way I found that having my own aggregation service meant I can do lots of interesting things like add memcached support for scalability, add new aggregators and so on.
The service is usable in console mode right now, and will be ready for production use from the 29th of May 2013 onwards.
Your best bet is to have a Linux server with statsd and Graphite installed. You would then just need to write some C# code to make the UDP call to get the metric into the system.
[UPDATE (6/23/2014): I came across a statsd/Graphite clone called statsd.net that looks promising but largely lacking on the Graphite side of the equation. I still think the best bet is to use the actual statsd/Graphite projects since any clone is necessary playing catch-up.]
There is quite a few open-source StatsD client implementations available in different Language including C#.NET. Etsy provide one on their github examples, also check out AppFirst version of statsd_clients.
在控制台窗口中执行 cd node_modules\statsd 和 npm run-script install-windows-service
但是,Graphite 仅运行在Linux。
Current statsd and nodejs versions allow you to run statsd on Windows without amendments. statsd package.json file already contains scripts to install and uninstall it as Windows service.
发布评论
评论(7)
我使用 C# 客户端 NStatsD 在 Windows 环境中运行 statsd+graphite。
以下是我设置 Linux VM 的注意事项:
注意:我知道 Linux 很危险,但除此之外我还是个菜鸟,可能会在不知不觉中做一些可怕的事情。
下载graphite-fabric到您的主文件夹。这是一个将下载、编译和安装 Graphite 和 statsd 的脚本。它需要一个干净的盒子并使用 nginx 作为 Web 服务器。
sudo apt-get install git
git 克隆 git://github.com/gingerlime/graphite-fabric.git
cd石墨-fabric/
sudo apt-get install python-setuptools
接下来的步骤是下载,编译和安装这可能需要一些时间。在继续之前,值得在任何 putty ssh 会话上设置保持活动状态。
现在按照 README.md 中的gingerlime 说明进行安装 - 包括要求部分。
netstat -nulp
并观察8125正在使用以确认statsd正在侦听。tail /opt/graphite/storage/log/carbon-cache/carbon-cache-a/listener.log
。如果不是,请尝试sudo /etc/init.d/carbon start
现在您的服务器已运行,请尝试使用 NStatsD 客户端。
时区修复:
这会将 Graphite 修复为本地区域中的时间图表
cd /opt/graphite/webapp/graphite
sudo cp local_settings.py.example local_settings.py
sudo chown www-data:www-data local_settings.py
(使用ls -l
检查权限是否正确)sudo pico local_settings.py< /code> 将 TIME_ZONE 设置为诸如
Australia/Sydney
之类的值。了解您可以在/usr/share/zoneinfo/
中使用哪些时区EC2 Notes
root在 EC2 上禁用。 Fabric 会提示输入您没有的 root 密码。使用 fab 的
-i keyfile
参数来为其提供您的 ssh 密钥文件。VirtualBox 注释
VBoxVMService 可以方便地在我的 Windows 开发环境中自动将虚拟机作为服务运行。
I have statsd+graphite running in my Windows environment using the C# client NStatsD.
Here are my notes for getting the Linux VM setup:
Note: I know enough Linux to be dangerous but am otherwise a noob and could be doing something unwittingly horrible.
Download graphite-fabric to your home folder. This is a script that will download, compile and install graphite and statsd. It expects a clean box and uses nginx for the web server.
sudo apt-get install git
git clone git://github.com/gingerlime/graphite-fabric.git
cd graphite-fabric/
Install prereq's for fabric
sudo apt-get install python-setuptools
The next steps are a download, compile and install which can take some time. It is worthwhile setting a keep alive on any putty ssh session before continuing.
Now install as per gingerlime's instructions in the README.md - including the requirements section.
netstat -nulp
and observe 8125 is in use to confirm statsd is listening.tail /opt/graphite/storage/log/carbon-cache/carbon-cache-a/listener.log
. If it isn't, trysudo /etc/init.d/carbon start
Now you have your server running, try throwing some counters at it with the NStatsD client.
Timezone fix:
This will fix graphite to graph times in your local zone
cd /opt/graphite/webapp/graphite
sudo cp local_settings.py.example local_settings.py
sudo chown www-data:www-data local_settings.py
(check withls -l
that permissions look right)sudo pico local_settings.py
Set TIME_ZONE to something likeAustralia/Sydney
. Discover what timezones you can use in/usr/share/zoneinfo/
EC2 Notes
root is disabled on EC2. Fabric prompts for a root password which you don't have. Use the
-i keyfile
argument with fab to give it your ssh keyfile instead.VirtualBox Notes
VBoxVMService was handy to automatically run the VM as a service in my Windows dev environment.
TL;DR:
全面披露:我是这两个项目的作者,我编写它们是因为我无法将 etsy 的 statsd 服务投入生产 - 我的组织还没有准备好部署和支持基于 Nodejs 的服务。
我在我的组织中也遇到了同样的问题 - 我们是一个以 Windows 为中心的环境,希望将来自世界各地的统计数据收集到单个石墨存储库中。我最初考虑使用 etsy 的 statsd,但我的公司尚未准备好在生产中使用 Nodejs 服务。一路走来,我发现拥有自己的聚合服务意味着我可以做很多有趣的事情,例如添加 memcached 对可扩展性的支持,添加新的聚合器等等。
该服务现在可以在控制台模式下使用,并将于 2013 年 5 月 29 日起投入生产使用。
TL;DR:
Full Disclosure: I'm the author of these two projects and I wrote them because I couldn't take etsy's statsd service to production - my organisation isn't ready to deploy and support nodejs-based services.
I had the same problem in my organisation - we're a windows-centric environment that wants to collect stats from all over the world into a single graphite repository. I had initially thought of using etsy's statsd but my company is not yet ready to roll with nodejs services in production. Along the way I found that having my own aggregation service meant I can do lots of interesting things like add memcached support for scalability, add new aggregators and so on.
The service is usable in console mode right now, and will be ready for production use from the 29th of May 2013 onwards.
最好的选择是拥有一个安装有 statsd 和 Graphite 的 Linux 服务器。然后,您只需编写一些 C# 代码来进行 UDP 调用,即可将指标输入系统。
[更新(2014年6月23日):我遇到了一个名为 statsd.net 这看起来很有希望,但在石墨方面很大程度上缺乏。我仍然认为最好的选择是使用实际的 statsd/Graphite 项目,因为任何克隆都需要追赶。]
Your best bet is to have a Linux server with statsd and Graphite installed. You would then just need to write some C# code to make the UDP call to get the metric into the system.
[UPDATE (6/23/2014): I came across a statsd/Graphite clone called statsd.net that looks promising but largely lacking on the Graphite side of the equation. I still think the best bet is to use the actual statsd/Graphite projects since any clone is necessary playing catch-up.]
我们在纯 .NET 中重新构建了 Graphite/StatsD。目前它正在生产环境中使用,每天处理大约 6 亿个数据点。
Statsify:
We've re-built Graphite/StatsD in pure .NET. It is currently being used in production environment, processing around 600M datapoints daily.
Statsify:
有很多可用不同语言(包括 C#.NET)的开源 StatsD 客户端实现。 Etsy 在其 github 上提供了一个 示例,另请查看 AppFirst 版本的 statsd_clients。
There is quite a few open-source StatsD client implementations available in different Language including C#.NET. Etsy provide one on their github examples, also check out AppFirst version of statsd_clients.
当前的 statsd 和 nodejs 版本允许您无需修改即可在 Windows 上运行 statsd。 statsd package.json 文件已包含用于将其作为 Windows 服务安装和卸载的脚本。
安装过程是:
cd \StatsD
npm install https://github.com/etsy/statsd.git
node_modules\statsd
目录中创建您的自己的config.json
cd node_modules\statsd
和npm run-script install-windows-service
但是,Graphite 仅运行在Linux。
Current statsd and nodejs versions allow you to run statsd on Windows without amendments. statsd package.json file already contains scripts to install and uninstall it as Windows service.
The installation procedure would be:
cd \StatsD
npm install https://github.com/etsy/statsd.git
node_modules\statsd
directory create your ownconfig.json
cd node_modules\statsd
andnpm run-script install-windows-service
However, Graphite only runs on Linux.
您需要连接到 statsd 服务器。
您还需要一个客户端库来连接到它,例如 这个 和 它的 nuget 包。
You need a statsd server to connect to.
You also need a client library to connect to it, e.g. this one and the nuget package of it.