Browse Source

Merge "Add uWSGI configuration samples" into stable/stein

Zuul 1 month ago
committed by Gerrit Code Review
4 changed files with 101 additions and 0 deletions
  1. +79
  2. +1
  3. +18
  4. +3

+ 79
- 0
doc/source/contributor/apache-httpd.rst View File

@@ -0,0 +1,79 @@
Running manila API with a web server

As part of the `community goals for Pike`_, manila has packaged
a wsgi script entrypoint that allows you to run it with a real web server
like Apache HTTPD or NGINX.

This doc shows a sample of deploying manila with uwsgi

Installing the API via uwsgi

For this deployment we use uwsgi as a web server bound to a random
local port. Then we configure apache using mod_proxy to forward all incoming
requests on the specified endpoint to that local webserver. This has the
advantage of letting apache manage all inbound http connections, but allowing
uwsgi run the python code. This also means that when we make
changes to manila code or configuration we don't need to restart all of apache
(which may be running other services as well) and just need to restart the local
uwsgi daemon.

The httpd/ directory contains sample files for configuring HTTPD to run manila
under uwsgi. To use sample configs, simply copy `httpd/uwsgi-manila.conf` to the
appropiate location for your apache server.

On RHEL/CentOS/Fedora it is::


On SLES/OpenSUSE it is::


On Debian/Ubuntu it is::


Enable mod_proxy by running ``sudo a2enmod proxy``

On Ubuntu/Debian systems enable the site using the a2ensite tool::

sudo a2ensite /etc/apache2/sites-available/uwsgi-manila.conf

This is not required on RHEL/CentOS/Fedora systems.

Start or restart HTTPD/Apache2 to pick up the new configuration.

Now we have to configure and start the uwsgi service.
Copy the `httpd/manila-uwsgi.ini` file to `/etc/manila`. Update the file to
match your system configuration (i.e. tweak the number of processes and threads)

Install uwsgi.

On RHEL/CentOS::

sudo yum install uwsgi-plugin-python3

On Fedora::

sudo dnf install uwsgi-plugin-python3


sudo zypper install uwsgi-python3

On Ubuntu/Debian::

sudo apt-get install uwsgi-plugin-python3

And start the manila server using uwsgi::

uwsgi --ini /etc/manila/manila-uwsgi.ini

.. NOTE::

In the sample configs port 51999 is used, this is a randomly selected number.

.. _community goals for Pike:

+ 1
- 0
doc/source/contributor/index.rst View File

@@ -28,6 +28,7 @@ Programming HowTos and Tutorials


+ 18
- 0
httpd/manila-uwsgi.ini View File

@@ -0,0 +1,18 @@
socket-timeout = 10
http-auto-chunked = true
http-chunked-input = true
http-raw-body = true
chmod-socket = 666
lazy-apps = true
add-header = Connection: close
buffer-size = 65535
thunder-lock = true
plugins = python
enable-threads = true
exit-on-reload = true
die-on-term = true
master = true
processes = 4
http-socket =
wsgi-file = /usr/local/bin/manila-wsgi-api

+ 3
- 0
httpd/uwsgi-manila.conf View File

@@ -0,0 +1,3 @@
KeepAlive Off
SetEnv proxy-sendchunked 1
ProxyPass "/share" "" retry=0