点滴记录——使用Ganglia监控Openstack Swift状态
2014-12-31 23:27
337 查看
转载请说明出处:/article/7618613.html
在官方文档中有对StatsD来对Swift状态进行监控的描述(http://docs.openstack.org/developer/swift/admin_guide.html#reporting-metrics-to-statsd),但是网上很少有描述如何部署的文章——或许是因为开启了StatsD功能影响性能的原因吧。但是在一些性能要求不是太高,对集群稳定性要求较高的环境中,开启StatsD对运维人员和开发这是很有必要的,这样能快速知道当前集群的各项性能情况、故障情况。本文将对如何部署做简要的描述,更多的监控指标请阅读官方文档。
StatsD is a network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services (e.g., Graphite, Ganglia). ——这是StatsD的官方描述。
在Swift中其主要是通过logger模块来实现,在common/utils.py文件中有个StatsdClient类,该类主要作用是往StatsD的服务进程中发送数据,然后StatsD把数据发给Ganglia。如下图:
在开启Swift中开启StatsD客户端支持需要在配置文件中加入如下配置,
proxy-server.conf:
log_statsd_host = 127.0.0.1 #Swift的监控数据发往的地址,这里默认为本机即本机安装StatsD服务进程
log_statsd_port = 8125 #StatsD服务进程所监控的端口,默认是8125
log_statsd_default_sample_rate = 1.0
log_statsd_sample_rate_factor = 1.0
log_statsd_metric_prefix = #加入的话,该机器发送的数据名中将加入该前缀,这里默认为空
[pipeline:main]
pipeline = catch_errors healthcheck proxy-logging cache proxy-logging proxy-server ...
[filter:proxy-logging]
use = egg:swift#proxy_logging
log_statsd_valid_http_methods = GET,HEAD,POST,PUT,DELETE,COPY,OPTIONS #监控对应的http方法
account-server.conf、container-server.conf、object-server.conf:
log_statsd_host = 127.0.0.1
log_statsd_port = 8125
log_statsd_default_sample_rate = 1.0
log_statsd_sample_rate_factor = 1.0
log_statsd_metric_prefix =
在Centos 6.4中安装StatsD的相关依赖
yum install -y nodejs npm
cd /usr/lib/node_modules
git clone https://github.com/etsy/statsd.git
mv statsd-master statsd
cd /usr/lib/node_modules/statsd/backends
https://github.com/jbuchbinder/statsd-ganglia-backend.git
mv statsd-ganglia-backend-master statsd-ganglia-backend
mkdir -p /usr/lib/node_modules/statsd/backends/statsd-ganglia-backend-master/node_modules
cd /usr/lib/node_modules/statsd/backends/statsd-ganglia-backend-master/node_modules
git clone https://github.com/jbuchbinder/node-gmetric.git
mv node-gmetric-master gmetric
配置StatsD
cd /usr/lib/node_modules/statsd/
cp exampleConfig.js config.js
config.js配置如下:
{
port: 8125,
debug: false,
backends: [ "./backends/statsd-ganglia-backend" ],
flushInterval: 15000, /*ms*/ // 多长时间往gmond中发送数据,这里设为15秒
flush_counts: false,
ganglia: {
debug: false,
host: "127.0.0.1", // Ganglia gmond的IP地址,这里默认为本机
port: 8649, // gmond监听的端口
group: "swiftstats", // swift的metric在Ganglia web中展示的所在组
}
}
关于Ganglia的部署请参考:http://blog.csdn.net/cywosp/article/details/39701141
开启StatsD服务
node /usr/lib/node_modules/statsd/stats.js /usr/lib/node_modules/statsd/config.js
如果一切OK,所有访问Swift的请求都会被记录下来,过一段时间在Ganglia-Web中就能看到效果了。一下图是通过Ganglia Web集成后的图。
在官方文档中有对StatsD来对Swift状态进行监控的描述(http://docs.openstack.org/developer/swift/admin_guide.html#reporting-metrics-to-statsd),但是网上很少有描述如何部署的文章——或许是因为开启了StatsD功能影响性能的原因吧。但是在一些性能要求不是太高,对集群稳定性要求较高的环境中,开启StatsD对运维人员和开发这是很有必要的,这样能快速知道当前集群的各项性能情况、故障情况。本文将对如何部署做简要的描述,更多的监控指标请阅读官方文档。
StatsD is a network daemon that runs on the Node.js platform and listens for statistics, like counters and timers, sent over UDP or TCP and sends aggregates to one or more pluggable backend services (e.g., Graphite, Ganglia). ——这是StatsD的官方描述。
在Swift中其主要是通过logger模块来实现,在common/utils.py文件中有个StatsdClient类,该类主要作用是往StatsD的服务进程中发送数据,然后StatsD把数据发给Ganglia。如下图:
在开启Swift中开启StatsD客户端支持需要在配置文件中加入如下配置,
proxy-server.conf:
log_statsd_host = 127.0.0.1 #Swift的监控数据发往的地址,这里默认为本机即本机安装StatsD服务进程
log_statsd_port = 8125 #StatsD服务进程所监控的端口,默认是8125
log_statsd_default_sample_rate = 1.0
log_statsd_sample_rate_factor = 1.0
log_statsd_metric_prefix = #加入的话,该机器发送的数据名中将加入该前缀,这里默认为空
[pipeline:main]
pipeline = catch_errors healthcheck proxy-logging cache proxy-logging proxy-server ...
[filter:proxy-logging]
use = egg:swift#proxy_logging
log_statsd_valid_http_methods = GET,HEAD,POST,PUT,DELETE,COPY,OPTIONS #监控对应的http方法
account-server.conf、container-server.conf、object-server.conf:
log_statsd_host = 127.0.0.1
log_statsd_port = 8125
log_statsd_default_sample_rate = 1.0
log_statsd_sample_rate_factor = 1.0
log_statsd_metric_prefix =
在Centos 6.4中安装StatsD的相关依赖
yum install -y nodejs npm
cd /usr/lib/node_modules
git clone https://github.com/etsy/statsd.git
mv statsd-master statsd
cd /usr/lib/node_modules/statsd/backends
https://github.com/jbuchbinder/statsd-ganglia-backend.git
mv statsd-ganglia-backend-master statsd-ganglia-backend
mkdir -p /usr/lib/node_modules/statsd/backends/statsd-ganglia-backend-master/node_modules
cd /usr/lib/node_modules/statsd/backends/statsd-ganglia-backend-master/node_modules
git clone https://github.com/jbuchbinder/node-gmetric.git
mv node-gmetric-master gmetric
配置StatsD
cd /usr/lib/node_modules/statsd/
cp exampleConfig.js config.js
config.js配置如下:
{
port: 8125,
debug: false,
backends: [ "./backends/statsd-ganglia-backend" ],
flushInterval: 15000, /*ms*/ // 多长时间往gmond中发送数据,这里设为15秒
flush_counts: false,
ganglia: {
debug: false,
host: "127.0.0.1", // Ganglia gmond的IP地址,这里默认为本机
port: 8649, // gmond监听的端口
group: "swiftstats", // swift的metric在Ganglia web中展示的所在组
}
}
关于Ganglia的部署请参考:http://blog.csdn.net/cywosp/article/details/39701141
开启StatsD服务
node /usr/lib/node_modules/statsd/stats.js /usr/lib/node_modules/statsd/config.js
如果一切OK,所有访问Swift的请求都会被记录下来,过一段时间在Ganglia-Web中就能看到效果了。一下图是通过Ganglia Web集成后的图。
相关文章推荐
- 点滴记录——CentOS 6.4中使用virtualenv安装swift
- 使用Ganglia监控服务器运行状态
- [SCM] CVS 使用点滴记录
- 使用smartmontools监控磁盘的健康状态
- openstack swift各类 HTTP 返回状态代码详解
- 使用 lookAt()时注意记录原始状态originalM=Mtrix3D.clone(3d.transform)
- 使用python+cron对php状态进行定时监控
- 使用nagios监控nginx服务器的存活状态及负载
- 使用 monitor command 监控 QEMU 运行状态
- 如何使用Powershell脚本监控Exchange2010(一) 数据库Mount状态的监控
- 如何使用Powershell脚本监控Exchange2010(一) 数据库Mount状态的监控
- 使用ganglia监控hadoop
- MSFlexGrid控件使用点滴记录
- 使用Ganglia对hadoop进行监控
- [记录点滴]sqlcmd命令使用
- 4007.使用Cacti监控思科GSR 12000系列路由器的风扇电源状态
- 使用swatch实时监控cisco路由器和H3C交换机端口状态
- 用ganglia监控服务器状态
- smartctl使用smartmontools监控磁盘的健康状态
- smartctl 使用smartmontools监控磁盘的健康状态