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
| ... | ... |
@@ -46,6 +46,7 @@ SWIFT3_DIR=$DEST/swift3 |
| 46 | 46 |
SWIFT_SERVICE_PROTOCOL=${SWIFT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
|
| 47 | 47 |
SWIFT_DEFAULT_BIND_PORT_INT=${SWIFT_DEFAULT_BIND_PORT_INT:-8081}
|
| 48 | 48 |
SWIFT_SERVICE_LOCAL_HOST=${SWIFT_SERVICE_LOCAL_HOST:-$SERVICE_LOCAL_HOST}
|
| 49 |
+SWIFT_SERVICE_LISTEN_ADDRESS=${SWIFT_SERVICE_LISTEN_ADDRESS:-$SERVICE_LISTEN_ADDRESS}
|
|
| 49 | 50 |
|
| 50 | 51 |
# TODO: add logging to different location. |
| 51 | 52 |
|
| ... | ... |
@@ -361,6 +362,9 @@ function configure_swift {
|
| 361 | 361 |
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level
|
| 362 | 362 |
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT log_level DEBUG
|
| 363 | 363 |
|
| 364 |
+ iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip
|
|
| 365 |
+ iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
|
|
| 366 |
+ |
|
| 364 | 367 |
iniuncomment ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port
|
| 365 | 368 |
if is_service_enabled tls-proxy; then |
| 366 | 369 |
iniset ${SWIFT_CONFIG_PROXY_SERVER} DEFAULT bind_port ${SWIFT_DEFAULT_BIND_PORT_INT}
|
| ... | ... |
@@ -463,17 +467,23 @@ EOF |
| 463 | 463 |
local swift_node_config=${SWIFT_CONF_DIR}/object-server/${node_number}.conf
|
| 464 | 464 |
cp ${SWIFT_DIR}/etc/object-server.conf-sample ${swift_node_config}
|
| 465 | 465 |
generate_swift_config_services ${swift_node_config} ${node_number} $(( OBJECT_PORT_BASE + 10 * (node_number - 1) )) object
|
| 466 |
+ iniuncomment ${swift_node_config} DEFAULT bind_ip
|
|
| 467 |
+ iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
|
|
| 466 | 468 |
iniset ${swift_node_config} filter:recon recon_cache_path ${SWIFT_DATA_DIR}/cache
|
| 467 | 469 |
|
| 468 | 470 |
swift_node_config=${SWIFT_CONF_DIR}/container-server/${node_number}.conf
|
| 469 | 471 |
cp ${SWIFT_DIR}/etc/container-server.conf-sample ${swift_node_config}
|
| 470 | 472 |
generate_swift_config_services ${swift_node_config} ${node_number} $(( CONTAINER_PORT_BASE + 10 * (node_number - 1) )) container
|
| 473 |
+ iniuncomment ${swift_node_config} DEFAULT bind_ip
|
|
| 474 |
+ iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
|
|
| 471 | 475 |
iniuncomment ${swift_node_config} app:container-server allow_versions
|
| 472 | 476 |
iniset ${swift_node_config} app:container-server allow_versions "true"
|
| 473 | 477 |
|
| 474 | 478 |
swift_node_config=${SWIFT_CONF_DIR}/account-server/${node_number}.conf
|
| 475 | 479 |
cp ${SWIFT_DIR}/etc/account-server.conf-sample ${swift_node_config}
|
| 476 | 480 |
generate_swift_config_services ${swift_node_config} ${node_number} $(( ACCOUNT_PORT_BASE + 10 * (node_number - 1) )) account
|
| 481 |
+ iniuncomment ${swift_node_config} DEFAULT bind_ip
|
|
| 482 |
+ iniset ${swift_node_config} DEFAULT bind_ip ${SWIFT_SERVICE_LISTEN_ADDRESS}
|
|
| 477 | 483 |
done |
| 478 | 484 |
|
| 479 | 485 |
# Set new accounts in tempauth to match keystone tenant/user (to make testing easier) |