rabbitmq not getting removed during uninstall.sh

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

rabbitmq not getting removed during uninstall.sh

jcalcote
Hi Yaguang,

We've noticed that rabbitmq is not getting removed by vsm's uninstall.sh script. This appears to be the only  vsm-installed item that does not get removed during uninstall. Is this intentional? We ask mainly because it appears to be somewhat difficult to properly remove rabbitmq cleanly. When we simply remove the debian package, then attempt to install vsm again, the installation fails on rabbitmq installation.

Any help or insight would be appreciated.

Thanks,
John
Reply | Threaded
Open this post in threaded view
|

RE: rabbitmq not getting removed during uninstall.sh

ywang19
Administrator

This is one enhancement I hope to add, I hope to have an uninstaller, user could choose to remove all, or keep some component intact like ceph.

 

For your case to clean up rabbitmq, after running ./uninstall.sh, you could manually clean up below folders including /etc/rabbitmq, /var/lib/rabbitmq, /var/log/rabbitmq

 

 

 

From: jcalcote [via vsm-discuss] [mailto:ml-node+[hidden email]]
Sent: Saturday, January 16, 2016 6:15 AM
To: Wang, Yaguang
Subject: rabbitmq not getting removed during uninstall.sh

 

Hi Yaguang,

We've noticed that rabbitmq is not getting removed by vsm's uninstall.sh script. This appears to be the only  vsm-installed item that does not get removed during uninstall. Is this intentional? We ask mainly because it appears to be somewhat difficult to properly remove rabbitmq cleanly. When we simply remove the debian package, then attempt to install vsm again, the installation fails on rabbitmq installation.

Any help or insight would be appreciated.

Thanks,
John


If you reply to this email, your message will be added to the discussion below:

http://vsm-discuss.33411.n7.nabble.com/rabbitmq-not-getting-removed-during-uninstall-sh-tp379.html

To start a new topic under vsm-discuss, email [hidden email]
To unsubscribe from vsm-discuss, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

RE: rabbitmq not getting removed during uninstall.sh

jcalcote
I've modified your uninstall.sh file. Here's my version:
#!/bin/bash

TOPDIR=$(cd $(dirname "$0") && pwd)
USER=`whoami`

set -o xtrace

source $TOPDIR/installrc

for ip in $CONTROLLER_ADDRESS; do
    ssh -t $ip "sudo service vsm-api stop"
    ssh -t $ip "sudo service vsm-scheduler stop"
    ssh -t $ip "sudo service vsm-conductor stop"
    ssh -t $ip "sudo service mysql restart"
    ssh -t $ip "sudo apt-get purge --yes -m vsm vsm-dashboard python-vsmclient vsm-deploy"
    ssh -t $ip "sudo apt-get purge --yes -m rabbitmq-server librabbitmq1"
    ssh -t $ip "sudo apt-get purge --yes -m diamond"
    ssh -t $ip "sudo apt-get purge --yes -m keystone python-keystone python-keystoneclient python-keystonemiddleware"
    ssh -t $ip "sudo apt-get autoremove --yes"
    ssh -t $ip "sudo killall rabbitmq-server beam.smp"
    ssh -t $ip "sudo rm -rf /var/lib/keystone /etc/keystone /etc/vsm /etc/vsm-dashboard /etc/vsmdeploy /var/lib/vsm /var/log/vsm"
done

for ip in $AGENT_ADDRESS_LIST; do
    ssh -t $ip "sudo service vsm-agent stop"
    ssh -t $ip "sudo service vsm-physical stop"
    ssh -t $ip "sudo apt-get purge --yes -m vsm vsm-dashboard python-vsmclient vsm-deploy"
    ssh -t $ip "sudo apt-get purge --yes -m diamond"
    ssh -t $ip "sudo apt-get purge --yes -m python-keystoneclient"
    ssh -t $ip "sudo apt-get autoremove --yes"
    ssh -t $ip "sudo rm -rf /var/lib/vsm /var/log/vsm /etc/vsm"
done
This version does not remove the ceph cluster or any ceph components. We use VSM in a pure import scenario. However, this script could easily be enhanced to allow the user the option of removing ceph.

This version also removes keystone components because we always install a private keystone copy for this release. In a future release of our product, we'll add the ability for the user to connect to an external keystone service. Then we'll have to enhance this script to not uninstall keystone when the user chose an external keystone service.

