Files
keystone/doc/source/install/keystone-install-ubuntu.rst
zhiguo.li b9c0252a4c Add the step to install apache2 libapache2-mod-wsgi
The guide uses the Apache HTTP server with mod_wsgi to serve
identity service, but it did not introduce the step to install
Apache2 and libapache2-mod-wsgi package in this guide. The identity
service will not be started without these two packages.
This patch modify the step 1 in part "Install and configure components"
for installing two packages metioned above.

Change-Id: I8ca55e605f806bdc48f753ab893040d9a76aa93d
Closes-Bug: 1707176
2017-07-28 19:28:58 +08:00

4.3 KiB

Install and configure

This section describes how to install and configure the OpenStack Identity service, code-named keystone, on the controller node. For scalability purposes, this configuration deploys Fernet tokens and the Apache HTTP server to handle requests.

Prerequisites

Before you install and configure the Identity service, you must create a database.

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

    # mysql
  2. Create the keystone database:

    MariaDB [(none)]> CREATE DATABASE keystone;
  3. Grant proper access to the keystone database:

    MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
    IDENTIFIED BY 'KEYSTONE_DBPASS';
    MariaDB [(none)]> GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
    IDENTIFIED BY 'KEYSTONE_DBPASS';

    Replace KEYSTONE_DBPASS with a suitable password.

  4. Exit the database access client.

Install and configure components

Note

This guide uses the Apache HTTP server with mod_wsgi to serve Identity service requests on ports 5000 and 35357. By default, the keystone service still listens on these ports. The package handles all of the Apache configuration for you (including the activation of the mod_wsgi apache2 module and keystone configuration in Apache).

  1. Run the following command to install the packages:

    # apt install keystone  apache2 libapache2-mod-wsgi
  2. Edit the /etc/keystone/keystone.conf file and complete the following actions:

    • In the [database] section, configure database access:

      [database]
      # ...
      connection = mysql+pymysql://keystone:KEYSTONE_DBPASS@controller/keystone

      Replace KEYSTONE_DBPASS with the password you chose for the database.

      Note

      Comment out or remove any other connection options in the [database] section.

    • In the [token] section, configure the Fernet token provider:

      [token]
      # ...
      provider = fernet
  3. Populate the Identity service database:

    # su -s /bin/sh -c "keystone-manage db_sync" keystone
  4. Initialize Fernet key repositories:

    # keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
    # keystone-manage credential_setup --keystone-user keystone --keystone-group keystone
  5. Bootstrap the Identity service:

    # keystone-manage bootstrap --bootstrap-password ADMIN_PASS \
      --bootstrap-admin-url http://controller:35357/v3/ \
      --bootstrap-internal-url http://controller:5000/v3/ \
      --bootstrap-public-url http://controller:5000/v3/ \
      --bootstrap-region-id RegionOne

    Replace ADMIN_PASS with a suitable password for an administrative user.

Configure the Apache HTTP server

  1. Edit the /etc/apache2/apache2.conf file and configure the ServerName option to reference the controller node:

    ServerName controller

Finalize the installation

  1. Restart the Apache service:

    # service apache2 restart
  2. Configure the administrative account

    $ export OS_USERNAME=admin
    $ export OS_PASSWORD=ADMIN_PASS
    $ export OS_PROJECT_NAME=admin
    $ export OS_USER_DOMAIN_NAME=Default
    $ export OS_PROJECT_DOMAIN_NAME=Default
    $ export OS_AUTH_URL=http://controller:35357/v3
    $ export OS_IDENTITY_API_VERSION=3

    Replace ADMIN_PASS with the password used in the keystone-manage bootstrap command in keystone-install-configure-ubuntu.