openstack-manuals/doc/install-guide/object-storage/section_object-storage-install-config-proxy-node.xml
Christian Berendt a2d662d600 Unified the syntax of the XML root element (install-guide)
The XML root element of Docbook XML files should match the following
format:

<ELEMENT 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="THE_XML_ID_OF_THE_ELEMENT">

Change-Id: I1e0804e2c5021bd78b77483f3156c5b069453555
2014-07-09 22:19:31 +02:00

201 lines
10 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="installing-and-configuring-the-proxy-node">
<title>Install and configure the proxy node</title>
<para>The proxy server takes each request and looks up locations
for the account, container, or object and routes the requests
correctly. The proxy server also handles API requests. You
enable account management by configuring it in the
<filename>/etc/swift/proxy-server.conf</filename> file.</para>
<note>
<para>The Object Storage processes run under a separate user
and group, set by configuration options, and referred to as
<literal>swift:swift</literal>. The default
user is <literal>swift</literal>.</para>
</note>
<procedure>
<step>
<para>Install swift-proxy service:</para>
<screen os="ubuntu;debian"><prompt>#</prompt> <userinput>apt-get install swift swift-proxy memcached python-keystoneclient python-swiftclient python-webob</userinput></screen>
<screen os="rhel;centos;fedora"><prompt>#</prompt> <userinput>yum install openstack-swift-proxy memcached python-swiftclient python-keystone-auth-token</userinput></screen>
<screen os="opensuse;sles"><prompt>#</prompt> <userinput>zypper install openstack-swift-proxy memcached python-swiftclient python-keystoneclient python-xml</userinput></screen>
</step>
<step os="ubuntu;debian">
<para>Modify memcached to listen on the default interface
on a local, non-public network. Edit this line in
the <filename>/etc/memcached.conf</filename> file:</para>
<programlisting>-l 127.0.0.1</programlisting>
<para>Change it to:</para>
<programlisting>-l <replaceable>PROXY_LOCAL_NET_IP</replaceable></programlisting>
</step>
<step os="rhel;centos;fedora;opensuse;sles">
<para>Modify memcached to listen on the default interface
on a local, non-public network. Edit
the <filename>/etc/sysconfig/memcached</filename> file:</para>
<programlisting os="rhel;centos;fedora">OPTIONS="-l <replaceable>PROXY_LOCAL_NET_IP</replaceable>"</programlisting>
<programlisting os="opensuse;sles">MEMCACHED_PARAMS="-l <replaceable>PROXY_LOCAL_NET_IP</replaceable>"</programlisting>
</step>
<step os="ubuntu;debian">
<para>Restart the memcached service:</para>
<screen><prompt>#</prompt> <userinput>service memcached restart</userinput></screen>
</step>
<step os="rhel;centos;fedora;opensuse;sles">
<para>Start the memcached service and configure it to start when
the system boots:</para>
<screen><prompt>#</prompt> <userinput>service memcached start</userinput>
<prompt>#</prompt> <userinput>chkconfig memcached on</userinput></screen>
</step>
<step>
<para><phrase os="ubuntu;debian">Create</phrase>
<phrase os="rhel;centos;fedora;opensuse;sles">Edit</phrase>
<filename>/etc/swift/proxy-server.conf</filename>:</para>
<programlisting language="ini">[DEFAULT]
bind_port = 8080
user = swift
[pipeline:main]
pipeline = catch_errors gatekeeper healthcheck proxy-logging cache authtoken keystoneauth proxy-logging proxy-server
[app:proxy-server]
use = egg:swift#proxy
allow_account_management = true
account_autocreate = true
[filter:keystoneauth]
use = egg:swift#keystoneauth
operator_roles = Member,admin,swiftoperator
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
# Delaying the auth decision is required to support token-less
# usage for anonymous referrers ('.r:*').
delay_auth_decision = true
# auth_* settings refer to the Keystone server
auth_protocol = http
auth_host = <replaceable>controller</replaceable>
auth_uri = http://controller:5000
# the service tenant and swift username and password created in Keystone
admin_tenant_name = service
admin_user = swift
admin_password = <replaceable>SWIFT_PASS</replaceable>
[filter:healthcheck]
use = egg:swift#healthcheck
[filter:cache]
use = egg:swift#memcache
set log_name = cache
[filter:catch_errors]
use = egg:swift#catch_errors
[filter:gatekeeper]
use = egg:swift#gatekeeper
[filter:proxy-logging]
use = egg:swift#proxy_logging
</programlisting>
<note>
<para>If you run multiple memcache servers, put the
multiple IP:port listings in the [filter:cache]
section of the
<filename>/etc/swift/proxy-server.conf</filename> file:</para>
<literallayout class="monospaced">10.1.2.3:11211,10.1.2.4:11211</literallayout>
<para>Only the proxy server uses memcache.</para>
</note>
<warning>
<para><literal>keystoneclient.middleware.auth_token</literal>: You
must configure <literal>auth_uri</literal> to point to the public
identity endpoint. Otherwise, clients might not be able to
authenticate against an admin endpoint.
</para>
</warning>
</step>
<step>
<para>Create the account, container, and object rings. The
builder command creates a builder file
with a few parameters. The parameter with the value of
18 represents 2 ^ 18th, the value that the partition
is sized to. Set this “partition power” value
based on the total amount of storage you expect your
entire ring to use. The value 3 represents the
number of replicas of each object, with the last value
being the number of hours to restrict moving a
partition more than once.</para>
<screen><prompt>#</prompt> <userinput>cd /etc/swift</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder account.builder create 18 3 1</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder container.builder create 18 3 1</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder object.builder create 18 3 1</userinput></screen>
</step>
<step>
<para>For every storage device on each node add entries to
each ring:</para>
<screen><prompt>#</prompt> <userinput>swift-ring-builder account.builder add z<replaceable>ZONE</replaceable>-<replaceable>STORAGE_LOCAL_NET_IP</replaceable>:6002[R<replaceable>STORAGE_REPLICATION_NET_IP</replaceable>:6005]/<replaceable>DEVICE</replaceable> 100</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder container.builder add z<replaceable>ZONE</replaceable>-<replaceable>STORAGE_LOCAL_NET_IP_1</replaceable>:6001[R<replaceable>STORAGE_REPLICATION_NET_IP</replaceable>:6004]/<replaceable>DEVICE</replaceable> 100</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder object.builder add z<replaceable>ZONE</replaceable>-<replaceable>STORAGE_LOCAL_NET_IP_1</replaceable>:6000[R<replaceable>STORAGE_REPLICATION_NET_IP</replaceable>:6003]/<replaceable>DEVICE</replaceable> 100</userinput></screen>
<note>
<para>You must omit the optional <parameter>STORAGE_REPLICATION_NET_IP</parameter> parameter if you
do not want to use dedicated network for
replication.</para>
</note>
<para>For example, if a storage node
has a partition in Zone 1 on IP 10.0.0.1, the storage node has
address 10.0.1.1 from replication network. The mount point of
this partition is <filename>/srv/node/sdb1</filename>, and the
path in <filename>/etc/rsyncd.conf</filename> is
<filename>/srv/node/</filename>, the DEVICE would be sdb1 and
the commands are:</para>
<screen><prompt>#</prompt> <userinput>swift-ring-builder account.builder add z1-10.0.0.1:6002R10.0.1.1:6005/sdb1 100</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder container.builder add z1-10.0.0.1:6001R10.0.1.1:6004/sdb1 100</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder object.builder add z1-10.0.0.1:6000R10.0.1.1:6003/sdb1 100</userinput></screen>
<note>
<para>If you assume five zones with one node for each
zone, start ZONE at 1. For each additional node,
increment ZONE by 1.</para>
</note>
</step>
<step>
<para>Verify the ring contents for each ring:</para>
<screen><prompt>#</prompt> <userinput>swift-ring-builder account.builder</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder container.builder</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder object.builder</userinput></screen>
</step>
<step>
<para>Rebalance the rings:</para>
<screen><prompt>#</prompt> <userinput>swift-ring-builder account.builder rebalance</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder container.builder rebalance</userinput>
<prompt>#</prompt> <userinput>swift-ring-builder object.builder rebalance</userinput></screen>
<note>
<para>Rebalancing rings can take some time.</para>
</note>
</step>
<step>
<para>Copy the <filename>account.ring.gz</filename>,
<filename>container.ring.gz</filename>, and
<filename>object.ring.gz</filename> files to each
of the Proxy and Storage nodes in <filename>/etc/swift</filename>.</para>
</step>
<step>
<para>Make sure the swift user owns all configuration files:</para>
<screen><prompt>#</prompt> <userinput>chown -R swift:swift /etc/swift</userinput></screen>
</step>
<step os="ubuntu;debian">
<para>Restart the Proxy service:</para>
<screen><prompt>#</prompt> <userinput>service swift-proxy restart</userinput></screen>
</step>
<step os="rhel;centos;fedora;sles;opensuse">
<para>Start the Proxy service and configure it to start when the
system boots:</para>
<screen><prompt>#</prompt> <userinput>service openstack-swift-proxy start</userinput>
<prompt>#</prompt> <userinput>chkconfig openstack-swift-proxy on</userinput></screen>
</step>
</procedure>
</section>