Ceilometr: 4、Liberty版本的Ceilometer相关配置文件
来源:互联网 发布:淘宝怎么货到付款手机 编辑:程序博客网 时间:2024/05/29 04:16
Liberity版本的Ceilometer相关配置文件分析
1 概览:
在Liberity版本环境下,/etc/ceilometer目录下包含以下文件:ceilometer.conf,pipeline.yaml,meters.yaml,gnocchi_resources.yaml,event_pipeline.yaml,event_definitions.yaml,mapping.json,api_paste.ini,policy.json
2 ceilometer.conf文件
作用:
内容:
ceilometer主要的配置项包含:
[DEFAULT],[action_resources],[alarm],[api],[central],
[collector],[compute],[coordination],[database],[dispatcher_file],
[dispatcher_gnocchi],[email],[event],[exchange_control],[hardware],
[ipmi],[keystone_authtoken],[matchmaker_redis],[matchmaker_ring],[meter],
[notification],[oslo_concurrency],[oslo_messaging_amqp],[oslo_messaging_qpid],[oslo_messaging_rabbit],
[oslo_policy],[polling],[publisher],[publisher_notifier],[publisher_rpc],
[rgw_admin_credentials],[service_credentials],[service_types],[sms],[vmware],
[xenapi]
具体例子:
重要配置部分:
2 pipeline.yaml文件
补充:pipeline.yaml解析看这篇文章:http://www.cnblogs.com/sammyliu/p/4383289.html
作用:
内容:
Pipeline.yaml:包含sources源,sinks目标
源中定义了:1测量的数据,2采样频率,3哪些端点进行数据采样,4数据的目标
目标定义了:1数据处理转换器,2通过哪些发布者发布
具体例子:
sources: #产生采样值sample的来源,包含多个采样值的来源
- name: notification_source # 采样值来源的名称:通知_来源
interval: 3600 # 采样的时间间隔,3600秒,即1小时
meters: #计量项,即监控的项目,包含:实例,卷,镜像,快照,备份,浮动ip,路由器,网络,子网,账户
- "instance"
- "volume"
- "image"
- "snapshot"
- "backup"
- "ip.floating"
- "router"
- "network"
- "subnet"
- "account"
sinks: #一个sink是对采样值的处理链(包含多个吹方法)
- notification_sink # 通知_槽
sinks: #sinks是对采样值的处理链,包含多个处理方法。是针对上述不同采样值来源的处理方法
- name: notification_sink # 处理链的名称
transformers: #采样值的转换器,常用的有:unit_conversion(单位转换器),rate_of_change(计算方式转换器),accumulator(累计器)
publishers: #经过转换处理好之后,需要将结果发送出去。
- notifier:// # 通知人://默认使用AMQP的oslo.messaging发出数据
- name: meter_sink #计量项,处理来自计量项的采样值
transformers: #采样值转换器无需转换
publishers: #发布器:默认用oslo.messaging发出数据
- notifier://
- name: cpu_sink #cpu_处理
transformers: #转换器,采用计算方式转换器,按照一定规则计算采样值
- name: "rate_of_change"
parameters:
name: "cpu_util"
unit: "%"
type: "gauge"
scale: "100.0 / (10**9* (resource_metadata.cpu_number or 1))"
publishers: #发布器,需要调整?,重要
- notifier://
- name: cpu_delta_sink #cpu增量处理
transformers: #转换器
- name: "delta" #转换器名称是:delta,参数是:目标名为cpu增量,仅仅增长
parameters:
target:
name: "cpu.delta"
growth_only: True # 不懂?
publishers: #发布器默认用oslo的消息发送
- notifier://
重要配置部分:?
3event_pipeline.yaml文件
作用:
内容:包含源(sources)和目标(sinks)
具体例子:
sources: # 源的列表
- name: event_source # 源的名字:事件源
events: # 计量的事件:包含?
- "*"
- "!magnum.bay.metrics.update"
sinks: # 目标:事件目标
- event_sink
sinks: # 目标的列表
- name: event_sink # 目标的名称:事件目标
transformers: #转换器
triggers: # 触发器?不懂
publishers: # 发布器:采用默认的oslo.messaging将数据发送给collector
- notifier://
重要配置部分:
4 event_definitions.yaml文件
作用:
内容:主要是包含事件类型:1计算节点实例暂停,关机,创建,删除等;2卷volume:创建,删除,调整大小等;3镜像创建,删除等;4网络,快照等
对于事件类型列表,以计算节点实例相关事件为例,包含:租户id,用户id,实例id,主机(字段,插件),服务,内存,磁盘,根目录大小,临时区域大小,cpu个数,实例类型id,实例模板id,状态,架构,版本,创建/删除时间,资源名称,资源id.
具体例子:
- event_type: ['compute.instance.pause.*','compute.instance.unpause.*', 'compute.instance.power_off.*','compute.instance.power_on.*',
'compute.instance.suspend.*','compute.instance.resume.*', 'compute.instance.create.*','compute.instance.delete.*',
'compute.instance.rebuild.*','compute.instance.shutdown.*', 'compute.instance.reboot.*','compute.instance.resize.*',
'compute.instance.migrate.*']
traits: &instance_traits #事件特性:包含租户id,用户id,实例id,主机(字段,插件),服务,内存,磁盘,根目录大小,临时区域大小,cpu个数,实例类型id,实例模板id,状态,架构,版本,创建/删除时间,资源名称,资源id.
tenant_id:
fields: payload.tenant_id
user_id:
fields: payload.user_id
instance_id:
fields: payload.instance_id
host:
fields: publisher_id
plugin:
name: split
parameters:
segment: 1
max_split: 1
service:
fields: publisher_id
plugin: split
memory_mb:
type: int
fields: payload.memory_mb
disk_gb:
type: int
fields: payload.disk_gb
root_gb:
type: int
fields: payload.root_gb
ephemeral_gb:
type: int
fields: payload.ephemeral_gb
vcpus:
type: int
fields: payload.vcpus
instance_type_id:
type: int
fields: payload.instance_type_id
instance_flavor_id:
fields: payload.instance_flavor_id
instance_type:
fields: payload.instance_type
state:
fields: payload.state
os_architecture:
fields:payload.image_meta.'org.openstack__1__architecture'
os_version:
fields:payload.image_meta.'org.openstack__1__os_version'
os_distro:
fields:payload.image_meta.'org.openstack__1__os_distro'
launched_at:
type: datetime
fields: payload.launched_at
created_at:
type: datetime
fields: payload.created_at
deleted_at:
type: datetime
fields: payload.deleted_at
resource_name:
fields: payload.display_name
resource_id:
fields: payload.instance_id
重要配置部分:
5 meters.yaml文件
作用:
内容:包含了许多计量项,每个计量项包含:计量项名称,事件类型,计量类型,单位,卷,资源id,项目id等信息
具体例子:
metric: # 所有的计量项
# Image
- name: "image.size" #计量项名称:镜像大小
event_type: # 事件类型
- "image.upload" #镜像上传
- "image.delete" #镜像删除
- "image.update" #镜像更新
type: "gauge" #计量类型:离散的
unit: B #计量单位:字节
volume: $.payload.size # 卷?有效载荷大小
resource_id: $.payload.id # 资源id:有效载荷的id
project_id: $.payload.owner # 项目id:有效载荷的拥有者?
- name: "image.download" # 镜像下载
event_type: "image.send" # 事件类型:镜像发送
type: "delta" # 计量类型:增量
unit: "B" # 计量单位:字节
volume: $.payload.bytes_sent # 卷:有效载荷发送的字节
resource_id: $.payload.image_id #资源id:有效载荷的镜像id ?
user_id: $.payload.receiver_user_id # 用户id:有效载荷的接受这用户id
project_id: $.payload.receiver_tenant_id #项目id:有效载荷的接受者租户的id
- name: "image.serve" #计量项名称: 镜像服务
event_type: "image.send" #计量的事件类型:镜像发送
type: "delta" #计量类型:增量
unit: "B" #计量单位:字节
volume: $.payload.bytes_sent # 卷:有效载荷的发送字节数
resource_id: $.payload.image_id # 卷:资源id ,有效载荷的镜像id
project_id: $.payload.owner_id # 项目id:有效载荷的拥有者id
# MagnetoDB
- name: 'magnetodb.table.index.count'
type: 'gauge'
unit: 'index'
…..
重要配置部分:
6 gnocchi_resources.yaml文件
作用:
内容:一个资源对应多个计量(监控)项目。所谓资源实际就是被监控的资源对象。
资源主要包括:identity,instance,image,impi,network,stack,volume,swift_account等
具体例子:
resources:
- resource_type: identity #资源类型:身份
archive_policy: low # 归档策略:低度
metrics: # 监控项:包含身份中的: 验证成功,验证失败,用户创建,组创建,项目创建等
- 'identity.authenticate.success'
- 'identity.authenticate.pending'
- 'identity.authenticate.failure'
- 'identity.user.created'
- 'identity.user.deleted'
- 'identity.user.updated'
- 'identity.group.created'
- 'identity.group.deleted'
- 'identity.group.updated'
- 'identity.role.created'
- 'identity.role.deleted'
- 'identity.role.updated'
- 'identity.project.created'
- 'identity.project.deleted'
- 'identity.project.updated'
- 'identity.trust.created'
- 'identity.trust.deleted'
- 'identity.role_assignment.created'
- 'identity.role_assignment.deleted'
- resource_type: instance # 资源类型:实例
metrics: # 计量列表:实例,内存,内存使用,cpu使用率,cpu增量,磁盘读写字节数/请求次数等
- 'instance'
- 'memory'
- 'memory.usage'
- 'memory.resident'
- 'vcpus'
- 'cpu'
- 'cpu.delta'
- 'cpu_util'
- 'disk.root.size'
- 'disk.ephemeral.size'
- 'disk.read.requests'
- 'disk.read.requests.rate'
- 'disk.write.requests'
- 'disk.write.requests.rate'
- 'disk.read.bytes'
- 'disk.read.bytes.rate'
- 'disk.write.bytes'
- 'disk.write.bytes.rate'
- 'disk.latency'
- 'disk.iops'
- 'disk.capacity'
- 'disk.allocation'
- 'disk.usage'
attributes: #属性
host: resource_metadata.host
image_ref:resource_metadata.image_ref_url
display_name:resource_metadata.display_name
flavor_id:resource_metadata.(instance_flavor_id|(flavor.id))
server_group:resource_metadata.user_metadata.server_group
重要配置部分:
7 mapping.json 文件
作用:
内容:定义了1分钟,5分钟,1小时每次周期性执行下的监控计量类型列表。
具体例子:
{
"60":{ # 60秒监控的计量类型:包含1磁盘读写字节数,2网络进入/流出字节数,3volume的卷读写字节速率,4 cpu使用率,cpu增量,5内存使用率
"meter_type":[
"disk.read.bytes.rate",
"disk.write.bytes.rate",
"disk.read.requests.rate",
"disk.write.requests.rate",
"disk.device.read.bytes.rate",
"disk.device.write.bytes.rate",
"disk.device.read.requests.rate",
"disk.device.write.requests.rate",
"network.incoming.bytes.rate",
"network.outgoing.bytes.rate",
"network.incoming.packets.rate",
"network.outgoing.packets.rate",
"volume.read.bytes.rate",
"volume.write.bytes.rate",
"cpu_util",
"cpu.delta",
"memory.usage"
],
"mult_topology":[ # 多拓扑? 不懂
1,
5,
15,
120,
1440
],
"point_topology":[ # 点拓扑? 不懂
100,
300,
100,
100,
200
]
},
"300":{ # 每5分钟计量的暂时没有
},
重要配置部分:
8 policy.json文件
作用:用于限制用户action的.参见:http://blog.csdn.net/hackerain/article/details/8241691
内容:用来控制某一个User在某个Tenant中的权限的。这个User能执行什么操作,不能执行什么操作,就是通过policy机制来实现的。直观的看,policy就是一个json文件,位于/etc/[SERVICE_CODENAME]/policy.json中,每一个服务都有一个对应的policy.json文件,通过配置这个文件,实现了对User的权限管理。
包含上下文是角色是否为admin,上下文项目id,上下文拥有者的用户id,隔离,默认等。
具体例子:
{
"context_is_admin": "role:admin",
"context_is_project":"project_id:%(target.project_id)s",
"context_is_owner":"user_id:%(target.user_id)s",
"segregation":"rule:context_is_admin",
"default": ""
}
重要配置部分:
9 api_paste.ini 文件
作用:
内容:#Ceilometer的APIweb服务器网关接口的管道线,定义了过滤器,使得组成pipeline来处理wsgi请求
注意:这个管道是PasteDeploy的管道和Ceilometerpipeline不同,用于处理采样值
补充:PasteDeployment是一种机制,在WSGI应用和Server之间提供桥梁,为用户提供接口
参考:http://blog.csdn.net/gaoxingnengjisuan/article/details/20162981
具体例子:
# Ceilometer API WSGI Pipeline
# Define the filters that make up the pipelinefor processing WSGI requests
# Note: This pipeline is PasteDeploy's termrather than Ceilometer's pipeline
# used for processing samples
# Remove authtoken from the pipeline if youdon't want to use keystone authentication
# 管道中的主函数:请求id验证api服务器?不懂。使用多个filter需要使用管道流水线方式
[pipeline:main]
pipeline = request_id authtoken api-server
# 应用:接口服务器
[app:api-server]
paste.app_factory =ceilometer.api.app:app_factory
# 过滤验证灵牌
[filter:authtoken]
paste.filter_factory =keystonemiddleware.auth_token:filter_factory
#定义过滤器,接受一个Application参数作为对象,返回封装后的应用。对消息中间件的请求id过滤
[filter:request_id]
paste.filter_factory =oslo_middleware:RequestId.factory
重要配置部分:
- Ceilometr: 4、Liberty版本的Ceilometer相关配置文件
- Ceilometr: 3、Liberty版本的Ceilometer表结构介绍
- Ceilometr: 6、Ceilometer在Openstack上的安装
- Ceilometr: 1 、Ceilometer技术介绍
- Ceilometr: 9、Gnocchi对接Ceilometer
- Ceilometr: 5、Ceilometer安装和启动
- Ceilometr: 10、 Ceilometer-Alarm常用命令行
- Ceilometr: 8、Devstack下修改ceilometer的pipeline.yaml文件中采样频率和publisher的方法
- Ceilometer 相关命令集合
- OpenStack Liberty版本对容器支持的详解
- 从 Liberty 到 Ocata 的 OpenStack 版本升级之旅
- OpenStack Liberty版本network troubleshooting
- Liberty版本Neutron LBaas学习
- Ceilometer的知识总结
- ceilometer的map_reduce机制
- OpenStack Liberty版本里如何配置基于haproxy的负载均衡服务(LBaaS)
- Openstack : 6、Centos7下搭建带有Ceilometer的devstack(mitaka版本)
- OpenStack Liberty(第12个版本)
- tensorflow40《TensorFlow实战》笔记-08-01 TensorFlow实现深度强化学习-策略网络 code
- tensorflow41《TensorFlow实战》笔记-08-02 TensorFlow实现深度强化学习-估值网络 code
- SlidingMenu侧滑简单实现
- 【leetcode】删除数组中指定要求的重复的数字
- [USACO]最短网络
- Ceilometr: 4、Liberty版本的Ceilometer相关配置文件
- JavaScript变量——栈内存or堆内存
- 二叉树的路径和
- 关于汉化版adobe after effects cs6 中:“afterEffects警告:未知工作区”和“浮动窗口恢复”的讲解
- Android--ContentProvider小demo
- C++数组指针和指针数组
- 【洛谷】3381 【模板】最小费用最大流
- ZOJ-3953 Intervals,t
- 初始封装