<commit_before>% OpenStack Ceilometer Havana API V2
%
%

| Copyright (c) 2014, Huawei Technologies Co., Ltd
|
| 	Licensed under the Apache License, Version 2.0 (the "License");
| 	you may not use this file except in compliance with the License.
| 	You may obtain a copy of the License at
|
| 	http://www.apache.org/licenses/LICENSE-2.0
|
| 	Unless required by applicable law or agreed to in writing, software
| 	distributed under the License is distributed on an "AS IS" BASIS,
| 	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
| 	implied.
| 	See the License for the specific language governing permissions and
| 	limitations under the License.
|
| Author: <NAME> <<EMAIL>>

This document summarizes configuration reference for Ceilometer Havana. You can read /etc/ceilometer/ceilometer.conf to get direct help information, and set non-default options by learning example from [openstack-manuals install guide](http://docs.openstack.org/trunk/install-guide/install/apt/content/ceilometer-install.html)

# 运维视角（Operator Perspective）
## 必选选项（Required）
以下选项若不设置，服务将无法正常运行，或者虽能运行但功能的正确性无法保障。

### ceilometer
你需要在ceilometer.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| connection | database | StrOpt | sqlite:////ceilometer/openstack/common/db/$sqlite_db | 数据库连接地址，例如connection = mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer
| rabbit_host | DEFAULT | StrOpt | localhost | AMQP服务主机名或ip地址，多节点下需设置
| auth_host | keystone_authtoken | StrOpt | 127.0.0.1 | Keystone服务所在节点主机名或ip地址
| admin_user | keystone_authtoken | StrOpt | N/A | ceilometer用户名称，推荐设置为ceilometer（也可为admin但不推荐）
| admin_password | keystone_authtoken | StrOpt | N/A | ceilometer用户密码
| admin_tenant_name | keystone_authtoken | StrOpt | admin | ceilometer项目名称，推荐设置为service（也可为admin但不推荐）
| os_username | service_credentials | StrOpt | ceilometer | ceilometer用户名称，推荐设置为ceilometer
| os_password | service_credentials | StrOpt | admin | ceilometer用户密码
| os_tenant_name | service_credentials | StrOpt | service | ceilometer项目名称，推荐设置为service

### nova
你需要在nova.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| instance_usage_audit | DEFAULT | BoolOpt | false | Generate periodic compute.instance.exists notifications，推荐设置为true
| instance_usage_audit_period | DEFAULT | StrOpt | month | time period to generate instance usages for.  Time period must be hour, day, month or year，推荐设置为hour
| notify_on_state_change | DEFAULT | StrOpt | N/A | If set, send compute.instance.update notifications on instance state changes.  Valid values are None for no notifications, "vm_state" for notifications on VM state changes, or "vm_and_task_state" for notifications on VM and task state changes. 推荐设置为vm_and_task_state
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐分别设置为nova.openstack.common.notifier.rpc_notifier和ceilometer.compute.nova_notifier

### glance
你需要在glance-api.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐设置为messaging
| rpc_backend | DEFAULT | StrOpt | glance.openstack.common.rpc.impl_kombu | The messaging module to use, defaults to kombu.推荐设置为rabbit

### cinder
你需要在cinder.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| control_exchange | DEFAULT | StrOpt | openstack | AMQP exchange to connect to if using RabbitMQ or Qpid，推荐设置为cinder
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐设置为cinder.openstack.common.notifier.rpc_notifier

### swift
swift与其他OpenStack核心项目不同，你需要在proxy-server.conf中设置
```
[filter:ceilometer]
use = egg:ceilometer#swift
[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth ceilometer proxy-server
```

## 推荐选项（Recommended）
以下选项可以不设置，但性能及安全性将受到影响

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| metering_secret | publisher_rpc | StrOpt | change this or be hacked | 对监测消息签名的密钥，默认值就是最好的提示，compute节点上此项配置必须和control节点上一致
| auth_protocol | keystone_authtoken | StrOpt | https | 采用默认值即可。配置成https能提高安全性
| debug | DEFAULT | BoolOpt | False | 采用默认值即可。打印DEBUG级别的日志，为true时会降低性能，仅在调测时打开。
| verbose | DEFAULT | BoolOpt | False | 采用默认值即可。打印详细日志，为true时会降低性能，仅在调测时打开。

## 优化选项（Optimized）
以下选项若正确设置，能让你的工作更轻松愉快

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| log_dir | DEFAULT | StrOpt | N/A | 有的时候有的发布版的服务启动脚本没有添加这个选项导致日志都不见了，在配置文件中加上这个能保证总是有
| auth_uri | keystone_authtoken | StrOpt | N/A | 配置成形如https://controller:5000，能减少keystone报警

# 服务视角（Service Perspective）
## ceilometer
### ceilometer.alarm
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| rest_notifier_certificate_file | alarm | StrOpt | N/A | SSL Client certificate for REST notifier
| rest_notifier_certificate_key | alarm | StrOpt | N/A | SSL Client private key for REST notifier
| rest_notifier_ssl_verify | alarm | BoolOpt | true | Verify the SSL Server certificate when calling alarm action
| notifier_rpc_topic | alarm | StrOpt | alarm_notifier | the topic ceilometer uses for alarm notifier messages
| partition_rpc_topic | alarm | StrOpt | alarm_partition_coordination | the topic ceilometer uses for alarm partition coordination messages
| evaluation_interval | alarm | IntOpt | 60 | Period of evaluation cycle, should be >= than configured pipeline interval for collection of underlying metrics.
| evaluation_service | alarm | StrOpt | ceilometer.alarm.service.SingletonAlarmService | Class to launch as alarm evaluation service

### ceilometer.api
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| auth_strategy | DEFAULT | StrOpt | keystone | noauth or keystone
| enable_v1_api | DEFAULT | BoolOpt | true | enable API V1
| record_history | alarm | BoolOpt | true | Record alarm change events
| port | api | IntOpt | 8777 | The port for the ceilometer API server
| host | api | StrOpt | 0.0.0.0 | The listen IP for the ceilometer API server

### ceilometer.collector
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| file_path | dispatcher_file | StrOpt | N/A | Name and the location of the file to record meters.
| max_bytes | dispatcher_file | IntOpt | 0 | The max size of the file
| backup_count | dispatcher_file | IntOpt | 0 | The max number of the files to keep
| udp_address | collector | StrOpt | 0.0.0.0 | address to bind the UDP socket to disabled if set to an empty string
| udp_port | collector | IntOpt | 4952 | port to bind the UDP socket to
| ack_on_event_error | collector | BoolOpt | true | Acknowledge message when event persistence fails
| store_events | collector | BoolOpt | false | Save event details
| dispatcher | collector | MultiStrOpt | database | dispatcher to process metering data
| glance_control_exchange | DEFAULT | StrOpt | glance | Exchange name for Glance notifications
| http_control_exchanges | DEFAULT | MultiStrOpt | [nova, glance, neutron, cinder] | Exchanges name to listen for notifications 
| neutron_control_exchange | DEFAULT | StrOpt | neutron | Exchange name for Neutron notifications
| reseller_prefix | DEFAULT | StrOpt | AUTH_ | Swift reseller prefix. Must be on par with reseller_prefix in proxy-server.conf.
| cinder_control_exchange | DEFAULT | StrOpt | cinder | Exchange name for Cinder notifications

### ceilometer.compute
| Option | Section | Type | Default | Description |<commit_msg>add chinese simplified<commit_after>% OpenStack Ceilometer Havana API V2
%
%

| Copyright (c) 2014, Huawei Technologies Co., Ltd
|
| 	Licensed under the Apache License, Version 2.0 (the "License");
| 	you may not use this file except in compliance with the License.
| 	You may obtain a copy of the License at
|
| 	http://www.apache.org/licenses/LICENSE-2.0
|
| 	Unless required by applicable law or agreed to in writing, software
| 	distributed under the License is distributed on an "AS IS" BASIS,
| 	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
| 	implied.
| 	See the License for the specific language governing permissions and
| 	limitations under the License.
|
| Author: <NAME> <<EMAIL>>

This document summarizes configuration reference for Ceilometer Havana. You can read /etc/ceilometer/ceilometer.conf to get direct help information, and set non-default options by learning example from [openstack-manuals install guide](http://docs.openstack.org/trunk/install-guide/install/apt/content/ceilometer-install.html)

# 运维视角（Operator Perspective）
## 必选选项（Required）
以下选项若不设置，服务将无法正常运行，或者虽能运行但功能的正确性无法保障。

### ceilometer
你需要在ceilometer.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| connection | database | StrOpt | sqlite:////ceilometer/openstack/common/db/$sqlite_db | 数据库连接地址，例如connection = mongodb://ceilometer:CEILOMETER_DBPASS@controller:27017/ceilometer
| rabbit_host | DEFAULT | StrOpt | localhost | AMQP服务主机名或ip地址，多节点下需设置
| auth_host | keystone_authtoken | StrOpt | 127.0.0.1 | Keystone服务所在节点主机名或ip地址
| admin_user | keystone_authtoken | StrOpt | N/A | ceilometer用户名称，推荐设置为ceilometer（也可为admin但不推荐）
| admin_password | keystone_authtoken | StrOpt | N/A | ceilometer用户密码
| admin_tenant_name | keystone_authtoken | StrOpt | admin | ceilometer项目名称，推荐设置为service（也可为admin但不推荐）
| os_username | service_credentials | StrOpt | ceilometer | ceilometer用户名称，推荐设置为ceilometer
| os_password | service_credentials | StrOpt | admin | ceilometer用户密码
| os_tenant_name | service_credentials | StrOpt | service | ceilometer项目名称，推荐设置为service

### nova
你需要在nova.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| instance_usage_audit | DEFAULT | BoolOpt | false | Generate periodic compute.instance.exists notifications，推荐设置为true
| instance_usage_audit_period | DEFAULT | StrOpt | month | time period to generate instance usages for.  Time period must be hour, day, month or year，推荐设置为hour
| notify_on_state_change | DEFAULT | StrOpt | N/A | If set, send compute.instance.update notifications on instance state changes.  Valid values are None for no notifications, "vm_state" for notifications on VM state changes, or "vm_and_task_state" for notifications on VM and task state changes. 推荐设置为vm_and_task_state
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐分别设置为nova.openstack.common.notifier.rpc_notifier和ceilometer.compute.nova_notifier

### glance
你需要在glance-api.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐设置为messaging
| rpc_backend | DEFAULT | StrOpt | glance.openstack.common.rpc.impl_kombu | The messaging module to use, defaults to kombu.推荐设置为rabbit

### cinder
你需要在cinder.conf中进行下列选项的设置

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| control_exchange | DEFAULT | StrOpt | openstack | AMQP exchange to connect to if using RabbitMQ or Qpid，推荐设置为cinder
| notification_driver | DEFAULT | MultiStrOpt | N/A | Driver or drivers to handle sending notifications，推荐设置为cinder.openstack.common.notifier.rpc_notifier

### swift
swift与其他OpenStack核心项目不同，你需要在proxy-server.conf中设置
```
[filter:ceilometer]
use = egg:ceilometer#swift
[pipeline:main]
pipeline = healthcheck cache authtoken keystoneauth ceilometer proxy-server
```

## 推荐选项（Recommended）
以下选项可以不设置，但性能及安全性将受到影响

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| metering_secret | publisher_rpc | StrOpt | change this or be hacked | 对监测消息签名的密钥，默认值就是最好的提示，compute节点上此项配置必须和control节点上一致
| auth_protocol | keystone_authtoken | StrOpt | https | 采用默认值即可。配置成https能提高安全性
| debug | DEFAULT | BoolOpt | False | 采用默认值即可。打印DEBUG级别的日志，为true时会降低性能，仅在调测时打开。
| verbose | DEFAULT | BoolOpt | False | 采用默认值即可。打印详细日志，为true时会降低性能，仅在调测时打开。

## 优化选项（Optimized）
以下选项若正确设置，能让你的工作更轻松愉快

| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| log_dir | DEFAULT | StrOpt | N/A | 有的时候有的发布版的服务启动脚本没有添加这个选项导致日志都不见了，在配置文件中加上这个能保证总是有
| auth_uri | keystone_authtoken | StrOpt | N/A | 配置成形如https://controller:5000，能减少keystone报警

# 服务视角（Service Perspective）
## ceilometer
### ceilometer.alarm
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| rest_notifier_certificate_file | alarm | StrOpt | N/A | SSL Client certificate for REST notifier
| rest_notifier_certificate_key | alarm | StrOpt | N/A | SSL Client private key for REST notifier
| rest_notifier_ssl_verify | alarm | BoolOpt | true | Verify the SSL Server certificate when calling alarm action
| notifier_rpc_topic | alarm | StrOpt | alarm_notifier | the topic ceilometer uses for alarm notifier messages
| partition_rpc_topic | alarm | StrOpt | alarm_partition_coordination | the topic ceilometer uses for alarm partition coordination messages
| evaluation_interval | alarm | IntOpt | 60 | Period of evaluation cycle, should be >= than configured pipeline interval for collection of underlying metrics.
| evaluation_service | alarm | StrOpt | ceilometer.alarm.service.SingletonAlarmService | Class to launch as alarm evaluation service

### ceilometer.api
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| auth_strategy | DEFAULT | StrOpt | keystone | noauth or keystone. 身份验证策略，只能为noauth或者keystone。
| enable_v1_api | DEFAULT | BoolOpt | true | enable API V1
| record_history | alarm | BoolOpt | true | Record alarm change events
| port | api | IntOpt | 8777 | The port for the ceilometer API server
| host | api | StrOpt | 0.0.0.0 | The listen IP for the ceilometer API server

### ceilometer.collector
| Option | Section | Type | Default | Description |
|:-------|:--------|:-----|:--------|:------------|
| file_path | dispatcher_file | StrOpt | N/A | Name and the location of the file to record meters.
| max_bytes | dispatcher_file | IntOpt | 0 | The max size of the file
| backup_count | dispatcher_file | IntOpt | 0 | The max number of the files to keep
| udp_address | collector | StrOpt | 0.0.0.0 | address to bind the UDP socket to disabled if set to an empty string
| udp_port | collector | IntOpt | 4952 | port to bind the UDP socket to
| ack_on_event_error | collector | BoolOpt | true | Acknowledge message when event persistence fails
| store_events | collector | BoolOpt | false | Save event details
| dispatcher | collector | MultiStrOpt | database | dispatcher to process metering data
| glance_control_exchange | DEFAULT | StrOpt | glance | Exchange name for Glance notifications
| http_control_exchanges | DEFAULT | MultiStrOpt | [nova, glance, neutron, cinder] | Exchanges name to listen for notifications 
| neutron_control_exchange | DEFAULT | StrOpt | neutron | Exchange name for Neutron notifications
| reseller_prefix | DEFAULT | StrOpt | AUTH_ | Swift reseller prefix. Must be on par with reseller_prefix in proxy-server.conf.
| cinder_control_exchange | DEFAULT | StrOpt | cinder | Exchange name for Cinder notifications

### ceilometer.compute
| Option | Section | Type | Default | Description |
{'fraction_non_alphanumeric': 0.1331168831168831, 'fraction_numerical': 0.005856888209829387, 'mean_word_length': 4.085464551634833, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5893187', 'n_tokens_mistral': 5357, 'n_tokens_neox': 5429, 'n_words': 1389}