3 ===============================
4 radosgw -- rados REST gateway
5 ===============================
18 :program:`radosgw` is an HTTP REST gateway for the RADOS object store, a part
19 of the Ceph distributed storage system. It is implemented as a FastCGI
20 module using libfcgi, and can be used in conjunction with any FastCGI
27 .. option:: -c ceph.conf, --conf=ceph.conf
29 Use ``ceph.conf`` configuration file instead of the default
30 ``/etc/ceph/ceph.conf`` to determine monitor addresses during startup.
32 .. option:: -m monaddress[:port]
34 Connect to specified monitor (instead of looking through ``ceph.conf``).
36 .. option:: -i ID, --id ID
38 Set the ID portion of name for radosgw
40 .. option:: -n TYPE.ID, --name TYPE.ID
42 Set the rados user name for the gateway (eg. client.radosgw.gateway)
44 .. option:: --cluster NAME
46 Set the cluster name (default: ceph)
50 Run in foreground, log to stderr
54 Run in foreground, log to usual location
56 .. option:: --rgw-region=region
58 The region where radosgw runs
60 .. option:: --rgw-zone=zone
62 The zone where radosgw runs
68 Earlier RADOS Gateway had to be configured with ``Apache`` and ``mod_fastcgi``.
69 Now, ``mod_proxy_fcgi`` module is used instead of ``mod_fastcgi``.
70 ``mod_proxy_fcgi`` works differently than a traditional FastCGI module. This
71 module requires the service of ``mod_proxy`` which provides support for the
72 FastCGI protocol. So, to be able to handle FastCGI protocol, both ``mod_proxy``
73 and ``mod_proxy_fcgi`` have to be present in the server. Unlike ``mod_fastcgi``,
74 ``mod_proxy_fcgi`` cannot start the application process. Some platforms have
75 ``fcgistarter`` for that purpose. However, external launching of application
76 or process management may be available in the FastCGI application framework
79 ``Apache`` must be configured in a way that enables ``mod_proxy_fcgi`` to be
80 used with localhost tcp.
82 The following steps show the configuration in Ceph's configuration file i.e,
83 ``/etc/ceph/ceph.conf`` and the gateway configuration file i.e,
84 ``/etc/httpd/conf.d/rgw.conf`` (RPM-based distros) or
85 ``/etc/apache2/conf-available/rgw.conf`` (Debian-based distros) with localhost
88 #. For distros with Apache 2.2 and early versions of Apache 2.4 that use
89 localhost TCP, append the following contents to ``/etc/ceph/ceph.conf``::
91 [client.radosgw.gateway]
93 keyring = /etc/ceph/ceph.client.radosgw.keyring
94 log_file = /var/log/ceph/client.radosgw.gateway.log
95 rgw_frontends = fastcgi socket_port=9000 socket_host=0.0.0.0
96 rgw_print_continue = false
98 #. Add the following content in the gateway configuration file:
100 For Debian/Ubuntu add in ``/etc/apache2/conf-available/rgw.conf``::
104 DocumentRoot /var/www/html
106 ErrorLog /var/log/apache2/rgw_error.log
107 CustomLog /var/log/apache2/rgw_access.log combined
113 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
115 SetEnv proxy-nokeepalive 1
117 ProxyPass / fcgi://localhost:9000/
121 For CentOS/RHEL add in ``/etc/httpd/conf.d/rgw.conf``::
125 DocumentRoot /var/www/html
127 ErrorLog /var/log/httpd/rgw_error.log
128 CustomLog /var/log/httpd/rgw_access.log combined
134 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
136 SetEnv proxy-nokeepalive 1
138 ProxyPass / fcgi://localhost:9000/
142 #. Add the following content in the gateway configuration file:
144 For CentOS/RHEL add in ``/etc/httpd/conf.d/rgw.conf``::
148 DocumentRoot /var/www/html
150 ErrorLog /var/log/httpd/rgw_error.log
151 CustomLog /var/log/httpd/rgw_access.log combined
157 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
159 SetEnv proxy-nokeepalive 1
161 ProxyPass / unix:///var/run/ceph/ceph.radosgw.gateway.fastcgi.sock|fcgi://localhost:9000/
165 #. Generate a key for radosgw to use for authentication with the cluster. ::
167 ceph-authtool -C -n client.radosgw.gateway --gen-key /etc/ceph/keyring.radosgw.gateway
168 ceph-authtool -n client.radosgw.gateway --cap mon 'allow rw' --cap osd 'allow rwx' /etc/ceph/keyring.radosgw.gateway
170 #. Add the key to the auth entries. ::
172 ceph auth add client.radosgw.gateway --in-file=keyring.radosgw.gateway
174 #. Start Apache and radosgw.
178 sudo /etc/init.d/apache2 start
179 sudo /etc/init.d/radosgw start
184 sudo /etc/init.d/ceph-radosgw start
189 :program:`radosgw` maintains an asynchronous usage log. It accumulates
190 statistics about user operations and flushes it periodically. The
191 logs can be accessed and managed through :program:`radosgw-admin`.
193 The information that is being logged contains total data transfer,
194 total operations, and total successful operations. The data is being
195 accounted in an hourly resolution under the bucket owner, unless the
196 operation was done on the service (e.g., when listing a bucket) in
197 which case it is accounted under the operating user.
199 Following is an example configuration::
201 [client.radosgw.gateway]
202 rgw enable usage log = true
203 rgw usage log tick interval = 30
204 rgw usage log flush threshold = 1024
205 rgw usage max shards = 32
206 rgw usage max user shards = 1
209 The total number of shards determines how many total objects hold the
210 usage log information. The per-user number of shards specify how many
211 objects hold usage information for a single user. The tick interval
212 configures the number of seconds between log flushes, and the flush
213 threshold specify how many entries can be kept before resorting to
220 :program:`radosgw` is part of Ceph, a massively scalable, open-source, distributed
221 storage system. Please refer to the Ceph documentation at https://docs.ceph.com for
228 :doc:`ceph <ceph>`\(8)
229 :doc:`radosgw-admin <radosgw-admin>`\(8)