Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. Create a database.
    1. Log in to the database as the root user.
      mysql -u root -p 
    2. 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 &=-_.+!*()

    3. Exit the database.
      exit
  2. 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 &=-_.+!*()

  3. Install Gnocchi.
    yum install python3-uWSGI.aarch64 
    yum install openstack-gnocchi-api openstack-gnocchi-metricd python3-gnocchiclient
  4. Modify the configuration file /etc/gnocchi/gnocchi.conf.
    1. Open the file.
      vi /etc/gnocchi/gnocchi.conf
    2. 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 &=-_.+!*()

    1. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  5. Initialize the database.
    gnocchi-upgrade
  6. Grant the read and write permissions on the /var/lib/gnocchi file.
    chmod -R 777 /var/lib/gnocchi
  7. Start the Gnocchi service.
    systemctl enable openstack-gnocchi-api.service openstack-gnocchi-metricd.service 
    systemctl start openstack-gnocchi-api.service openstack-gnocchi-metricd.service