openstack-manuals/doc/install-guide/section_nova-compute.xml
Andreas Jaeger 6a37dbd369 Fix typo in os profiling
Change-Id: I6aa5308612fe33de0ea755a9c3669d6f820d97ba
2013-10-17 14:50:19 +02:00

150 lines
8.6 KiB
XML

<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="nova-compute">
<title>Configuring a Compute Node</title>
<para>After configuring the Compute Services on the controller node, configure a second system to
be a Compute node. The Compute node receives requests from the controller node and hosts virtual
machine instances. You can run all services on a single node, but this guide uses separate
systems. This makes it easy to scale horizontally by adding additional Compute nodes following
the instructions in this section.</para>
<para>The Compute Service relies on a hypervisor to run virtual machine
instances. OpenStack can use various hypervisors, but this guide uses
KVM.</para>
<procedure>
<title>Configure a Compute Node</title>
<step><para>Begin by configuring the system using the instructions in
<xref linkend="ch_basics"/>. Note the following differences from the
controller node:</para>
<itemizedlist>
<listitem>
<para>Use different IP addresses when configuring
<filename>eth0</filename>. This guide uses
<literal>192.168.0.11</literal> for the internal network. Change
or configure <literal>eth1</literal> to manual rather than
static.</para>
</listitem>
<listitem>
<para>Set the hostname to <literal>compute1</literal>. Ensure that the
IP addresses and hostnames for both nodes are listed in the
<filename>/etc/hosts</filename> file on each system.</para>
</listitem>
<listitem>
<para>Follow the instructions in
<xref linkend="basics-ntp"/> to synchronize from the controller node.</para>
</listitem>
<listitem>
<para>Install the MySQL client libraries. You do not need to install the MySQL database
server or start the MySQL service.</para>
</listitem>
<listitem>
<para>Enable the OpenStack packages for the distribution you are using, see <xref linkend="basics-packages"/>.</para>
</listitem>
</itemizedlist>
</step>
<step><para>After configuring the operating system, install the appropriate
packages for the compute service.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install nova-compute-kvm python-novaclient python-guestfs</userinput></screen>
<para os="ubuntu;debian">Select "Yes" when asked to create a supermin appliance during install.</para>
<screen os="centos;rhel;fedora"><prompt>#</prompt> <userinput>yum install openstack-nova-compute</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-nova-compute kvm openstack-utils</userinput></screen>
</step>
<step os="ubuntu">
<para>Due to <link xlink:href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/759725">this bug</link>
that is marked "Won't Fix", guestfs is restricted.
Run the following command to relax the restriction:</para>
<screen><prompt>#</prompt> <userinput>chmod 0644 /boot/vmlinuz*</userinput></screen>
</step>
<step os="rhel;centos;fedora"><para>Either copy and modify the file <filename>/etc/nova/nova.conf</filename> from the
<replaceable>controller</replaceable> node, or run the same configuration commands.</para>
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
database connection mysql://nova:<replaceable>NOVA_DBPASS</replaceable>@controller/nova</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT auth_host <replaceable>controller</replaceable></userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_user nova</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_tenant_name service</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT admin_password <replaceable>NOVA_DBPASS</replaceable></userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
database connection mysql://nova:<replaceable>NOVA_DBPASS</replaceable>@controller/nova</userinput>
</screen>
<para os="ubuntu;debian">Edit <filename>/etc/nova/nova.conf</filename> and add to the appropriate sections.</para>
<programlisting os="ubuntu;debian" language="ini">...
[DEFAULT]
...
auth_strategy=keystone
...
[database]
# The SQLAlchemy connection string used to connect to the database
connection = mysql://nova:NOVA_DBPASS@controller/nova
</programlisting>
<screen os="fedora;rhel;centos"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf \
DEFAULT rpc_backend nova.openstack.common.rpc.impl_qpid</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname <replaceable>controller</replaceable></userinput></screen>
<para os="ubuntu;debian">
Configure the Compute Service to use the RabbitMQ
message broker by setting the following configuration keys. They are found in
the <literal>DEFAULT</literal> configuration group of the
<filename>/etc/nova/nova.conf</filename> file.</para>
<programlisting os="ubuntu;debian" language="ini">rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller</programlisting>
</step>
<step os="ubuntu;debian">
<para>Remove the SQLite Database created by the packages</para>
<screen><prompt>#</prompt> <userinput>rm /var/lib/nova/nova.sqlite</userinput></screen>
</step>
<step><para>Set the configuration keys <literal>my_ip</literal>,
<literal>vncserver_listen</literal>, and
<literal>vncserver_proxyclient_address</literal> to the IP address of the
compute node on the internal network.</para>
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.0.11</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 192.168.0.11</userinput>
<prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.0.11</userinput></screen>
<para os="ubuntu;debian">Edit <filename>/etc/nova/nova.conf</filename> and add to the <literal>[DEFAULT]</literal> section.</para>
<programlisting os="ubuntu;debian" language="ini">[DEFAULT]
...
my_ip=192.168.0.11
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.0.11</programlisting>
</step>
<step><para>Specify the host running the Image Service.<phrase os="ubuntu;debian"> Edit <filename>/etc/nova/nova.conf</filename> and add to the <literal>[DEFAULT]</literal> section.</phrase></para>
<screen os="fedora;rhel;centos;opensuse;sles"><prompt>#</prompt> <userinput>openstack-config --set /etc/nova/nova.conf DEFAULT glance_host <replaceable>controller</replaceable></userinput></screen>
<programlisting os="ubuntu;debian" language="ini">[DEFAULT]
...
glance_host=<replaceable>controller</replaceable></programlisting>
</step>
<step><para>Copy the file <filename>/etc/nova/api-paste.ini</filename> from the
<replaceable>controller</replaceable> node, or edit the file to add the credentials in the
<literal>[filter:authtoken]</literal> section.</para>
<programlisting language="ini">[filter:authtoken]
paste.filter_factory=keystoneclient.middleware.auth_token:filter_factory
auth_host=controller
auth_port = 35357
auth_protocol = http
admin_user=nova
admin_tenant_name=service
admin_password=<replaceable>NOVA_DBPASS</replaceable>
</programlisting>
<note os="fedora;rhel;centos;opensuse;sles"><para>Ensure that <filename>api_paste_config=/etc/nova/api-paste.ini</filename> is set in
<filename>/etc/nova/nova.conf</filename>.</para></note>
</step>
<step>
<para os="fedora;rhel;centos;opensuse;sles">Start the Compute service and configure it to start when the system boots.</para>
<para os="ubuntu;debian">Restart the Compute service.</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>service nova-compute restart</userinput></screen>
<screen os="centos;rhel;fedora;opensuse;sles"><prompt>#</prompt> <userinput>service openstack-nova-compute start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-nova-compute on</userinput></screen>
</step>
</procedure>
</section>