Uninstall KWDB Cluster
This section describes how to uninstall KWDB clusters for different deployment scenarios, including script deployment, kwbase CLI deployment, and container image deployment. Choose the appropriate uninstallation method based on your deployment approach.
Uninstall Script Deployment
For KWDB deployed using the installation script, perform the following steps:
Log in to the initial deployment node.
Transfer the
kwdb_installdirectory to all other cluster nodes.Log in to remote nodes and create the required directory:
ssh <username>@<node2_address> "mkdir -p ~/kwdb_install" ssh <username>@<node3_address> "mkdir -p ~/kwdb_install" ...Transfer the
kwdb_installdirectory to the target nodes:scp -r kwdb_install <username>@<node2_address>:~/kwdb_install/ scp -r kwdb_install <username>@<node3_address>:~/kwdb_install/ ...
Execute the following operations on each node in the cluster:
Stop the KWDB service:
systemctl stop kaiwudbRun the uninstallation command in the
kwdb_installdirectory:./deploy.sh uninstallWhen prompted, choose whether to delete the data directory:
When uninstalling KaiwuDB, you can either delete or keep all user data. Please confirm your choice: Do you want to delete the data? (y/n):- Enter
y: Delete the data directory. - Enter
n: Keep the data directory for future use.
- Enter
Uninstall kwbase CLI Deployment
For KWDB deployed using kwbase CLI, perform the following steps on each node to be uninstalled:
WARNING
Before proceeding, ensure all important data has been backed up. These operations will permanently delete all KWDB data and configurations.
Stop the KWDB service.
Remove the custom certificate directory:
sudo rm -rf <cert_path>Delete the data directory:
sudo rm -rf <data_path>
Uninstall Container Image Deployment
For KWDB deployed using a container image, perform the following steps on each node to be uninstalled:
WARNING
Before proceeding, ensure all important data has been backed up. These operations will permanently delete all KWDB data and configurations.
Stop the KWDB container:
TIP
The container name is the name specified in the
--nameparameter when running the container.docker stop <kwdb-container>Remove the container:
docker rm <kwdb-container>Delete the Docker image:
# Get the image name docker ps -a --filter name=kwdb-container --format "{{.Image}}" # Remove the image docker rmi ${image_name}Remove custom certificate directory:
sudo rm -rf <cert_path>Delete the data directory (default location:
/var/lib/kaiwudb):sudo rm -rf <data_path>