OpenStack Keystone port 5000 used by Python

openstackopenstack-keystone

I'm following official OpenStack documentation to build my first environment and got stuck in configuring Keystone (last step from http://docs.openstack.org/kilo/install-guide/install/apt/content/keystone-install.html)

While trying to restart apache I get error message about port 5000 being used

 * Restarting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:5000
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:5000
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

Netstat says the port is used by Python and further investigation shows it's somehow related to Keystone

/usr/bin/python /usr/bin/keystone-all --config-file=/etc/keystone/keystone.conf --log-file=/var/log/keystone/keystone.log

Which way should I take up in this situation? Reconfigure apache to use a different port, or try to deal with Python to use a different one?

EDIT

Referring to https://ask.openstack.org/en/question/47137/devstack-fails-to-start-apache2-address-already-in-use-could-not-bind-to-address/ I modified /etc/apache2/sites-available/wsgi-keystone.conf from <VirtualHost *:5000> to <VirtualHost *:80>, but the error persisted. The message right now is

 * Restarting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:35357
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:35357
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

Apache error log obviously is empty, so I cannot go there to find anything helpful.

Best Answer

The error you see is because Keystone is running using the deprecated Eventlet, thus it is listening on the port 5000. In order to get it working with Apache, you have to stop and disable the Keystone service before. Keystone won't be executed as a service, as it will be executed as a WSGI application in Apache using mod_wsgi.

So, to get things working, roll back your configuration so that you have <VirtualHost *:5000> again. Then, stop and disable the keystone service and restart Apache:

service keystone stop
update-rc.d keystone disable
service apache2 restart
Related Topic