I broke up the commands into multiple ssh commands because I noticed that when one failed early, the rest are not executed. I expect failures occasionally when items have been manually cleaned up in advance, so I wanted failures to not cause the entire ssh command to return early. This is also why I broke up apt-get purge commands into chunks. I didn't want a missing keystone service to stop the others from being removed.

I purge packages to ensure that all configuration files are removed, and I autoremove to ensure that no-longer-required dependencies are removed, putting the system back into a state that is much closer to what it was before VSM was installed.

John
Reply | Threaded
Open this post in threaded view
|

RE: rabbitmq not getting removed during uninstall.sh

jcalcote
Here's an even better version of ubuntu14/uninstall.sh:

#!/bin/bash

# Copyright 2014 Intel Corporation, All Rights Reserved.

# Licensed under the Apache License, Version 2.0 (the"License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#  http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

TOPDIR=$(cd $(dirname "$0") && pwd)
USER=`whoami`

# Defaults
REMOVE_KEYSTONE_PKGS=1
REMOVE_CEPH_PKGS=1

# Parse command-line options to change defaults
OPTIND=1
while getopts "h?kc" opt; do
    case "$opt" in
    h|\?)
        echo "Uninstall VSM and other components and clean up any remaining file system items and processes."
        echo "By default: Uninstall vsm, rabbitmq, diamond, keystone and ceph components."
        echo ""
        echo "Usage: uninstall.sh [options]"
        echo "options:"
        echo "   -k  Suppress uninstallation of Keystone components."
        echo "   -c  Suppress uninstallation of Ceph components."
        exit 0
        ;;
    k)  unset REMOVE_KEYSTONE_PKGS
        ;;
    c)  unset REMOVE_CEPH_PKGS
        ;;
    esac
done

set -o xtrace

source $TOPDIR/installrc

#Original:
#  ssh -t $ip "sudo clean-data -f; \
#    sudo service vsm-api stop; \
#    sudo service vsm-scheduler stop; \
#    sudo service vsm-conductor stop; \
#    sudo service mysql restart; \
#    sudo service rabbitmq-server restart;
#    sleep 3; \
#    sudo apt-get remove --yes vsm vsm-dashboard python-vsmclient vsm-deploy; \
#    sudo apt-get autoclean --yes"

for ip in $CONTROLLER_ADDRESS; do
    ssh -t $ip 'bash -x -s' <<EOF
if [ -n "${REMOVE_CEPH_PKGS}" ]; then
    sudo clean-data -f
fi
sudo service vsm-api stop
sudo service vsm-scheduler stop
sudo service vsm-conductor stop
sudo service mysql restart
sudo service rabbitmq-server restart
sleep 3
sudo apt-get purge --yes vsm vsm-dashboard python-vsmclient vsm-deploy
sudo apt-get purge --yes rabbitmq-server librabbitmq1
sudo killall rabbitmq-server beam.smp
sudo apt-get purge --yes diamond
if [ -n "${REMOVE_KEYSTONE_PKGS}" ]; then
    sudo apt-get purge --yes keystone python-keystone python-keystoneclient python-keystonemiddleware
    sudo rm -rf /var/lib/keystone /etc/keystone
fi
sudo apt-get autoremove --yes
sudo apt-get autoclean --yes
sudo rm -rf /etc/vsm /etc/vsm-dashboard /etc/vsmdeploy /var/lib/vsm /var/log/vsm
EOF
done

#Original:
#  ssh -t $ip "sudo clean-data -f; \
#    sudo service vsm-agent stop; \
#    sudo service vsm-physical stop; \
#    sudo apt-get remove --yes vsm vsm-dashboard python-vsmclient vsm-deploy; \
#    sudo apt-get autoclean --yes"

for ip in $AGENT_ADDRESS_LIST; do
    ssh -t $ip 'bash -x -s' <<EOF
if [ -n "${REMOVE_CEPH_PKGS}" ]; then
    sudo clean-data -f
fi
sudo service vsm-agent stop
sudo service vsm-physical stop
sudo apt-get purge --yes vsm vsm-dashboard python-vsmclient vsm-deploy
sudo apt-get purge --yes diamond
sudo apt-get purge --yes python-keystoneclient
sudo apt-get autoremove --yes
sudo apt-get autoclean --yes
sudo rm -rf /var/lib/vsm /var/log/vsm /etc/vsm
EOF
done

John