openstack-manuals/doc/install-guide/section_debconf-dbconfig-common.xml
Thomas Goirand f174fc2caa Debian consitency and links
This patch reviews the "Answer to the debconf" things in
every service, so that they look the same.

It also adds links to the debconf chapter, so that users
can navigate more easily in the doc.

It also changes the titles of the debconf chapter so that
they match the text in each chapter.

It also documents the fact that python-argparse should be
installed manually on all Wheezy setups, which is an issue
that has been reported by some users, and which wasn't
documented.

The patch also extends the explanations about the
meta-packages.

This patch adds a lot of <informalfigure> tags that were
missing as well.

Finally, the patch also moves the explanation about remote
MySQL setup from the nova installation procedure to the
debconf-dbconfig-common section of the debconf chapter,
which is a much better fit.

This is my last clean-up work, I believe.

Change-Id: I5a85f39e49786ae90cc0afbf13b94baf486408f4
backport: havana
2013-11-04 20:41:01 -06:00

148 lines
6.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<section xml:id="debconf-dbconfig-common"
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">
<title>Database management with dbconfig-common</title>
<para>The <systemitem class="library">dbconfig-common</systemitem>
package provides a standard Debian interface that enables you to
configure Debian database parameters. It includes localized
prompts for many languages and it supports OpenStack-supported
database back ends, which are SQLite, MySQL, and
PostgreSQL.</para>
<para>By default, the <systemitem class="library"
>dbconfig-common</systemitem> system will configure your packages to
use SQLite3. So if you use
<systemitem class="library">debconf</systemitem> in non-interactive
mode without using pre-seeding, the OpenStack services that you
install will be using SQLite3.</para>
<para>By default, <systemitem class="library"
>dbconfig-common</systemitem> does not provide access to
database servers over a network. If you want the <systemitem
class="library">dbconfig-common</systemitem> package to prompt
for remote database servers that are accessed over a network and
not through a UNIX socket file, you must reconfigure it, as
follows:</para>
<screen><prompt>#</prompt> <userinput>apt-get install dbconfig-common &amp;&amp; dpkg-reconfigure dbconfig-common</userinput></screen>
<para>Here is a snapshot of the two configuration screens that
appear when you re-configure the <systemitem class="service"
>dbconfig-common</systemitem> package:</para>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40"
fileref="figures/debconf-screenshots/dbconfig-common_keep_admin_pass.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40"
fileref="figures/debconf-screenshots/dbconfig-common_used_for_remote_db.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<para>Unlike other debconf prompts, you cannot pre-seed the answers
for the <systemitem class="library">dbconfig-common</systemitem>
prompts by using <command>debconf-set-selections</command>. Instead, you
must create a file in <filename>/etc/dbconfig-common</filename>.
For example, you might create a keystone configuration file for
<systemitem class="library">dbconfig-common</systemitem> that is
located in
<filename>/etc/dbconfig-common/keystone.conf</filename>:</para>
<programlisting language="ini">dbc_install='true'
dbc_upgrade='true'
dbc_remove=''
dbc_dbtype='mysql'
dbc_dbuser='keystone'
dbc_dbpass='MyKeyStoneDbPassWord'
dbc_dbserver=''
dbc_dbport=''
dbc_dbname='keystonedb'
dbc_dbadmin='root'
dbc_basepath=''
dbc_ssl=''
dbc_authmethod_admin=''
dbc_authmethod_user=''</programlisting>
<para>After you create this file, run the following command:</para>
<screen><prompt>#</prompt> <userinput>apt-get install keystone</userinput></screen>
<para>The Identity Service is installed with MySQL as the database
back end, keystonedb as database name, and the localhost socket
file.</para>
<para>The following screens are in the <systemitem class="service">cinder-common</systemitem>
package.</para>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_1_configure-with-dbconfig-yes-no.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_2_db-types.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_3_connection_method.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_4_mysql_root_password.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_5_mysql_app_password.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<informalfigure>
<mediaobject>
<imageobject>
<imagedata scale="40" fileref="figures/debconf-screenshots/dbconfig-common_6_mysql_app_password_confirm.png"/>
</imageobject>
</mediaobject>
</informalfigure>
<para>If you wish to access a MySQL server remotely, you have to make it
possible to access it as root from a remote server. This can be done using
a simple command available in the <systemitem class="service">openstack-proxy-node</systemitem>
package:</para>
<screen><prompt>#</prompt> <userinput>/usr/share/openstack-proxy-node/mysql-remote-root</userinput></screen>
<para>If you do not want to install the
<systemitem class="service">openstack-proxy-node</systemitem>, you can run
the following script to enable remote root access:</para>
<programlisting language="bash">#!/bin/sh
set -e
SQL="mysql --defaults-file=/etc/mysql/debian.cnf -Dmysql -e"
ROOT_PASS=`${SQL} "SELECT Password FROM user WHERE User='root' LIMIT 1;" \
| tail -n 1`
${SQL} "REPLACE INTO user SET host='%', user='root',\
password='${ROOT_PASS}', Select_priv='Y', Insert_priv='Y',\
Update_priv='Y', Delete_priv='Y', Create_priv='Y', Drop_priv='Y',\
Reload_priv='Y', Shutdown_priv='Y', Process_priv='Y', File_priv='Y',\
Grant_priv='Y', References_priv='Y', Index_priv='Y', Alter_priv='Y',\
Super_priv='Y', Show_db_priv='Y', Create_tmp_table_priv='Y',\
Lock_tables_priv='Y', Execute_priv='Y', Repl_slave_priv='Y',\
Repl_client_priv='Y', Create_view_priv='Y', Show_view_priv='Y',\
Create_routine_priv='Y', Alter_routine_priv='Y', Create_user_priv='Y',\
Event_priv='Y', Trigger_priv='Y' "
${SQL} "FLUSH PRIVILEGES"
sed -i 's|^bind-address[ \t]*=.*|bind-address = 0.0.0.0|' /etc/mysql/my.cnf
/etc/init.d/mysql restart</programlisting>
<para>You will need to enable remote access before installation of any OpenStack service.</para>
</section>