Change apache2 CGI module for RadosGW

In apache-2.4.7 fastcgi module is not support chunked transfer.
It breaks uploads of objects to RadosGW.
Fix available since apache-2.4.10 (vivid) and upgrade apache in MOS is not
possible, so this workaround proposed.
RadosGW runs with native CGI server on 127.0.0.1:9000 and apache uses
mod_proxy_fcgi to proxy user requests to rados.

Closes-bug: #1521623
Closes-bug: #1505273

Change-Id: Ia3959c4009c6c673074a9b7536b1cc87834c301d
(cherry picked from commit e8567ee17b)
This commit is contained in:
Andrey Shestakov
2015-12-16 16:05:18 +02:00
committed by Alex Schultz
parent 9cbb065084
commit b092234605
5 changed files with 10 additions and 14 deletions

View File

@@ -39,6 +39,7 @@ class ceph (
$swift_endpoint_port = '8080',
$rgw_keyring_path = '/etc/ceph/keyring.radosgw.gateway',
$rgw_socket_path = '/tmp/radosgw.sock',
$rgw_frontends = 'fastcgi socket_port=9000 socket_host=127.0.0.1',
$rgw_log_file = '/var/log/ceph/radosgw.log',
$rgw_use_keystone = true,
$rgw_use_pki = false,

View File

@@ -14,6 +14,7 @@ class ceph::radosgw (
$swift_endpoint_port = $::ceph::swift_endpoint_port,
$rgw_keyring_path = $::ceph::rgw_keyring_path,
$rgw_socket_path = $::ceph::rgw_socket_path,
$rgw_frontends = $::ceph::rgw_frontends,
$rgw_log_file = $::ceph::rgw_log_file,
$rgw_data = $::ceph::rgw_data,
$rgw_dns_name = $::ceph::rgw_dns_name,
@@ -84,6 +85,7 @@ class ceph::radosgw (
"client.${rgw_id}/host": value => $rgw_host;
"client.${rgw_id}/keyring": value => $keyring_path;
"client.${rgw_id}/rgw_socket_path": value => $rgw_socket_path;
"client.${rgw_id}/rgw_frontends": value => $rgw_frontends;
"client.${rgw_id}/user": value => $rgw_user;
"client.${rgw_id}/rgw_data": value => $rgw_data;
"client.${rgw_id}/rgw_dns_name": value => $rgw_dns_name;

View File

@@ -1,23 +1,14 @@
Listen <%= @rgw_ip %>:<%= @rgw_port %>
FastCgiExternalServer <%= @dir_httpd_root %>/s3gw.fcgi -socket /tmp/radosgw.sock
<VirtualHost <%= @rgw_ip %>:<%= @rgw_port %>>
ServerName <%= @fqdn %>
DocumentRoot <%= @dir_httpd_root %>
RewriteEngine On
RewriteRule ^/([a-zA-Z0-9-_.]*)([/]?.*) /s3gw.fcgi?page=$1&params=$2&%{QUERY_STRING} [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
<IfModule mod_fastcgi.c>
<Directory <%= @dir_httpd_root %>>
Options +ExecCGI
AllowOverride All
SetHandler fastcgi-script
Order allow,deny
Allow from all
AuthBasicAuthoritative Off
</Directory>
</IfModule>
SetEnv proxy-nokeepalive 1
ProxyPass / fcgi://127.0.0.1:9000/
## Logging
ErrorLog "<%= @dir_httpd_log %>radosgw_error.log"

View File

@@ -35,7 +35,7 @@ if $use_ceph and $storage_hash['objects_ceph'] {
if ($::osfamily == 'Debian'){
apache::mod {'rewrite': }
apache::mod {'fastcgi': }
apache::mod {'proxy_fcgi': }
}
include ::tweaks::apache_wrappers
@@ -78,6 +78,7 @@ if $use_ceph and $storage_hash['objects_ceph'] {
swift_endpoint_port => '8080',
rgw_keyring_path => '/etc/ceph/keyring.radosgw.gateway',
rgw_socket_path => '/tmp/radosgw.sock',
rgw_frontends => 'fastcgi socket_port=9000 socket_host=127.0.0.1',
rgw_log_file => '/var/log/ceph/radosgw.log',
rgw_data => '/var/lib/ceph/radosgw',
rgw_dns_name => "*.${::domain}",

View File

@@ -12,7 +12,8 @@ describe manifest do
rgw_s3_auth_use_keystone = Noop.hiera 'rgw_s3_auth_use_keystone', true
it { should contain_class('ceph::radosgw').with(
'primary_mon' => ceph_monitor_nodes.keys[0],
'primary_mon' => ceph_monitor_nodes.keys[0],
'rgw_frontends' => 'fastcgi socket_port=9000 socket_host=127.0.0.1',
)
}