| 1 |
3. Create the database for Gnocchi's indexer: |
| 2 |
|
| 3 |
* Use the database access client to connect to the database |
| 4 |
server as the ``root`` user: |
| 5 |
|
| 6 |
.. code-block:: console |
| 7 |
|
| 8 |
$ mysql -u root -p |
| 9 |
|
| 10 |
* Create the ``gnocchi`` database: |
| 11 |
|
| 12 |
.. code-block:: console |
| 13 |
|
| 14 |
CREATE DATABASE gnocchi; |
| 15 |
|
| 16 |
* Grant proper access to the ``gnocchi`` database: |
| 17 |
|
| 18 |
.. code-block:: console |
| 19 |
|
| 20 |
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' \ |
| 21 |
IDENTIFIED BY 'GNOCCHI_DBPASS'; |
| 22 |
GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' \ |
| 23 |
IDENTIFIED BY 'GNOCCHI_DBPASS'; |
| 24 |
|
| 25 |
Replace ``GNOCCHI_DBPASS`` with a suitable password. |
| 26 |
|
| 27 |
* Exit the database access client. |
| 28 |
|
| 29 |
4. Edit the ``/etc/gnocchi/gnocchi.conf`` file and add Keystone options: |
| 30 |
|
| 31 |
* In the ``[api]`` section, configure gnocchi to use keystone: |
| 32 |
|
| 33 |
.. code-block:: ini |
| 34 |
|
| 35 |
[api] |
| 36 |
auth_mode = keystone |
| 37 |
port = 8041 |
| 38 |
uwsgi_mode = http-socket |
| 39 |
|
| 40 |
* In the ``[keystone_authtoken]`` section, configure keystone |
| 41 |
authentication: |
| 42 |
|
| 43 |
.. code-block:: ini |
| 44 |
|
| 45 |
[keystone_authtoken] |
| 46 |
... |
| 47 |
auth_type = password |
| 48 |
auth_url = http://controller:5000/v3 |
| 49 |
project_domain_name = Default |
| 50 |
user_domain_name = Default |
| 51 |
project_name = service |
| 52 |
username = gnocchi |
| 53 |
password = GNOCCHI_PASS |
| 54 |
interface = internalURL |
| 55 |
region_name = RegionOne |
| 56 |
|
| 57 |
Replace ``GNOCCHI_PASS`` with the password you chose for |
| 58 |
the ``gnocchi`` user in the Identity service. |
| 59 |
|
| 60 |
* In the ``[indexer]`` section, configure database access: |
| 61 |
|
| 62 |
.. code-block:: ini |
| 63 |
|
| 64 |
[indexer] |
| 65 |
url = mysql+pymysql://gnocchi:GNOCCHI_DBPASS@controller/gnocchi |
| 66 |
|
| 67 |
Replace ``GNOCCHI_DBPASS`` with the password you chose for Gnocchi's |
| 68 |
indexer database. |
| 69 |
|
| 70 |
* In the ``[storage]`` section, configure location to store metric data. |
| 71 |
In this case, we will store it to the local file system. See Gnocchi |
| 72 |
documentation for a list of more durable and performant drivers: |
| 73 |
|
| 74 |
.. code-block:: ini |
| 75 |
|
| 76 |
[storage] |
| 77 |
# coordination_url is not required but specifying one will improve |
| 78 |
# performance with better workload division across workers. |
| 79 |
coordination_url = redis://controller:6379 |
| 80 |
file_basepath = /var/lib/gnocchi |
| 81 |
driver = file |
| 82 |
|
| 83 |
5. Initialize Gnocchi: |
| 84 |
|
| 85 |
.. code-block:: console |
| 86 |
|
| 87 |
gnocchi-upgrade |