The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.
How to completely remove and clean-up an Aerospike server installation
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
The 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.
NOTE: 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
...
}
}
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 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 < 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 --purge aerospike-tools
(Reading database ... 67672 files and directories currently installed.)
Removing aerospike-tools (3.15.0.3) ...
Purging configuration files for aerospike-tools (3.15.0.3) ...
$ sudo dpkg --purge aerospike-server-enterprise
(Reading database ... 67744 files and directories currently installed.)
Removing aerospike-server-enterprise (3.15.0.1-1) ...
Purging configuration files for aerospike-server-enterprise (3.15.0.1-1) ...
Processing triggers for ureadahead (0.100.0-16) ...
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
(Reading database ... 67744 files and directories currently installed.)
Removing aerospike-server-enterprise (3.15.0.1-1) ...
Purging configuration files for aerospike-server-enterprise (3.15.0.1-1) ...
dpkg: warning: while removing aerospike-server-enterprise, directory '/opt/aerospike/usr/udf/lua' not empty so not removed
dpkg: warning: while removing aerospike-server-enterprise, directory '/opt/aerospike/smd' not empty so not removed
dpkg: warning: while removing aerospike-server-enterprise, directory '/var/run/aerospike' not empty so not removed
dpkg: warning: while removing aerospike-server-enterprise, directory '/var/log/aerospike' not empty so not 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).
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.
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:
- Directory Structure: https://www.aerospike.com/docs/operations/manage/aerospike/directory_structure.html
- blkdiscard: blkdiscard(8) - Linux manual page
- 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
Keywords
directory structure remove install uninstall rpm tools server dependencies user group python clean-up
Timestamp
June 2019