-
-
Save pkilambi/657cad70ce7d6f68bdc5 to your computer and use it in GitHub Desktop.
configure gnocchi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gnocchi Test Installation on OSPd environment | |
LINKS: | |
http://docs.openstack.org/developer/gnocchi/basic.html | |
Available package: | |
yum search gnocchi | |
Loaded plugins: product-id, subscription-manager | |
============================================================================================== N/S matched: gnocchi =============================================================================================== | |
openstack-gnocchi-api.noarch : OpenStack gnocchi api | |
openstack-gnocchi-carbonara.noarch : OpenStack gnocchi carbonara | |
openstack-gnocchi-doc.noarch : Documentation for OpenStack gnocchi | |
openstack-gnocchi-indexer-sqlalchemy.noarch : OpenStack gnocchi indexer sqlalchemy driver | |
openstack-gnocchi-statsd.noarch : OpenStack gnocchi statsd daemon | |
python-gnocchi.noarch : OpenStack gnocchi python libraries | |
Install gnocchi packages | |
sudo yum install openstack-gnocchi* -y | |
Edit /etc/gnocchi/gnocchi.conf | |
[DEFAULT] | |
debug = true # enable debug logging | |
verbose = true # enable more verbose output | |
[api] | |
workers = 1 # number of workers | |
[database] | |
backend = sqlalchemy | |
[indexer] | |
url = mysql://<USER>:<PASS>@192.0.2.10/gnocchi2?charset=utf8 | |
# user/pass/ip for accessing MySQL | |
# database has to be create prior starting gnocchi-api | |
[keystone_authtoken] | |
auth_uri = http://192.0.2.7:5000/v2.0 # Complete public Identity API endpoint | |
signing_dir = /var/cache/gnocchi # Directory used to cache files related to PKI tokens | |
auth_host = 192.0.2.7 | |
auth_port = 35357 | |
auth_protocol = http | |
identity_uri = http://192.0.2.7:35357/ | |
admin_user = admin | |
admin_password = 5179f4d3c5b1a4c51269cad2a23dbf336513efeb | |
admin_tenant_name = admin | |
[statsd] | |
resource_id = 7f24edd9-5a2f-4592-b708-ffbed821c5d3 # How to generate this? | |
user_id = 0ad8dfef-75ec-4b76-b6f5-0235c99f2c37 | |
project_id = d104a17e91144411b1d1bcf07f2c03bd | |
archive_policy_name = low | |
flush_delay = 5 # has to be specified manaully https://bugs.launchpad.net/gnocchi/+bug/1481439 | |
[storage] | |
coordination_url = file:///var/lib/gnocchi/locks # create manually, adjust permissions | |
driver = file | |
file_basepath = /var/lib/gnocchi # create manually, adjust permissions | |
Initialize indexer: | |
gnocchi-dbsync | |
Traceback (most recent call last): | |
File "/usr/bin/gnocchi-dbsync", line 6, in <module> | |
from gnocchi.cli import storage_dbsync | |
File "/usr/lib/python2.7/site-packages/gnocchi/cli.py", line 15, in <module> | |
from gnocchi.indexer import sqlalchemy as sql_db | |
File "/usr/lib/python2.7/site-packages/gnocchi/indexer/sqlalchemy.py", line 31, in <module> | |
from gnocchi import utils | |
File "/usr/lib/python2.7/site-packages/gnocchi/utils.py", line 19, in <module> | |
from pytimeparse import timeparse | |
File "/usr/lib/python2.7/site-packages/pytimeparse/__init__.py", line 28, in <module> | |
from .timeparse import timeparse as parse | |
File "/usr/lib/python2.7/site-packages/pytimeparse/timeparse.py", line 34, in <module> | |
from builtins import dict, int | |
ImportError: No module named builtins | |
FIX: | |
Install a newer version of pytimeparse from upstream: | |
sudo yum -y install https://kojipkgs.fedoraproject.org//packages/python-pytimeparse/1.1.5/1.fc22/noarch/python-pytimeparse-1.1.5-1.fc22.noarch.rpm | |
Alternately - | |
1.Get a requirements file from https://github.com/openstack/gnocchi/blob/master/requirements.txt | |
2. Check pip is installed: | |
which pip | |
/usr/bin/which: no pip in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/heat-admin/.local/bin:/home/heat-admin/bin) | |
3. Install pip | |
curl -O https://bootstrap.pypa.io/get-pip.py | |
sudo python get-pip.py | |
4. Install requirements: | |
sudo yum install postgresql-devel.x86_64 | |
sudo pip install -r requirements.txt | |
5. Try again: | |
sudo gnocchi-dbsync | |
START GNOCCHI | |
To run Gnocchi, simple run the HTTP server: | |
sudo gnocchi-api | |
... | |
To run Gnocchi, simple run the HTTP server: | |
/etc/gnocchi/policy.json | |
It very aanoying so for poc/test just allow access to everyone: | |
{ | |
"admin_or_creator": "role:admin or project_id:%(created_by_project_id)s", | |
"resource_owner": "project_id:%(project_id)s", | |
"metric_owner": "project_id:%(resource.project_id)s", | |
"create resource": "", | |
"get resource": "", | |
"update resource": "", | |
"delete resource": "", | |
"list resource": "", | |
"list all resource": "", | |
"search resource": "", | |
"search all resource": "", | |
"get archive policy": "", | |
"list archive policy": "", | |
"create archive policy": "", | |
"create archive policy rule": "", | |
"get archive policy rule": "", | |
"list archive policy rule": "", | |
"create metric": "", | |
"delete metric": "", | |
"get metric": "", | |
"search metric": "", | |
"list metric": "", | |
"list all metric": "", | |
"get measures": "", | |
"post measures": "" | |
} | |
START gnocchi-statsd | |
sudo gnocchi-statsd | |
... | |
INFO gnocchi.statsd [-] Created resource 7f24edd9-5a2f-4592-b708-ffbed821c5d3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment