How to remove and clean-up an Aerospike server installation


#1

How to remove and clean-up an Aerospike server installation

Context

The following describes the procedure for the proper removal or uninstall and clean-up of an Aerospike installation. This document will give an overview of the packages, files, and directories installed by Aerospike, and steps that are necessary for removal.

Method

Aerospike, when installed, creates a directory structure as described on this page.

In order to properly remove Aerospike, the tools and server packages on the system need to be uninstalled.
In addition, there are related files and directories that would need to be cleaned-up in order to leave no trace of Aerospike.

NOTE: If intending to fully erase the disk(s), you will want to check which disk(s) used for Aerospike. Those can be found in the aerospike.conf file namespace stanza under storage-engine device. The aerospike.conf file is located at /etc/aerospike/aerospike.conf, unless explicitly changed.

namespace <namespace-name> {
   ...
   storage-engine device {
       device /dev/sdb
       device /dev/sdc 
   ...
   }
}

NOTE: If you used file(s) as persistent storage, you will want to capture the location and name of the file(s) used for storage. The filename(s) used for Aerospike are located as a parameter in the aerospike.conf file namespace stanza under storage-engine device. The aerospike.conf file is located at /etc/aerospike/aerospike.conf, unless explicitly changed.

namespace <namespace-name> {
   ...
   storage-engine device {
       file /mnt/disk1/myfile1.dat
       file /mnt/disk2/myfile2.dat
   ...
   }
}

In order to perform the cleanup, you will have to:

1. Stop aerospike

  • sudo service aerospike stop
$ sudo service aerospike stop
 * Stopping aerospike                                                    [ OK ] 

NOTE: Depending on your operating system and Aerospike version you may need to use one of the following:

  • sudo systemctl stop aerospike
  • sudo /etc/init.d/aerospike stop

2. Remove aerospike tools & server

List the Packages

On RedHat and Centos:

  • sudo rpm -qa | fgrep aerospike
$ sudo rpm -qa | grep aerospike
aerospike-tools-3.15.0.3-1.el6.x86_64
aerospike-server-enterprise-3.15.0.1-1.el6.x86_64

On Debian and Ubuntu:

  • sudo dpkg -l | fgrep aerospike
$ sudo dpkg -l | fgrep aerospike
aerospike-server-enterprise  3.15.0.1-1  amd64  The Aerospike distributed datastore allows fully scalable and reliable data storage with elastic server properties.
aerospike-tools              3.15.0.3    amd64  Aerospike server tools.

Remove the packages

On RedHat and Centos:

  • sudo rpm -e < package name >
$ sudo rpm -e aerospike-tools
Removing /opt/aerospike
Removing /usr/lib64/python2.6/site-packages/aerospike.pth

$ sudo rpm -e aerospike-server-enterprise

On Debian and Ubuntu:

  • sudo dkpg -r < package name >
$ sudo dpkg -r aerospike-tools
(Reading database ... 63103 files and directories currently installed.)
Removing aerospike-tools (3.15.0.3) ...
Removing /opt/aerospike
Removing /usr/local/lib/python2.7/dist-packages/aerospike.pth

$ sudo dpkg -r aerospike-server-enterprise
(Reading database ... 63076 files and directories currently installed.)
Removing aerospike-server-enterprise (3.15.0.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...

3. Remove additional files and directories

  • Remove the Aerospike package.
CentOS6
aerospike-server-enterprise-3.15.0.1-el6.tgz
Ubuntu
aerospike-server-enterprise-3.15.0.1-ubuntu14.04.tgz
  • Remove the directory and their subdirectories, used in the Aerospike installation.
CentOS6
aerospike-server-enterprise-3.15.0.1-el6/
Ubuntu
aerospike-server-enterprise-3.15.0.1-ubuntu14.04/
  • Ensure the following directories and their subdirectories are removed.

    NOTE: If intending to Zero-out the disks, capture the name of the data disks used for aerospike namespace stanza under the storage-engine device parameter.
    NOTE: If you used file(s) as persistent storage, capture the location and name of the file(s) used for storage under the aerospike namespace stanza under the storage-engine device parameter.
- /etc/aerospike
- /opt/aerospike
- /var/log/aerospike
- /var/run/aerospike
  • Ensure the following files are removed.
/etc/init.d/aerospike
/etc/logrotate.d/aerospike
/usr/bin/aql
/usr/bin/asadm
/usr/bin/asbackup
/usr/bin/asgraphite
/usr/bin/asinfo
/usr/bin/asloglatency
/usr/bin/asrestore
/usr/bin/asd
/usr/bin/asfixownership
/usr/bin/asmigrate2to3
  • Ensure any non standard directories you used are also removed.

4. Remove Tools Dependencies

The following dependencies are required for Aerospike Tools. These dependencies may be required for other programs to work correctly. You will need to decide if and how you want to delete any of the following dependencies.

  • python-argparse
  • py-bcrypt
  • pyOpenssl
  • pexpect
  • python-ply

5. Delete the aerospike user and group

$ sudo userdel aerospike
$ sudo groupdel aerospike

6. Zero-out the disks that were used (or remove the files if files were used for persistent storage of data).

NOTE: Only perform on data disks used for aerospike. The data disk names should have been captured from the namespace stanza storage-engine device parameter listing prior to removing the aerospike.conf file.


If the disk is ssd, use blkdiscard (if available).
See: http://man7.org/linux/man-pages/man8/blkdiscard.8.html

  • blkdiscard /dev/<device_id>
EXAMPLE:
$ sudo blkdiscard /dev/sdb

If blkdiscard is not available or you are not using SSDs, use dd to zero out the disks.

  • sudo dd if=/dev/zero of=/dev/ bs=YOUR_BLOCK_SIZE_HERE
EXAMPLE: 
$ sudo dd if=/dev/zero of=/dev/sdb bs=1M

See: https://www.aerospike.com/docs/operations/plan/ssd/ssd_init.html

If you used files as persistent storage, you can simply remove the files and no need to zero out the disks

  • sudo rm <Aerospike persistent storage file> NOTE: The persistent storage filename(s) should have been captured from the namespace stanza storage-engine device parameter listing prior to removing the aerospike.conf file.

7. Remove the node from the remaining nodes in the cluster

If the node was part of a cluster, make sure to follow the instructions on the node removal documentation page.

Notes

Reference:

Keywords

directory structure remove install uninstall rpm tools server dependencies user group python

Timestamp

11/13/2017