Install and configure

Install and configure

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

Prerequisites

Before you configure the OpenStack Identity service, you must create a database and an administration token.

  1. To create the database, complete the following actions:

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

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

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

      GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
        IDENTIFIED BY 'KEYSTONE_DBPASS';
      GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
        IDENTIFIED BY 'KEYSTONE_DBPASS';
      

      Replace KEYSTONE_DBPASS with a suitable password.

    • Exit the database access client.

  2. Generate a random value to use as the administration token during initial configuration:

    $ openssl rand -hex 10
    

Install and configure components

Note

Default configuration files vary by distribution. You might need to add these sections and options rather than modifying existing sections and options. Also, an ellipsis (...) in the configuration snippets indicates potential default configuration options that you should retain.

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. Therefore, this guide manually disables the keystone service.

  1. Run the following command to install the packages:

    # zypper install openstack-keystone apache2-mod_wsgi
    
  1. Edit the /etc/keystone/keystone.conf file and complete the following actions:

    • In the [DEFAULT] section, define the value of the initial administration token:

      [DEFAULT]
      ...
      admin_token = ADMIN_TOKEN
      

      Replace ADMIN_TOKEN with the random value that you generated in a previous step.

    • 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.

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

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

    # su -s /bin/sh -c "keystone-manage db_sync" keystone
    

    Note

    Ignore any deprecation messages in this output.

  2. Initialize Fernet keys:

    # keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
    

Configure the Apache HTTP server

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

    APACHE_SERVERNAME="controller"
    
  2. Create the /etc/apache2/conf.d/wsgi-keystone.conf file with the following content:

    Listen 5000
    Listen 35357
    
    <VirtualHost *:5000>
        WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
        WSGIProcessGroup keystone-public
        WSGIScriptAlias / /usr/bin/keystone-wsgi-public
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        ErrorLogFormat "%{cu}t %M"
        ErrorLog /var/log/apache2/keystone.log
        CustomLog /var/log/apache2/keystone_access.log combined
    
        <Directory /usr/bin>
            Require all granted
        </Directory>
    </VirtualHost>
    
    <VirtualHost *:35357>
        WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
        WSGIProcessGroup keystone-admin
        WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
        WSGIApplicationGroup %{GLOBAL}
        WSGIPassAuthorization On
        ErrorLogFormat "%{cu}t %M"
        ErrorLog /var/log/apache2/keystone.log
        CustomLog /var/log/apache2/keystone_access.log combined
    
        <Directory /usr/bin>
            Require all granted
        </Directory>
    </VirtualHost>
    
  1. Recursively change the ownership of the /etc/keystone directory:

    # chown -R keystone:keystone /etc/keystone
    

Finalize the installation

  1. Start the Apache HTTP service and configure it to start when the system boots:

    # systemctl enable apache2.service
    # systemctl start apache2.service
    
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.