charm-deployment-guide/deploy-guide/source/common_prerequisites.rst

1.9 KiB

Prerequisites

Before you install and configure the charms service, you must create a database, service credentials, and API endpoints.

  1. To create the database, complete these steps:

    • Use the database access client to connect to the database server as the root user:

      $ mysql -u root -p
    • Create the charms database:

      CREATE DATABASE charms;
    • Grant proper access to the charms database:

      GRANT ALL PRIVILEGES ON charms.* TO 'charms'@'localhost' \
        IDENTIFIED BY 'CHARMS_DBPASS';
      GRANT ALL PRIVILEGES ON charms.* TO 'charms'@'%' \
        IDENTIFIED BY 'CHARMS_DBPASS';

      Replace CHARMS_DBPASS with a suitable password.

    • Exit the database access client.

      exit;
  2. Source the admin credentials to gain access to admin-only CLI commands:

    $ . admin-openrc
  3. To create the service credentials, complete these steps:

    • Create the charms user:

      $ openstack user create --domain default --password-prompt charms
    • Add the admin role to the charms user:

      $ openstack role add --project service --user charms admin
    • Create the charms service entities:

      $ openstack service create --name charms --description "charms" charms
  4. Create the charms service API endpoints:

    $ openstack endpoint create --region RegionOne \
      charms public http://controller:XXXX/vY/%\(tenant_id\)s
    $ openstack endpoint create --region RegionOne \
      charms internal http://controller:XXXX/vY/%\(tenant_id\)s
    $ openstack endpoint create --region RegionOne \
      charms admin http://controller:XXXX/vY/%\(tenant_id\)s