Devstack: fix redis unstack shutdown

[1] moved REMOTE_DB_IP definition to after sourcing redis_driver. This
causes REDIS_SERVER_LIST to be initialized incorrectly

[1] - https://review.openstack.org/#/c/476401/

Change-Id: Ifb705e3ded209603813a61e4d40be126ab7fc971
Closes-Bug: #1706862
This commit is contained in:
Dima Kuznetsov 2017-08-03 15:10:18 +03:00
parent f3bc952175
commit 9373238dab
1 changed files with 13 additions and 6 deletions

View File

@ -12,13 +12,18 @@
REDIS_VERSION=3.0.6
RUBY_VERSION=2.3
REDIS_SERVER_LIST=$REMOTE_DB_IP
REMOTE_PORT_START=$REMOTE_DB_PORT
NODE_COUNT_END=5
REMOTE_PORT_END=`expr $REMOTE_PORT_START + $NODE_COUNT_END`
REDIS_PORT=`seq $REMOTE_PORT_START $REMOTE_PORT_END`
function _redis_env {
# REMOTE_DB_* initialized after sourcing
export REDIS_SERVER_LIST=$REMOTE_DB_IP
export REMOTE_PORT_START=$REMOTE_DB_PORT
export NODE_COUNT_END=5
export REMOTE_PORT_END=`expr $REMOTE_PORT_START + $NODE_COUNT_END`
export REDIS_PORT=`seq $REMOTE_PORT_START $REMOTE_PORT_END`
}
function _configure_redis {
_redis_env
pushd /opt/redis3/conf
sudo sh -c "grep -q ulimit /etc/profile ||
echo ulimit -SHn 40960 >> /etc/profile"
@ -103,6 +108,7 @@ function nb_db_driver_install_client {
}
function nb_db_driver_start_server {
_redis_env
create=
if is_service_enabled df-redis-server ; then
if is_ubuntu || is_fedora; then
@ -140,11 +146,12 @@ function nb_db_driver_start_server {
}
function nb_db_driver_stop_server {
_redis_env
if is_service_enabled df-redis-server ; then
if is_ubuntu || is_fedora; then
for redisserver in $REDIS_SERVER_LIST; do
for port in $REDIS_PORT; do
echo "Shutshow Redis: "$redisserver:$port
echo "Shutdown Redis: "$redisserver:$port
sudo /opt/redis3/bin/redis-cli -p $port shutdown
pushd /opt/redis3/
sudo rm -rf nodes*.conf