diff --git a/lib/cinder b/lib/cinder index a1d68712b6..c0356fe09c 100644 --- a/lib/cinder +++ b/lib/cinder @@ -326,7 +326,7 @@ function configure_cinder { if [[ ! -z "$CINDER_COORDINATION_URL" ]]; then iniset $CINDER_CONF coordination backend_url "$CINDER_COORDINATION_URL" elif is_service_enabled etcd3; then - iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:2379" + iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:$ETCD_PORT" fi } diff --git a/lib/etcd3 b/lib/etcd3 index d3f72264b0..26d07fd19e 100644 --- a/lib/etcd3 +++ b/lib/etcd3 @@ -27,7 +27,6 @@ set +o xtrace ETCD_DATA_DIR="$DATA_DIR/etcd" ETCD_SYSTEMD_SERVICE="devstack@etcd.service" ETCD_BIN_DIR="$DEST/bin" -ETCD_PORT=2379 if is_ubuntu ; then UBUNTU_RELEASE_BASE_NUM=`lsb_release -r | awk '{print $2}' | cut -d '.' -f 1` @@ -38,13 +37,13 @@ function start_etcd3 { local cmd="$ETCD_BIN_DIR/etcd" cmd+=" --name $HOSTNAME --data-dir $ETCD_DATA_DIR" cmd+=" --initial-cluster-state new --initial-cluster-token etcd-cluster-01" - cmd+=" --initial-cluster $HOSTNAME=http://$SERVICE_HOST:2380" - cmd+=" --initial-advertise-peer-urls http://$SERVICE_HOST:2380" + cmd+=" --initial-cluster $HOSTNAME=http://$SERVICE_HOST:$ETCD_PEER_PORT" + cmd+=" --initial-advertise-peer-urls http://$SERVICE_HOST:$ETCD_PEER_PORT" cmd+=" --advertise-client-urls http://$SERVICE_HOST:$ETCD_PORT" if [ "$SERVICE_LISTEN_ADDRESS" == "::" ]; then - cmd+=" --listen-peer-urls http://[::]:2380 " + cmd+=" --listen-peer-urls http://[::]:$ETCD_PEER_PORT " else - cmd+=" --listen-peer-urls http://0.0.0.0:2380 " + cmd+=" --listen-peer-urls http://0.0.0.0:$ETCD_PEER_PORT " fi cmd+=" --listen-client-urls http://$SERVICE_HOST:$ETCD_PORT" diff --git a/stackrc b/stackrc index 4f627ccbd7..59442529f4 100644 --- a/stackrc +++ b/stackrc @@ -766,6 +766,8 @@ elif is_arch "s390x"; then else exit_distro_not_supported "invalid hardware type - $ETCD_ARCH" fi +ETCD_PORT=${ETCD_PORT:-2379} +ETCD_PEER_PORT=${ETCD_PEER_PORT:-2380} ETCD_DOWNLOAD_URL=${ETCD_DOWNLOAD_URL:-https://github.com/coreos/etcd/releases/download} ETCD_NAME=etcd-$ETCD_VERSION-linux-$ETCD_ARCH ETCD_DOWNLOAD_FILE=$ETCD_NAME.tar.gz