Context
The following describes the procedure for the proper removal or uninstall followed by a 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
In order to perform the cleanup, you will have to:
1. Stop aerospike
sudo service aerospike stop
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 installation directories and additional files
- Ensure the following directories and their subdirectories are removed.
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. 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 related to Aerospike Tools package 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.
3. Remove the installations of aerospike tools & server
List the Packages installed
On RedHat and Centos:
$ 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 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 installed
On RedHat and Centos:
$ 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 dpkg --purge aerospike-tools
Note: Use rpm -e or dpkg --purge to remove the packages along with the configuration files
Note: If you try to remove the aerospike related packages before removing the installation directories as mentioned above you may get warnings as below:
sudo dpkg --purge aerospike-server-enterprise
4. Delete the aerospike user and group
$ sudo userdel aerospike $ sudo groupdel aerospike
5. Zero-out the disks that were used (or remove the files if files were used for persistent storage of data).
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).
blkdiscard /dev/<device_id>
$ 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 $ sudo dd if=/dev/zero of=/dev/sdb bs=1M
Refer to documentation on SSD initialization.
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> sudo rm /mnt/disk1/myfile1.dat
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.
6. Remove the node IP address 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
he Aerospike Server, when installed, creates a directory structure as described on Directory Structure documentation 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.
If the namespace is persisted to disk, you will need to check the storage type (raw device or file-backed) and clear data accordingly. Check the aerospike.conf file namespace stanza under storage-engine device. The aerospike.conf file is located at /etc/aerospike/aerospike.conf, unless explicitly changed. Refer to this documentation for different Storage Configuration Recipes.
Example of disk backed namespace configuration:
namespace <namespace-name> {
...
storage-engine device {
device /dev/sdb
device /dev/sdc
...
}
}
Example of file-backed namespace configuration:
namespace <namespace-name> {
...
storage-engine device {
file /mnt/disk1/myfile1.dat
file /mnt/disk2/myfile2.dat
...
}
}
Reference:
- Directory Structure: https://www.aerospike.com/docs/operations/manage/aerospike/directory_structure.html
- blkdiscard: http://man7.org/linux/man-pages/man8/blkdiscard.8.html
- Flash(SSD) Initialization: https://www.aerospike.com/docs/operations/plan/ssd/ssd_init.html
- Namespace Storage Configuration: https://www.aerospike.com/docs/operations/configure/namespace/storage/index.html
- Removing a node: https://www.aerospike.com/docs/operations/manage/cluster_mng/removing_node/index.html