Ceilometer + Gnocchi + Aodh

이 곳 은 주로 Gnocchi 의 설치 및 설정 을 설명 하 며, 기타 Module 의 설 치 는 참고 할 수 있 습 니 다. http://docs.openstack.org/mitaka/install-guide-rdo/
 
배치 환경
    시스템 버 전: CentOS 7 
    오픈 스 택 버 전: 미 타 카
1. Gnocchi 데이터베이스 만 들 기
1 CREATE DATABASE gnocchi;
2 GRANT ALL PRIVILEGES ON gnocchi.* TO '$USERNAME'@'localhost' IDENTIFIED BY '$PASSOWRD';
3 GRANT ALL PRIVILEGES ON gnocchi.* TO '$USERNAME'@'%' IDENTIFIED BY '$PASSOWRD';

 
2. 제어 노드 설치 Gnocchi
1 sudo yum install openstack-gnocchi-api openstack-gnocchi-metricd openstack-gnocchi-statsd

 
3. Username 및 Service 만 들 기
1 openstack user create --domain default --password-prompt gnocchi
2 openstack role add --project service --user gnocchi admin
3  
4 openstack service create --name gnocchi --description "OpenStack Metric"  metric
5 openstack endpoint create --region RegionOne metric public http://$CONTROLLER_IP:8041
6 openstack endpoint create --region RegionOne metric admin http://$CONTROLLER_IP:8041
7 openstack endpoint create --region RegionOne metric internal http://$CONTROLLER_IP:8041

 
4. Gnocchi 설정
 1 vim /etc/gnocchi/gnocchi.conf
 2  
 3 [database]
 4 backend = sqlalchemy    #    index      
 5  
 6  
 7 [indexer]
 8 url = mysql+pymysql://$USERNAME:$PASSWORD@$CONTROLLER_ip/gnocchi
 9  
10  
11 [keystone_authtoken]    #  gnocchi       
12 auth_uri = http://$CONTROLLER_IP:5000/v3
13 identity_uri = http://$CONTROLLER_IP:35357/
14 admin_user = $USERNAME
15 admin_password = $PASSWORD
16 admin_tenant_name = service
17 signing_dir = /var/cache/gnocchi
18  
19  
20 [statsd]               #  gnocchi       (  Gnocchi     ),Gnocchi       
21 resource_id = 
22 user_id =
23 project_id =
24 archive_policy_name = low
25  
26  
27 [storage]              #  storage   driver,   file
28 coordination_url = file:///var/lib/gnocchi/locks
29 driver = file
30 file_basepath = /var/lib/gnocchi
31  
32 ---------------------------------------------------------------------------------------------------
33 vim /etc/gnocchi/api-paste.ini
34  
35 [pipeline:main]        #    ,      policy.conf  admin   
36 pipeline = gnocchi+auth
37 
38 #  gnocchi       
39 mkdir /var/cache/gnocchi  && chown gnocchi:gnocchi -R  /var/cache/gnocchi
40 mkdir /var/lib/gnocchi  && chown gnocchi:gnocchi -R  /var/lib/gnocchi

 
 
5. Gnocchi 서비스의 데이터베이스 초기 화
1 gnocchi-upgrade

 
6. Gnocchi 서비스 시작
1 systemctl enable openstack-gnocchi-api.service openstack-gnocchi-metricd.service openstack-gnocchi-statsd.service
2   
3 systemctl start openstack-gnocchi-api.service openstack-gnocchi-metricd.service openstack-gnocchi-statsd.service
4 #Mitaka         ,      archive-policy  https://review.openstack.org/#/c/290626/
5 gnocchi archive-policy create -d granularity:5m,points:12 -d granularity:1h,points:24 -d granularity:1d,points:30 low
6 gnocchi archive-policy create -d granularity:60s,points:60 -d granularity:1h,points:168 -d granularity:1d,points:365 medium
7 gnocchi archive-policy create -d granularity:1s,points:86400 -d granularity:1m,points:43200 -d granularity:1h,points:8760 high
8 gnocchi archive-policy-rule create -a low -m "*" default

 
 
7. Ceilometer 프로필 수정
 1 vim  /etc/ceilometer/ceilometer.conf
 2  
 3 [DEFAULT]
 4 meter_dispatchers = gnocchi
 5  
 6 [api]
 7 gnocchi_is_enabled = true
 8  
 9 [dispatcher_gnocchi]              
10 filter_project = service              
11 filter_service_activity = True
12 url = http://$CONTROLLER_IP:8041

 
8. Ceilometer 서비스 재 개
 1 systemctl restart openstack-ceilometer-api.service openstack-ceilometer-collector.service openstack-ceilometer-notification.service 
 
9. 예시
Ceilometer 경고 만 들 기
1 gnocchi metric list
2 gnocchi resource list
3  
4  
5 ceilometer alarm-gnocchi-resources-threshold-create --name gnocchi_test_network   --description 'storage.objects.containers' --alarm-action 'log://' --evaluation-periods 2 \
6 --aggregation-method max --comparison-operator gt --threshold 5871354.0 -m network.incoming.bytes --resource-type instance_network_interface \
7 --resource-id addbb3ba-5b1e-543f-ba8a-1010e5d36dbc --repeat-actions true

 
10. 참고 문서
    http://www.cnblogs.com/knitmesh/p/5464709.html
    https://www.ustack.com/blog/telemetry/
    http://docs.openstack.org/developer/gnocchi/rest.html#archive-policy
    https://julien.danjou.info/blog/2014/openstack-ceilometer-the-gnocchi-experiment
 
다음으로 전송:https://www.cnblogs.com/multi-task/p/5553830.html

좋은 웹페이지 즐겨찾기