Installing Gnocchi
Gnocchi calculates, combines, and stores collected data, and provides REST APIs to receive and query monitoring data. Install Gnocchi on the controller node.
- Create a database.
- Log in to the database as the root user.
mysql -u root -p
- In the database, create a Gnocchi database and grant permissions.
CREATE DATABASE gnocchi; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY 'GNOCCHI_DBPASS'; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' IDENTIFIED BY 'GNOCCHI_DBPASS';
Replace GNOCCHI_DBPASS with the Gnocchi database user password. The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()
- Exit the database.
exit
- Log in to the database as the root user.
- Create Keystone resource objects.
openstack user create --domain default --password-prompt gnocchi openstack role add --project service --user gnocchi admin openstack service create --name gnocchi --description "Metric Service" metric openstack endpoint create --region RegionOne metric public http://controller:8041 openstack endpoint create --region RegionOne metric internal http://controller:8041 openstack endpoint create --region RegionOne metric admin http://controller:8041
The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()
- Install Gnocchi.
yum install python3-uWSGI.aarch64 yum install openstack-gnocchi-api openstack-gnocchi-metricd python3-gnocchiclient
- Modify the configuration file /etc/gnocchi/gnocchi.conf.
- Open the file.
vi /etc/gnocchi/gnocchi.conf
- Press i to enter the insert mode and modify the following content:
[api] auth_mode = keystone port = 8041 uwsgi_mode = http-socket # Configure Keystone authentication information. The configuration file does not contain the [keystone_authtoken] module parameters by default. You need to add them. [keystone_authtoken] www_authenticate_uri = http://controller:5000 auth_type = password auth_url = http://controller:5000/v3 memcached_servers = controller:11211 project_domain_name = Default user_domain_name = Default project_name = service username = gnocchi password = GNOCCHI_PASSWORD interface = internalURL region_name = RegionOne service_token_roles_required = true [indexer] url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@controller/gnocchi [storage] # coordination_url is not required but specifying one will improve # performance with better workload division across workers. # coordination_url = redis://controller:6379 file_basepath = /var/lib/gnocchi driver = file
Replace GNOCCHI_DBPASS with the password of the Gnocchi database, and replace GNOCCHI_PASSWORD with the password of the Gnocchi user. The password cannot contain the characters including #@$ and can contain the special characters including &=-_.+!*()
- Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
- Open the file.
- Initialize the database.
gnocchi-upgrade
- Grant the read and write permissions on the /var/lib/gnocchi file.
chmod -R 777 /var/lib/gnocchi
- Start the Gnocchi service.
systemctl enable openstack-gnocchi-api.service openstack-gnocchi-metricd.service systemctl start openstack-gnocchi-api.service openstack-gnocchi-metricd.service
Parent topic: Deployment and Verification