Skip to content

Commit 92ad152

Browse files
author
Rawlin Peters
committed
Explicitly set bind_ip in Swift server config files
Currently, the Swift proxy, object, account, and container servers bind to IPv4 address 0.0.0.0 by default. In the case of a user setting SERVICE_IP_VERSION=6 in their local.conf file, these Swift servers still listen on 0.0.0.0 instead of ::, which causes a ./stack.sh run to fail. This change explicitly sets the bind_ip variable in the Swift server config files so that the servers bind to either 0.0.0.0 (when SERVICE_IP_VERSION != 6) or :: (when SERVICE_IP_VERSION == 6). This patch is related to the following patch for devstack IPv6 support: https://review.openstack.org/#/c/192329 Change-Id: Ie268c6daf5374e67ef8710a731c3af50ffdb821e
1 parent 53e0160 commit 92ad152

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ SWIFT3_DIR=$DEST/swift3
4646
SWIFT_SERVICE_PROTOCOL=${SWIFT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
4747
SWIFT_DEFAULT_BIND_PORT_INT=${SWIFT_DEFAULT_BIND_PORT_INT:-8081}
4848
SWIFT_SERVICE_LOCAL_HOST=${SWIFT_SERVICE_LOCAL_HOST:-$SERVICE_LOCAL_HOST}
49+
SWIFT_SERVICE_LISTEN_ADDRESS=${SWIFT_SERVICE_LISTEN_ADDRESS:-$SERVICE_LISTEN_ADDRESS}
4950

5051
# TODO: add logging to different location.
5152

@@ -361,6 +362,9 @@ function configure_swift {
361362
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level
362363
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level DEBUG
363364

365+
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip
366+
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
367+
364368
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port
365369
if is_service_enabled tls-proxy; then
366370
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port ${SWIFT_DEFAULT_BIND_PORT_INT}
@@ -463,17 +467,23 @@ EOF
463467
local swift_node_config=${SWIFT_CONF_DIR}/object-server/${node_number}.conf
464468
cp ${SWIFT_DIR}/etc/object-server.conf-sample ${swift_node_config}
465469
generate_swift_config_services ${swift_node_config} ${node_number} $(( OBJECT_PORT_BASE + 10 * (node_number - 1) )) object
470+
iniuncomment ${swift_node_config} DEFAULT bind_ip
471+
iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
466472
iniset ${swift_node_config} filter:recon recon_cache_path ${SWIFT_DATA_DIR}/cache
467473

468474
swift_node_config=${SWIFT_CONF_DIR}/container-server/${node_number}.conf
469475
cp ${SWIFT_DIR}/etc/container-server.conf-sample ${swift_node_config}
470476
generate_swift_config_services ${swift_node_config} ${node_number} $(( CONTAINER_PORT_BASE + 10 * (node_number - 1) )) container
477+
iniuncomment ${swift_node_config} DEFAULT bind_ip
478+
iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
471479
iniuncomment ${swift_node_config} app:container-server allow_versions
472480
iniset ${swift_node_config} app:container-server allow_versions "true"
473481

474482
swift_node_config=${SWIFT_CONF_DIR}/account-server/${node_number}.conf
475483
cp ${SWIFT_DIR}/etc/account-server.conf-sample ${swift_node_config}
476484
generate_swift_config_services ${swift_node_config} ${node_number} $(( ACCOUNT_PORT_BASE + 10 * (node_number - 1) )) account
485+
iniuncomment ${swift_node_config} DEFAULT bind_ip
486+
iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
477487
done
478488

479489
# Set new accounts in tempauth to match keystone tenant/user (to make testing easier)

0 commit comments

Comments
 (0)