Avoid running multiple etcd process

If both Zun and Kuryr-libnetwork are enabled in devstack, the script
might fail since etcd will be installed and started twice. This commit
fixed it.

Change-Id: Ieffbb7a86e99a3e9a03cbfcadb2daf92d8f62cfb
This commit is contained in:
Hongbin Lu 2017-04-17 18:46:15 -04:00
parent b4fc4e3ea1
commit fc6ac8d177
3 changed files with 5 additions and 2 deletions

View File

@ -381,7 +381,7 @@ function install_etcd_server {
if [ $(sudo docker ps -a | awk '{print $NF}' | grep -w etcd) ]; then
sudo docker rm -f etcd || true
fi
sudo docker run -d --net=host --name etcd quay.io/coreos/etcd:${ZUN_ETCD_VERSION} \
[[ $(pgrep -x "etcd") ]] || sudo docker run -d --net=host --name etcd quay.io/coreos/etcd:${ZUN_ETCD_VERSION} \
/usr/local/bin/etcd \
--data-dir=data.etcd \
--name node0 \
@ -438,7 +438,7 @@ function start_zun_compute {
function start_zun_etcd {
echo "Start zun etcd..."
sudo docker start etcd
sudo docker start etcd || true
}
function stop_zun-etcd {

View File

@ -5,6 +5,8 @@ SERVICE_TOKEN=password
SERVICE_PASSWORD=password
ADMIN_PASSWORD=password
enable_plugin zun https://git.openstack.org/openstack/zun
KURYR_ETCD_PORT=2379
enable_plugin kuryr-libnetwork http://git.openstack.org/openstack/kuryr-libnetwork
# Optional: uncomment to enable the Zun UI plugin in Horizon

View File

@ -33,6 +33,7 @@ fi
if [ "$db" = "etcd" ]; then
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DB_TYPE=etcd"
export DEVSTACK_LOCAL_CONFIG+=$'\n'"KURYR_ETCD_PORT=2379"
elif [ "$db" = "sql" ]; then
export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DB_TYPE=sql"
fi