rework etcd3 install to be like other devstack services
This separates out the install phase early from the start phase to make this mirror other services in devstack. Depends-On: I4124dc7e3fd3b4d973979da85209ec991c0f8c4b Change-Id: I76f8740448b25a48869ee80006e826baa6cafc2b
This commit is contained in:
parent
41da1a9feb
commit
62b56601a9
13
lib/etcd3
13
lib/etcd3
@ -41,13 +41,6 @@ fi
|
|||||||
|
|
||||||
# start_etcd3() - Starts to run the etcd process
|
# start_etcd3() - Starts to run the etcd process
|
||||||
function start_etcd3 {
|
function start_etcd3 {
|
||||||
# Don't install in sub nodes (multinode scenario)
|
|
||||||
if [ "$SERVICE_HOST" != "$HOST_IP" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
_install_etcd
|
|
||||||
|
|
||||||
local cmd="$ETCD_BIN_DIR/etcd"
|
local cmd="$ETCD_BIN_DIR/etcd"
|
||||||
cmd+=" --name $HOSTNAME --data-dir $ETCD_DATA_DIR"
|
cmd+=" --name $HOSTNAME --data-dir $ETCD_DATA_DIR"
|
||||||
cmd+=" --initial-cluster-state new --initial-cluster-token etcd-cluster-01"
|
cmd+=" --initial-cluster-state new --initial-cluster-token etcd-cluster-01"
|
||||||
@ -96,7 +89,7 @@ function cleanup_etcd3 {
|
|||||||
sudo rm -rf $ETCD_DATA_DIR
|
sudo rm -rf $ETCD_DATA_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
function _install_etcd {
|
function install_etcd3 {
|
||||||
echo "Installing etcd"
|
echo "Installing etcd"
|
||||||
|
|
||||||
# Make sure etcd3 downloads the correct architecture
|
# Make sure etcd3 downloads the correct architecture
|
||||||
@ -115,10 +108,6 @@ function _install_etcd {
|
|||||||
|
|
||||||
ETCD_NAME=etcd-$ETCD_VERSION-linux-$ETCD_ARCH
|
ETCD_NAME=etcd-$ETCD_VERSION-linux-$ETCD_ARCH
|
||||||
|
|
||||||
# Install the libraries needed. Note: tooz for example does not have a hard dependency on these libraries
|
|
||||||
pip_install etcd3
|
|
||||||
pip_install etcd3gw
|
|
||||||
|
|
||||||
# Create the necessary directories
|
# Create the necessary directories
|
||||||
sudo mkdir -p $ETCD_BIN_DIR
|
sudo mkdir -p $ETCD_BIN_DIR
|
||||||
sudo mkdir -p $ETCD_DATA_DIR
|
sudo mkdir -p $ETCD_DATA_DIR
|
||||||
|
7
lib/oslo
7
lib/oslo
@ -109,7 +109,14 @@ function install_oslo {
|
|||||||
_do_install_oslo_lib "stevedore"
|
_do_install_oslo_lib "stevedore"
|
||||||
_do_install_oslo_lib "taskflow"
|
_do_install_oslo_lib "taskflow"
|
||||||
_do_install_oslo_lib "tooz"
|
_do_install_oslo_lib "tooz"
|
||||||
|
# installation of additional libraries
|
||||||
|
#
|
||||||
|
# os-traits for nova
|
||||||
_do_install_oslo_lib "os-traits"
|
_do_install_oslo_lib "os-traits"
|
||||||
|
|
||||||
|
# etcd (because tooz does not have a hard dependency on these)
|
||||||
|
pip_install etcd3
|
||||||
|
pip_install etcd3gw
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restore xtrace
|
# Restore xtrace
|
||||||
|
4
stack.sh
4
stack.sh
@ -813,6 +813,10 @@ if is_service_enabled neutron; then
|
|||||||
install_neutron_agent_packages
|
install_neutron_agent_packages
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if is_service_enabled etcd3; then
|
||||||
|
install_etcd3
|
||||||
|
fi
|
||||||
|
|
||||||
# Check Out and Install Source
|
# Check Out and Install Source
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user