OpenStack Flamingo : Configure Gnocchi2025/12/01 |
|
Install TDBaaS (Time Series Database as a Service), Gnocchi. This example is based on the environment like follows.
------------+--------------------------+--------------------------+------------
| | |
eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] |
| (Control Node) | | (Network Node) | | (Compute Node) |
| | | | | |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt |
| Memcached Nginx | | Neutron Server | | Nova Compute |
| Keystone httpd | | OVN-Northd | | Open vSwitch |
| Glance Nova API | | Nginx iSCSI Target | | OVN Metadata Agent |
| Cinder API | | Cinder Volume | | OVN-Controller |
| | | Gnocchi httpd | | |
+-----------------------+ +-----------------------+ +-----------------------+
|
| [1] | Add users and others for Gnocchi in Keystone. |
|
# create [gnocchi] user in [service] project root@dlp ~(keystone)# openstack user create --domain default --project service --password servicepassword gnocchi
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| default_project_id | 17d8e190750a402d920eedf933aea358 |
| domain_id | default |
| email | None |
| enabled | True |
| id | 47f545f215974c4295739ef61bd00ca0 |
| name | gnocchi |
| description | None |
| password_expires_at | None |
| options | {} |
+---------------------+----------------------------------+
# add [gnocchi] user in [admin] role root@dlp ~(keystone)# openstack role add --project service --user gnocchi admin
# create service entry for [gnocchi] root@dlp ~(keystone)# openstack service create --name gnocchi --description "Metric Service" metric +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | id | dc1220e2d16c40568477a15e8e8b0621 | | name | gnocchi | | type | metric | | enabled | True | | description | Metric Service | +-------------+----------------------------------+ # set Gnocchi API Host root@dlp ~(keystone)# export controller=network.srv.world
# create endpoint for [gnocchi] (public) root@dlp ~(keystone)# openstack endpoint create --region RegionOne metric public https://$controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | 6ff96c37418e489299b8649acd691be5 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | dc1220e2d16c40568477a15e8e8b0621 | | url | https://network.srv.world:8041 | | service_name | gnocchi | | service_type | metric | +--------------+----------------------------------+ # create endpoint for [gnocchi] (internal) root@dlp ~(keystone)# openstack endpoint create --region RegionOne metric internal https://$controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | b3274dbadc144bd3aa4b5750e8b6afa3 | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | dc1220e2d16c40568477a15e8e8b0621 | | url | https://network.srv.world:8041 | | service_name | gnocchi | | service_type | metric | +--------------+----------------------------------+ # create endpoint for [gnocchi] (admin) root@dlp ~(keystone)# openstack endpoint create --region RegionOne metric admin https://$controller:8041 +--------------+----------------------------------+ | Field | Value | +--------------+----------------------------------+ | enabled | True | | id | d09181e1889c4ccb9b40ecbfaca63d27 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | dc1220e2d16c40568477a15e8e8b0621 | | url | https://network.srv.world:8041 | | service_name | gnocchi | | service_type | metric | +--------------+----------------------------------+ |
| [2] | Add a User and Database on MariaDB for Gnocchi. |
|
root@dlp ~(keystone)# mariadb Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 104 Server version: 10.11.13-MariaDB-0ubuntu0.24.04.1 Ubuntu 24.04 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database gnocchi; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on gnocchi.* to gnocchi@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> grant all privileges on gnocchi.* to gnocchi@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye |
| [3] | Install Gnocchi on Network Node. For questions during the installation, it's OK with [No] to all. |
|
root@network:~# apt -y install gnocchi-api gnocchi-metricd python3-gnocchiclient apache2 libapache2-mod-wsgi-py3 nginx libnginx-mod-stream
|
| [4] | Configure Gnocchi. |
|
root@network:~# mv /etc/gnocchi/gnocchi.conf /etc/gnocchi/gnocchi.conf.org
root@network:~#
vi /etc/gnocchi/gnocchi.conf # create new [DEFAULT] log_dir = /var/log/gnocchi [api] auth_mode = keystone [database] backend = sqlalchemy # MariaDB connection info [indexer] url = mysql+pymysql://gnocchi:password@dlp.srv.world:3306/gnocchi [storage] driver = file file_basepath = /var/lib/gnocchi # Keystone auth info [keystone_authtoken] www_authenticate_uri = https://dlp.srv.world:5000 auth_url = https://dlp.srv.world:5000 memcached_servers = dlp.srv.world:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = gnocchi password = servicepassword service_token_roles_required = true # if using self-signed certs on Apache2 Keystone, turn to [true] insecure = false [oslo_policy] enforce_new_defaults = true
root@network:~#
vi /etc/apache2/sites-available/gnocchi-api.conf # line 1 : change Listen 127.0.0.1:8041
chmod 640 /etc/gnocchi/gnocchi.conf root@network:~# chgrp gnocchi /etc/gnocchi/gnocchi.conf |
| [5] | Get valid SSL/TLS certificate or Create self-signed certificate for Network Node and configure Nginx for proxy settings. |
|
root@network:~# unlink /etc/nginx/sites-enabled/default
root@network:~#
vi /etc/nginx/nginx.conf # add to last line
stream {
upstream gnocchi-api {
server 127.0.0.1:8041;
}
server {
listen 10.0.0.50:8041 ssl;
proxy_pass gnocchi-api;
}
ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem";
}
|
| [6] | Add Data into Database and start Gnocchi services. |
|
root@network:~# su -s /bin/bash gnocchi -c "gnocchi-upgrade" root@network:~# a2enmod wsgi root@network:~# a2ensite gnocchi-api root@network:~# systemctl restart gnocchi-metricd apache2 nginx root@network:~# systemctl enable gnocchi-metricd |
| [7] | Verify state on Control Node. |
|
root@dlp ~(keystone)#
apt -y install python3-gnocchiclient root@dlp ~(keystone)# export OS_AUTH_TYPE=password root@dlp ~(keystone)# gnocchi resource list
# OK if no error is shown |
| Sponsored Link |
|
|