2011-09-09 23:21:52 +00:00
|
|
|
===============================
|
|
|
|
radosgw -- rados REST gateway
|
|
|
|
===============================
|
|
|
|
|
|
|
|
.. program:: radosgw
|
|
|
|
|
|
|
|
Synopsis
|
|
|
|
========
|
|
|
|
|
|
|
|
| **radosgw**
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
===========
|
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
:program:`radosgw` is an HTTP REST gateway for the RADOS object store, a part
|
2011-09-09 23:21:52 +00:00
|
|
|
of the Ceph distributed storage system. It is implemented as a FastCGI
|
|
|
|
module using libfcgi, and can be used in conjunction with any FastCGI
|
|
|
|
capable web server.
|
|
|
|
|
|
|
|
|
|
|
|
Options
|
|
|
|
=======
|
|
|
|
|
|
|
|
.. option:: -c ceph.conf, --conf=ceph.conf
|
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
Use ``ceph.conf`` configuration file instead of the default
|
2011-09-09 23:21:52 +00:00
|
|
|
``/etc/ceph/ceph.conf`` to determine monitor addresses during startup.
|
|
|
|
|
|
|
|
.. option:: -m monaddress[:port]
|
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
Connect to specified monitor (instead of looking through ``ceph.conf``).
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2014-07-24 15:00:43 +00:00
|
|
|
.. option:: -i ID, --id ID
|
|
|
|
|
|
|
|
Set the ID portion of name for radosgw
|
|
|
|
|
|
|
|
.. option:: -n TYPE.ID, --name TYPE.ID
|
|
|
|
|
|
|
|
Set the rados user name for the gateway (eg. client.radosgw.gateway)
|
|
|
|
|
|
|
|
.. option:: --cluster NAME
|
|
|
|
|
|
|
|
Set the cluster name (default: ceph)
|
|
|
|
|
|
|
|
.. option:: -d
|
|
|
|
|
|
|
|
Run in foreground, log to stderr
|
|
|
|
|
|
|
|
.. option:: -f
|
|
|
|
|
|
|
|
Run in foreground, log to usual location
|
|
|
|
|
2011-09-09 23:21:52 +00:00
|
|
|
.. option:: --rgw-socket-path=path
|
|
|
|
|
|
|
|
Specify a unix domain socket path.
|
|
|
|
|
2014-07-24 15:00:43 +00:00
|
|
|
.. option:: --rgw-region=region
|
|
|
|
|
|
|
|
The region where radosgw runs
|
|
|
|
|
|
|
|
.. option:: --rgw-zone=zone
|
|
|
|
|
|
|
|
The zone where radosgw runs
|
|
|
|
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2012-02-17 22:09:55 +00:00
|
|
|
Configuration
|
|
|
|
=============
|
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
Earlier RADOS Gateway had to be configured with ``Apache`` and ``mod_fastcgi``.
|
2015-01-14 18:53:17 +00:00
|
|
|
Now, ``mod_proxy_fcgi`` module is used instead of ``mod_fastcgi`` as the later
|
|
|
|
doesn't come under a free license. ``mod_proxy_fcgi`` works differently than a
|
|
|
|
traditional FastCGI module. This module requires the service of ``mod_proxy``
|
|
|
|
which provides support for the FastCGI protocol. So, to be able to handle
|
|
|
|
FastCGI protocol, both ``mod_proxy`` and ``mod_proxy_fcgi`` have to be present
|
|
|
|
in the server. Unlike ``mod_fastcgi``, ``mod_proxy_fcgi`` cannot start the
|
|
|
|
application process. Some platforms have ``fcgistarter`` for that purpose.
|
|
|
|
However, external launching of application or process management may be available
|
|
|
|
in the FastCGI application framework in use.
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
``Apache`` can be configured in a way that enables ``mod_proxy_fcgi`` to be used
|
|
|
|
with localhost tcp or through unix domain socket. ``mod_proxy_fcgi`` that doesn't
|
|
|
|
support unix domain socket such as the ones in Apache 2.2 and earlier versions of
|
|
|
|
Apache 2.4, needs to be configured for use with localhost tcp.
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
#. Modify ``/etc/ceph/ceph.conf`` file to make radosgw use tcp instead of unix
|
|
|
|
domain socket. ::
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
[client.radosgw.gateway]
|
|
|
|
host = gateway
|
|
|
|
keyring = /etc/ceph/keyring.radosgw.gateway
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
; ********
|
|
|
|
; tcp fastcgi
|
|
|
|
rgw socket path = ""
|
|
|
|
rgw frontends = fastcgi socket_port=9000 socket_host=0.0.0.0
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
#. Modify Apache's configuration file so that ``mod_proxy_fcgi`` can be used
|
2015-01-20 16:26:14 +00:00
|
|
|
with localhost tcp.
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
Debian/Ubuntu::
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
<VirtualHost *:80>
|
|
|
|
ServerName localhost
|
|
|
|
DocumentRoot /var/www/html
|
2012-02-17 22:09:55 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
ErrorLog /var/log/apache2/error.log
|
|
|
|
CustomLog /var/log/apache2/access.log combined
|
2012-02-17 22:09:55 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
LogLevel debug
|
2012-02-17 22:09:55 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
RewriteEngine On
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
SetEnv proxy-nokeepalive 1
|
|
|
|
|
|
|
|
ProxyPass / fcgi://127.0.01:9000/
|
|
|
|
</VirtualHost>
|
|
|
|
|
|
|
|
CentOS/RHEL::
|
|
|
|
|
|
|
|
<VirtualHost *:80>
|
|
|
|
ServerName localhost
|
|
|
|
DocumentRoot /var/www/html
|
|
|
|
|
|
|
|
ErrorLog /var/log/httpd/error.log
|
|
|
|
CustomLog /var/log/httpd/access.log combined
|
|
|
|
|
|
|
|
LogLevel debug
|
|
|
|
|
|
|
|
|
|
|
|
RewriteEngine On
|
|
|
|
|
|
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
|
|
|
|
|
|
|
SetEnv proxy-nokeepalive 1
|
|
|
|
|
|
|
|
ProxyPass / fcgi://127.0.01:9000/
|
|
|
|
</VirtualHost>
|
2015-01-14 18:53:17 +00:00
|
|
|
|
|
|
|
#. Modify Apache's configuration file so that ``mod_proxy_fcgi`` can be used
|
2015-01-20 16:26:14 +00:00
|
|
|
through unix domain socket.
|
|
|
|
|
|
|
|
Debian/Ubuntu::
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
<VirtualHost *:80>
|
|
|
|
ServerName localhost
|
|
|
|
DocumentRoot /var/www/html
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
ErrorLog /var/log/apache2/error.log
|
|
|
|
CustomLog /var/log/apache2/access.log combined
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
LogLevel debug
|
2015-01-14 18:53:17 +00:00
|
|
|
|
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
RewriteEngine On
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
2015-01-14 18:53:17 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
ProxyPass / unix:///tmp/.radosgw.sock|fcgi://localhost:9000/ disablereuse=On
|
|
|
|
</VirtualHost>
|
|
|
|
|
|
|
|
CentOS/RHEL::
|
|
|
|
|
|
|
|
<VirtualHost *:80>
|
|
|
|
ServerName localhost
|
|
|
|
DocumentRoot /var/www/html
|
|
|
|
|
|
|
|
ErrorLog /var/log/httpd/error.log
|
|
|
|
CustomLog /var/log/httpd/access.log combined
|
|
|
|
|
|
|
|
LogLevel debug
|
|
|
|
|
|
|
|
|
|
|
|
RewriteEngine On
|
|
|
|
|
|
|
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
|
|
|
|
|
|
|
|
ProxyPass / unix:///tmp/.radosgw.sock|fcgi://localhost:9000/ disablereuse=On
|
|
|
|
</VirtualHost>
|
2015-01-14 18:53:17 +00:00
|
|
|
|
|
|
|
#. Generate a key for radosgw to use for authentication with the cluster. ::
|
2012-02-17 22:09:55 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
ceph-authtool -C -n client.radosgw.gateway --gen-key /etc/ceph/keyring.radosgw.gateway
|
|
|
|
ceph-authtool -n client.radosgw.gateway --cap mon 'allow rw' --cap osd 'allow rwx' /etc/ceph/keyring.radosgw.gateway
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
#. Add the key to the auth entries. ::
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
ceph auth add client.radosgw.gateway --in-file=keyring.radosgw.gateway
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
#. Start Apache and radosgw.
|
|
|
|
|
|
|
|
Debian/Ubuntu::
|
|
|
|
|
|
|
|
sudo /etc/init.d/apache2 start
|
|
|
|
sudo /etc/init.d/radosgw start
|
|
|
|
|
|
|
|
CentOS/RHEL::
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2015-01-20 16:26:14 +00:00
|
|
|
sudo apachectl start
|
|
|
|
sudo /etc/init.d/ceph-radosgw start
|
2011-09-09 23:21:52 +00:00
|
|
|
|
2012-06-19 22:17:53 +00:00
|
|
|
Usage Logging
|
|
|
|
=============
|
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
:program:`radosgw` maintains an asynchronous usage log. It accumulates
|
2012-06-19 22:17:53 +00:00
|
|
|
statistics about user operations and flushes it periodically. The
|
2015-01-14 18:53:17 +00:00
|
|
|
logs can be accessed and managed through :program:`radosgw-admin`.
|
2012-06-19 22:17:53 +00:00
|
|
|
|
2012-06-21 17:46:55 +00:00
|
|
|
The information that is being logged contains total data transfer,
|
2012-06-19 22:17:53 +00:00
|
|
|
total operations, and total successful operations. The data is being
|
2012-06-21 17:46:55 +00:00
|
|
|
accounted in an hourly resolution under the bucket owner, unless the
|
|
|
|
operation was done on the service (e.g., when listing a bucket) in
|
|
|
|
which case it is accounted under the operating user.
|
2012-06-19 22:17:53 +00:00
|
|
|
|
|
|
|
Following is an example configuration::
|
|
|
|
|
|
|
|
[client.radosgw.gateway]
|
|
|
|
rgw enable usage log = true
|
|
|
|
rgw usage log tick interval = 30
|
|
|
|
rgw usage log flush threshold = 1024
|
|
|
|
rgw usage max shards = 32
|
|
|
|
rgw usage max user shards = 1
|
|
|
|
|
|
|
|
|
|
|
|
The total number of shards determines how many total objects hold the
|
|
|
|
usage log information. The per-user number of shards specify how many
|
|
|
|
objects hold usage information for a single user. The tick interval
|
|
|
|
configures the number of seconds between log flushes, and the flush
|
|
|
|
threshold specify how many entries can be kept before resorting to
|
|
|
|
synchronous flush.
|
|
|
|
|
|
|
|
|
2011-09-09 23:21:52 +00:00
|
|
|
Availability
|
|
|
|
============
|
|
|
|
|
2015-01-14 18:53:17 +00:00
|
|
|
:program:`radosgw` is part of Ceph, a massively scalable, open-source, distributed
|
|
|
|
storage system. Please refer to the Ceph documentation at http://ceph.com/docs for
|
|
|
|
more information.
|
2011-09-09 23:21:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
See also
|
|
|
|
========
|
|
|
|
|
|
|
|
:doc:`ceph <ceph>`\(8)
|
2012-06-19 22:17:53 +00:00
|
|
|
:doc:`radosgw-admin <radosgw-admin>`\(8)
|