Merge "setup: Remove pbr's wsgi_scripts"
This commit is contained in:
@@ -21,7 +21,7 @@ WSGI Application
|
||||
----------------
|
||||
|
||||
The function ``neutron.server.get_application`` will setup a WSGI application
|
||||
to run behind uwsgi and mod_wsgi.
|
||||
to run behind a WSGI server like uwsgi or mod_wsgi.
|
||||
|
||||
Neutron API behind uwsgi
|
||||
------------------------
|
||||
@@ -33,20 +33,20 @@ Create a ``/etc/neutron/neutron-api-uwsgi.ini`` file with the content below:
|
||||
[uwsgi]
|
||||
chmod-socket = 666
|
||||
socket = /var/run/uwsgi/neutron-api.socket
|
||||
start-time = %t
|
||||
lazy-apps = true
|
||||
add-header = Connection: close
|
||||
buffer-size = 65535
|
||||
hook-master-start = unix_signal:15 gracefully_kill_them_all
|
||||
thunder-lock = true
|
||||
plugins = python
|
||||
plugins = http,python3
|
||||
enable-threads = true
|
||||
worker-reload-mercy = 90
|
||||
worker-reload-mercy = 80
|
||||
exit-on-reload = false
|
||||
die-on-term = true
|
||||
master = true
|
||||
processes = 2
|
||||
wsgi-file = <path-to-neutron-bin-dir>/neutron-api
|
||||
start-time = %t
|
||||
module = neutron.wsgi.api:application
|
||||
|
||||
.. end
|
||||
|
||||
@@ -58,63 +58,6 @@ Start neutron-api:
|
||||
|
||||
.. end
|
||||
|
||||
Neutron API behind mod_wsgi
|
||||
---------------------------
|
||||
|
||||
Create ``/etc/apache2/neutron.conf`` with content below:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
Listen 9696
|
||||
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)" neutron_combined
|
||||
|
||||
<Directory /usr/local/bin>
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
<VirtualHost *:9696>
|
||||
WSGIDaemonProcess neutron-server processes=1 threads=1 user=stack display-name=%{GROUP}
|
||||
WSGIProcessGroup neutron-server
|
||||
WSGIScriptAlias / <path-to-neutron-bin-dir>/neutron-api
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
ErrorLogFormat "%M"
|
||||
ErrorLog /var/log/neutron/neutron.log
|
||||
CustomLog /var/log/neutron/neutron_access.log neutron_combined
|
||||
</VirtualHost>
|
||||
|
||||
Alias /networking <path-to-neutron-bin-dir>/neutron-api
|
||||
<Location /networking>
|
||||
SetHandler wsgi-script
|
||||
Options +ExecCGI
|
||||
WSGIProcessGroup neutron-server
|
||||
WSGIApplicationGroup %{GLOBAL}
|
||||
WSGIPassAuthorization On
|
||||
</Location>
|
||||
|
||||
WSGISocketPrefix /var/run/apache2
|
||||
|
||||
.. end
|
||||
|
||||
For deb-based systems copy or symlink the file to
|
||||
``/etc/apache2/sites-available``. Then enable the neutron site:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# a2ensite neutron
|
||||
# systemctl reload apache2.service
|
||||
|
||||
.. end
|
||||
|
||||
For rpm-based systems copy the file to ``/etc/httpd/conf.d``. Then enable the
|
||||
neutron site:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
# systemctl reload httpd.service
|
||||
|
||||
.. end
|
||||
|
||||
|
||||
Start Neutron RPC server
|
||||
------------------------
|
||||
|
@@ -65,52 +65,3 @@ command:
|
||||
.. code:: bash
|
||||
|
||||
$ telnet localhost 12345
|
||||
|
||||
|
||||
|
||||
Executing the generated Neutron API script
|
||||
------------------------------------------
|
||||
|
||||
The ``oslo-config-generator`` script can generate the script located in
|
||||
``[entry_points]wsgi_scripts``, called ``neutron-api``; this script will
|
||||
receive the same name. This script can be executed locally and will spawn
|
||||
a single process Neutron API server, running one single WSGI thread, regardless
|
||||
of the Neutron ``[DEFAULT]api_workers`` parameter.
|
||||
|
||||
It is not possible to pass any configuration file to this executable but the
|
||||
Neutron API will use the default ones ``/etc/neutron/neutron.conf`` and
|
||||
``/etc/neutron/plugins/ml2/ml2_conf.ini``. Any parameter needed by the Neutron
|
||||
API must be defined in these two files.
|
||||
|
||||
Because this script will run as a Python process, it is possible to attach a
|
||||
debugger or add a break point using ``pdb``. It is also possible to create a
|
||||
PyCharm "configuration" (using its own term) to execute the Neutron API using
|
||||
the PyCharm builtin debugger.
|
||||
|
||||
In order to run the Neutron API using this script, it is only needed to provide
|
||||
the listening port:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
$ neutron-api --port 8000
|
||||
|
||||
|
||||
Once running, it is needed to change the OpenStack endpoint for the networking
|
||||
service:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
$ openstack endpoint list
|
||||
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
|
||||
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
|
||||
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
|
||||
| 3959198c9b3f457cbb03cf49cd278415 | RegionOne | neutron | network | True | public | http://192.168.10.100/networking |
|
||||
| 5807512a0c344144a1bd4f3bda4d3316 | RegionOne | glance | image | True | public | http://192.168.10.100/image |
|
||||
| 6954de6553c84cb19d2f3441411ca897 | RegionOne | nova_legacy | compute_legacy | True | public | http://192.168.10.100/compute/v2/$(project_id)s |
|
||||
| 71fe40ea4e6e431cb800143b4349928c | RegionOne | keystone | identity | True | public | http://192.168.10.100/identity |
|
||||
| 73b86abeaca14e7ba18a53b8357dddee | RegionOne | nova | compute | True | public | http://192.168.10.100/compute/v2.1 |
|
||||
| 76f5c962173b419b994d86877070673e | RegionOne | placement | placement | True | public | http://192.168.10.100/placement |
|
||||
| 841199dad0b54acbb1c781e0b881cbf3 | RegionOne | designate | dns | True | public | http://192.168.10.100/dns |
|
||||
| f4b219c2287448e3add582204db7ac69 | RegionOne | cinder | block-storage | True | public | http://192.168.10.100/volume/v3 |
|
||||
+----------------------------------+-----------+--------------+----------------+---------+-----------+-------------------------------------------------+
|
||||
$ openstack endpoint set --url http://192.168.10.100:8000 3959198c9b3f457cbb03cf49cd278415
|
||||
|
@@ -0,0 +1,7 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The WSGI script ``neutron-api`` has been removed. Deployment tooling
|
||||
should instead reference the Python module path for this service,
|
||||
``neutron.wsgi.api``, if their chosen WSGI server supports this (gunicorn,
|
||||
uWSGI) or implement a ``.wsgi`` script themselves if not (mod_wsgi).
|
Reference in New Issue
Block a user