Browse code

Set keystone admin_bind_host to KEYSTONE_SERVICE_HOST

NOTE: squashed with follow-up Make admin_bind_host configurable
to avoid regression bug #1283803

On Linux ports 32768-61000 can be used by just about
anything needing a socket. Keystone's IANA assigned port is 35357.
Occasionally something else will be using port 35357 first because Linux
allows this. Workaround is to bind to port 127.0.0.1 instead of 0.0.0.0.
$KEYSTONE_SERVICE_HOST gets its value from $SERVICE_HOST which is set to
127.0.0.1 in the gate.

"Ephemeral (client) ports will *never* be sourced from 0.0.0.0, and are
uniquely identified by the full connection five-tuple (proto, src IP,
src port, dst IP, dst port) anyway, allowing them to overlap src IP/src
port as long as proto/dst IP/dst port are different. Thus it is up to
keystone/devstack to bind more appropriately and not use wildcard bind
addresses unless explicitly necessary for some reason. For example, in
the log output, the URLs are configured with dst IPs of 127.0.0.1
anyway, so binding explicitly to localhost would change nothing, while
skirting this particular edge case nicely." ~Evan Callicoat

This doesn't fix bug 1253482 it works around it while a better solution
is prepared (running keystone behind apache in devstack).

Co-Authored-By: Joe Gordon <joe.gordon0@gmail.com>
Change-Id: I112309661dadf8b753c3311182f82464d9d3595e
Related-bug: #1253482
(cherry picked from commit 6c57fbab26e40af5c5b19b46fb3da39341f34dab)
(cherry picked from commit 041fa712472d887550a540dd50ade546f847c6b4)

Clark Boylan authored on 2013/11/21 10:00:21
Showing 1 changed files
... ...
@@ -69,6 +69,8 @@ KEYSTONE_SERVICE_PORT=${KEYSTONE_SERVICE_PORT:-5000}
69 69
 KEYSTONE_SERVICE_PORT_INT=${KEYSTONE_SERVICE_PORT_INT:-5001}
70 70
 KEYSTONE_SERVICE_PROTOCOL=${KEYSTONE_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
71 71
 
72
+# Bind hosts
73
+KEYSTONE_ADMIN_BIND_HOST=${KEYSTONE_ADMIN_BIND_HOST:-$KEYSTONE_SERVICE_HOST}
72 74
 # Set the tenant for service accounts in Keystone
73 75
 SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}
74 76
 
... ...
@@ -169,6 +171,7 @@ function configure_keystone() {
169 169
     # Set the URL advertised in the ``versions`` structure returned by the '/' route
170 170
     iniset $KEYSTONE_CONF DEFAULT public_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:%(public_port)s/"
171 171
     iniset $KEYSTONE_CONF DEFAULT admin_endpoint "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:%(admin_port)s/"
172
+    iniset $KEYSTONE_CONF DEFAULT admin_bind_host "$KEYSTONE_ADMIN_BIND_HOST"
172 173
 
173 174
     if is_service_enabled tls-proxy; then
174 175
         # Set the service ports for a proxy to take the originals