openstack-manuals/doc/install-guide/section_trove-install.xml
Andreas Jaeger 591552a786 Install Guide: Fix openstack service create invocation
Fix this warning that appears with openstack version 1.0.3:
 # openstack service create --type identity   --description "OpenStack
Identity" keystone
WARNING: openstackclient.identity.v2_0.service.CreateService The
argument --type is deprecated, use service create --name <service-name>
type instead.

Note that the order is different, previously "--type TYPE NAME" and
now "--name NAME TYPE".

partially implements: blueprint installguide-kilo

Closes-Bug: #1453883
Closes-Bug: #1453891

Co-Authored-By: Christian Berendt <berendt@b1-systems.de>
Co-Authored-By: Flávio Ramalho <flaviosr@lsd.ufcg.edu.br>
Change-Id: I72f89defd7f55ce2822b5b511280f40196361f68
2015-05-14 22:16:58 +02:00

284 lines
14 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0"
xml:id="trove-install">
<title>Install the Database service</title>
<para>This procedure installs the Database service on the controller
node.</para>
<formalpara>
<title>Prerequisites</title>
<para>This chapter assumes that you already have a working
OpenStack environment with at least the following components
installed: Compute, Image service, Identity.</para>
</formalpara>
<itemizedlist>
<listitem>
<para>If you want to do backup and restore, you also need Object Storage.</para>
</listitem>
<listitem>
<para>If you want to provision datastores on block-storage volumes, you also need Block Storage.</para>
</listitem>
</itemizedlist>
<para>To install the Database service on the controller:</para>
<procedure>
<step>
<para>Install required packages:</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install python-trove python-troveclient \
trove-common trove-api trove-taskmanager trove-conductor</userinput></screen>
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>yum install openstack-trove python-troveclient</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-trove python-troveclient</userinput></screen>
</step>
<step os="debian">
<para>Respond to the prompts for <link linkend="debconf-dbconfig-common">database management</link> and <link linkend="debconf-keystone_authtoken"><literal>[keystone_authtoken]</literal> settings</link>,
and <link linkend="debconf-api-endpoints">API endpoint</link>
registration. The <command>trove-manage db_sync</command>
command runs automatically.</para>
</step>
<step>
<para>All configuration files should be placed at <filename>/etc/trove</filename> directory.
Edit the following configuration files, taking the below
actions for each file:</para>
<itemizedlist>
<listitem><para><filename>api-paste.ini</filename></para></listitem>
<listitem><para><filename>trove.conf</filename></para></listitem>
<listitem><para><filename>trove-taskmanager.conf</filename></para></listitem>
<listitem><para><filename>trove-conductor.conf</filename></para></listitem>
</itemizedlist>
<substeps>
<step>
<para>You need to take upstream <filename>api-paste.ini</filename> and change content below in it:</para>
<programlisting language="ini">[composite:trove]
auth_uri = http://<replaceable>controller</replaceable>:5000/v2.0
identity_uri = http://<replaceable>controller</replaceable>:35357
auth_host = <replaceable>controller</replaceable>
admin_tenant_name = service
admin_user = trove
admin_password = <replaceable>TROVE_PASS</replaceable></programlisting></step>
<step><para>Edit the <literal>[DEFAULT]</literal> section of
each file (except <filename>api-paste.ini</filename>) and set appropriate values for the OpenStack service
URLs (can be handled by Keystone service catalog), logging and
messaging configuration. Edit the <literal>[database]</literal> section in each
file to add the SQL connections:</para>
<programlisting language="ini">[DEFAULT]
log_dir = /var/log/trove
trove_auth_url = http://<replaceable>controller</replaceable>:5000/v2.0
nova_compute_url = http://<replaceable>controller</replaceable>:8774/v2
cinder_url = http://<replaceable>controller</replaceable>:8776/v2
swift_url = http://<replaceable>controller</replaceable>:8080/v1/AUTH_
notifier_queue_hostname = <replaceable>controller</replaceable>
[database]
connection = mysql://trove:<literal>TROVE_DBPASS</literal>@<replaceable>controller</replaceable>/trove</programlisting>
</step>
<step>
<para>Configure the Database service to use the RabbitMQ message broker by
setting the following options in the <literal>[DEFAULT]</literal>
configuration group of each file:</para>
<programlisting language="ini">[DEFAULT]
control_exchange = trove
rabbit_host = <replaceable>controller</replaceable>
rabbit_userid = <replaceable>guest</replaceable>
rabbit_password = <replaceable>RABBIT_PASS</replaceable>
rabbit_virtual_host= <replaceable>/</replaceable>
rpc_backend = trove.openstack.common.rpc.impl_kombu</programlisting>
</step>
</substeps>
</step>
<step><para>Edit the <filename>trove.conf</filename> file so it includes
appropriate values for the default datastore and network label
regex as shown below:</para>
<programlisting language="ini">[DEFAULT]
# Config option for showing the IP address that nova doles out
add_addresses = True
network_label_regex = ^NETWORK_LABEL$
control_exchange = trove
</programlisting>
</step>
<step>
<para>Edit the <filename>trove-taskmanager.conf</filename> file
so it includes the required settings to
connect to the OpenStack Compute service as shown below:</para>
<programlisting language="ini">[DEFAULT]
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
# It proxy's the token received from the user to send to nova via this admin users creds,
# basically acting like the client via that proxy token.
nova_proxy_admin_user = admin
nova_proxy_admin_pass = <replaceable>ADMIN_PASS</replaceable>
nova_proxy_admin_tenant_name = service
taskmanager_manager = trove.taskmanager.manager.Manager
log_file=trove-taskmanager.log
</programlisting>
</step>
<step os="opensuse;sles;fedora;rhel;centos;ubuntu">
<para>Prepare the trove admin database:</para>
<screen><prompt>$</prompt> <userinput>mysql -u root -p</userinput>
<prompt>mysql&gt;</prompt> <userinput>CREATE DATABASE trove;</userinput>
<prompt>mysql&gt;</prompt> <userinput>GRANT ALL PRIVILEGES ON trove.* TO trove@'localhost' \
IDENTIFIED BY '<replaceable>TROVE_DBPASS</replaceable>';</userinput>
<prompt>mysql&gt;</prompt> <userinput>GRANT ALL PRIVILEGES ON trove.* TO trove@'%' \
IDENTIFIED BY '<replaceable>TROVE_DBPASS</replaceable>';</userinput></screen>
</step>
<step os="opensuse;sles;fedora;rhel;centos;ubuntu">
<para>Prepare the Database service:</para>
<substeps>
<step>
<para>Initialize the database:</para>
<screen><prompt>#</prompt> <userinput>trove-manage db_sync</userinput></screen>
</step>
<step>
<para>Create a datastore. You need to create a separate datastore for
each type of database you want to use, for example, MySQL, MongoDB, Cassandra.
This example shows you how to create a datastore for a MySQL database:</para>
<screen><prompt>#</prompt> <userinput>su -s /bin/sh -c "trove-manage datastore_update mysql ''" trove</userinput></screen>
</step>
</substeps>
</step>
<step>
<para>Create a trove image.</para>
<para>Create an image for the type of database you want to use,
for example, MySQL, MongoDB, Cassandra.</para>
<para>This image must have the trove guest agent installed, and
it must have the <filename>trove-guestagent.conf</filename> file
configured to connect to your OpenStack environment. To
correctly configure the
<filename>trove-guestagent.conf</filename> file, follow these steps
on the guest instance you are using to build your image:</para>
<substeps>
<step>
<para>Add the following lines to <filename>trove-guestagent.conf</filename>:</para>
<programlisting language="ini">rabbit_host = <replaceable>controller</replaceable>
rabbit_password = <replaceable>RABBIT_PASS</replaceable>
nova_proxy_admin_user = admin
nova_proxy_admin_pass = <replaceable>ADMIN_PASS</replaceable>
nova_proxy_admin_tenant_name = service
trove_auth_url = http://<replaceable>controller</replaceable>:35357/v2.0
log_file = trove-guestagent.log</programlisting>
</step>
</substeps>
</step>
<step>
<para>Update the datastore and version to use the specific image with the <command>trove-manage</command> command.</para>
<screen><prompt>#</prompt><userinput>trove-manage datastore_update <replaceable>datastore_name</replaceable> <replaceable>datastore_version</replaceable></userinput>
<prompt>#</prompt><userinput>trove-manage datastore_version_update <replaceable>datastore_name</replaceable> <replaceable>version_name</replaceable> \
<replaceable>datastore_manager</replaceable> <replaceable>glance_image_id</replaceable> <replaceable>packages</replaceable> <replaceable>active</replaceable></userinput></screen>
<para>This example shows you how to create a MySQL datastore with version 5.5:</para>
<screen><prompt>#</prompt><userinput>trove-manage datastore_update mysql ''</userinput>
<prompt>#</prompt><userinput>trove-manage datastore_version_update mysql 5.5 mysql <replaceable>glance_image_ID</replaceable> mysql-server-5.5 1
<prompt>#</prompt><userinput>trove-manage datastore_update mysql 5.5</userinput>
</userinput></screen>
<para>
Upload post-provisioning configuration validation rules:
</para>
<screen><prompt>#</prompt><userinput>trove-manage db_load_datastore_config_parameters <replaceable>datastore_name</replaceable> <replaceable>version_name</replaceable> \
<replaceable>/etc/<replaceable>datastore_name</replaceable>/validation-rules.json</replaceable></userinput></screen>
<para>Example for uploading rules for MySQL datastore:</para>
<screen><prompt>#</prompt> <userinput>trove-manage db_load_datastore_config_parameters \
mysql 5.5 "$PYBASEDIR"/trove/templates/mysql/validation-rules.json
</userinput></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Source the <literal>admin</literal> credentials to gain access to
admin-only CLI commands:</para>
<screen><prompt>$</prompt> <userinput>source admin-openrc.sh</userinput></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>To create the service credentials, complete these steps:</para>
<substeps>
<step>
<para>Create the <literal>trove</literal> user:</para>
<screen><prompt>$</prompt> <userinput>openstack user create --password-prompt trove</userinput>
<computeroutput>User Password:
Repeat User Password:
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | a0bb962771744d63a659c540d5384b0c |
| name | trove |
| username | trove |
+----------+----------------------------------+</computeroutput></screen>
</step>
<step>
<para>Add the <literal>admin</literal> role to the
<literal>trove</literal> user:</para>
<screen><prompt>$</prompt> <userinput>openstack role add --project service --user trove admin</userinput>
<computeroutput>+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
| name | admin |
+-------+----------------------------------+</computeroutput></screen>
</step>
<step>
<para>Create the <literal>neutron</literal> service entity:</para>
<screen><prompt>$</prompt> <userinput>openstack service create --name trove \
--description "OpenStack Database service" database</userinput>
<computeroutput>+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Database service |
| enabled | True |
| id | 390a039be169460c994110210c620d2f |
| name | trove |
| type | database |
+-------------+----------------------------------+</computeroutput></screen>
</step>
</substeps>
</step>
<step os="rhel;centos;fedora;opensuse;sles;ubuntu">
<para>Create the Database service API endpoint:</para>
<screen><prompt>$</prompt> <userinput>openstack endpoint create \
--publicurl http://<replaceable>controller</replaceable>:8779/v1.0/%\(tenant_id\)s \
--internalurl http://<replaceable>controller</replaceable>:8779/v1.0/%\(tenant_id\)s \
--adminurl http://<replaceable>controller</replaceable>:8779/v1.0/%\(tenant_id\)s \
--region RegionOne \
database</userinput>
<computeroutput>+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| adminurl | http://controller:8779/v1.0/%(tenant_id)s |
| id | 22db3a4e1ce1407f80dfc1fbe6c26278 |
| internalurl | http://controller:8779/v1.0/%(tenant_id)s |
| publicurl | http://controller:8779/v1.0/%(tenant_id)s |
| region | RegionOne |
| service_id | 390a039be169460c994110210c620d2f |
| service_name | trove |
| service_type | database |
+--------------+-------------------------------------------+</computeroutput></screen>
</step>
<step os="ubuntu;debian">
<para>Restart the Database services:</para>
<screen><prompt>#</prompt> <userinput>service trove-api restart</userinput>
<prompt>#</prompt> <userinput>service trove-taskmanager restart</userinput>
<prompt>#</prompt> <userinput>service trove-conductor restart</userinput></screen>
</step>
<step os="rhel;centos;fedora;sles;opensuse">
<para>Start the Database services and configure them to start when the
system boots:</para>
<screen><prompt>#</prompt> <userinput>systemctl enable openstack-trove-api.service openstack-trove-taskmanager.service \
openstack-trove-conductor.service</userinput>
<prompt>#</prompt> <userinput>systemctl start openstack-trove-api.service openstack-trove-taskmanager.service \
openstack-trove-conductor.service</userinput></screen>
</step>
</procedure>
</section>