Advertisement
Guest User

Untitled

a guest
Nov 17th, 2016
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. #####Install Gnocchi
  2.  
  3. ######Install redis
  4. ```
  5. apt-get install -y redis-server
  6. ```
  7.  
  8. #####Start redis server
  9. ```
  10. service redis-server restart
  11. ```
  12.  
  13. ######Install gnocchi
  14. ```
  15. pip install gnocchi
  16. ```
  17.  
  18. ######Add index database
  19. ```
  20. cat << EOF | mysql -uroot -p
  21. create database gnocchi;
  22. grant all privileges on gnocchi.* to 'gnocchi'@'%' identified by 'saphi';
  23. EOF
  24. ```
  25. ######Add user
  26.  
  27. ```
  28. openstack user create --domain default --password saphi gnocchi
  29. openstack role add --project service --user gnocchi admin
  30. openstack service create --name gnocchi \
  31. --description "OpenStack metric" metric
  32. openstack endpoint create --region RegionOne \
  33. metric public http://10.0.0.41:8041
  34. openstack endpoint create --region RegionOne \
  35. metric internal http://10.0.0.41:8041
  36. openstack endpoint create --region RegionOne \
  37. metric admin http://10.0.0.41:8041
  38.  
  39. ```
  40. #######Configure
  41. `/etc/gnocchi/gnocchi.conf`
  42.  
  43.  
  44. ```
  45. [DEFAULT]
  46. debug = True
  47. [storage]
  48. file_basepath = /var/lib/gnocchi/
  49. driver = file
  50. coordination_url = redis://10.0.0.41:6379
  51. [keystone_authtoken]
  52. iauth_url = http://10.0.0.41:35357
  53. auth_type = password
  54. project_domain_name = default
  55. user_domain_name = default
  56. region_name = RegionOne
  57. project_name = service
  58. username = gnocchi
  59. password = saphi
  60. [metricd]
  61. workers = 1
  62. [statsd]
  63. [cors]
  64. [indexer]
  65. url = mysql+pymysql://gnocchi:saphi@10.0.0.41/gnocchi
  66. ```
  67.  
  68. ```
  69. pip install sqlalchemy-utils redis pymysql lz4 tooz
  70. ```
  71.  
  72. ####run gnocchi api under apache
  73.  
  74. ```
  75. cat << EOF > /usr/local/bin/app.wsgi
  76. from gnocchi.rest import app
  77.  
  78. application = app.build_wsgi_app()
  79. EOF
  80. ```
  81. #####Site available apache
  82. ```
  83. Listen 8041
  84.  
  85. <VirtualHost *:8041>
  86. WSGIDaemonProcess gnocchi processes=5 threads=1 user=gnocchi group=gnocchi display-name=%{GROUP}
  87. WSGIProcessGroup gnocchi
  88. WSGIScriptAlias / /usr/local/bin/app.wsgi
  89. WSGIApplicationGroup %{GLOBAL}
  90. WSGIPassAuthorization On
  91. ErrorLogFormat "%{cu}t %M"
  92. ErrorLog /var/log/apache2/gnocchi.log
  93. CustomLog /var/log/apache2/gnocchi_access.log combined
  94.  
  95. <Directory /usr/local/bin>
  96. Require all granted
  97. </Directory>
  98. </VirtualHost>
  99. ```
  100.  
  101. #####Restart apache and run gnocchi-metricd
  102.  
  103. ```
  104. service apache2 restart
  105. gnocchi-metricd
  106. ```
  107.  
  108. #####Config gnocchi as storage backend for ceilometer
  109.  
  110. - add gnocchi resource
  111. ```
  112. curl -L 'https://raw.githubusercontent.com/openstack/ceilometer/master/etc/ceilometer/gnocchi_resources.yaml' > /etc/ceilometer/gnocchi_resources.yaml
  113. ```
  114. - config `/etc/ceilometer/ceilometer.conf`
  115.  
  116. ```
  117. [DEFAULT]
  118. dispatcher = gnocchi
  119.  
  120. [alarms]
  121. gnocchi_url = http://10.0.0.41:8041
  122.  
  123. [dispatcher_gnocchi]
  124. url = http://10.0.0.41:8041
  125. filter_project = service
  126. filter_service_activity = False
  127. archive_policy = low
  128. resources_definition_file = gnocchi_resources.yaml
  129.  
  130. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement