Uninstallation of openGauss
Tags: opengauss
Published: 2023-03-28 03:26:27

Uninstall openGauss
The process of uninstalling openGauss includes uninstalling openGauss and cleaning the environment of the openGauss server.

perform uninstall
openGauss provides an uninstall script to help users completely uninstall openGauss.

Steps

Log in to the active database node as the operating system user omm.

Use gs_uninstall to uninstall openGauss.

gs_uninstall --delete-data
Or perform local offload per node in openGauss.

gs_uninstall --delete-data -L
example

Use the gs_uninstall script to uninstall openGauss.

gs_uninstall --delete-data
Checking uninstallation.
Successfully checked uninstallation.
Stopping the cluster.
Successfully stopped the cluster.
Successfully deleted instances.
Uninstalling application.
Successfully uninstalled application.
Uninstallation succeeded.
In the stand-alone uninstallation scenario, use the gs_uninstall script to uninstall.

gs_uninstall --delete-data
Checking uninstallation.
Successfully checked uninstallation.
Stopping the cluster.
Successfully stopped the cluster.
Successfully deleted instances.
Uninstalling application.
Successfully uninstalled application.
Uninstallation succeeded.
Troubleshooting

If the uninstallation fails, troubleshoot the error according to the log information in "$GAUSSLOG/om/gs_uninstall-YYYY-MM-DD_HHMMSS.log".

One-click environment cleanup
After the openGauss uninstallation is complete, if you do not need to redeploy openGauss on the environment, you can run the script gs_postuninstall to clean up the environment information on the openGauss server. The openGauss environment cleanup is to clean up the settings made by the environment preparation script gs_preinstall.

prerequisite

The uninstallation of openGauss is successful.
Mutual trust between root users is available.
Only the root user can execute the gs_postuninstall command.
Steps

Log in to the openGauss server as the root user.

Check whether the root user mutual trust is established. If the root user has not established mutual trust, you need to manually establish the root user mutual trust. For details, see Manually Establishing Mutual Trust.

Check whether the mutual trust is successfully established, and you can ssh the host name to each other. Enter exit to exit.

plat1:~ # ssh plat2 
Last login: Tue Jan  5 10:28:18 2016 from plat1 
Huawei's internal systems must only be used for conducting Huawei's business or for purposes authorized by Huawei management.Use is subject to audit at any time by Huawei management. 
plat2:~ # exit 
logout 
Connection to plat2 closed. 
plat1:~ # 
Enter the script path.

cd /opt/software/openGauss/script
Use gs_postuninstall to clean up. If the database is installed in the mode of environment variable separation, the source environment variable separation file ENVFILE is required.

./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group
Or perform local post cleanup per node in openGauss.

./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group -L
omm is the user name of the operating system running openGauss, and /opt/software/openGauss/cluster_config.xml is the path of the openGauss configuration file.

If the database is installed in the mode of environment variable separation, the env parameter of the previous environment variable separation of source needs to be deleted.

unset MPPDB\_ENV\_SEPARATE\_PATH
Delete the mutual trust of the root user of each node in the openGauss database. For the operation, refer to the manual establishment of mutual trust to delete the mutual trust of the root user.

Log off the root user.

example

Clean up the host's environment.

gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user
Parsing the configuration file.
Successfully parsed the configuration file.
Check log file path.
Successfully checked log file path.
Checking unpreinstallation.
Successfully checked unpreinstallation.
Deleting Cgroup.
Successfully deleted Cgroup.
Deleting the instance's directory.
Successfully deleted the instance's directory.
Deleting the installation directory.
Successfully deleted the installation directory.
Deleting the temporary directory.
Successfully deleted the temporary directory.
Deleting remote OS user.
Successfully deleted remote OS user.
Deleting software packages and environmental variables of other nodes.
Successfully deleted software packages and environmental variables of other nodes.
Deleting logs of other nodes.
Successfully deleted logs of other nodes.
Deleting software packages and environmental variables of the local node.
Successfully deleted software packages and environmental variables of the local nodes.
Deleting local OS user.
Successfully deleted local OS user.
Deleting local node's logs.
Successfully deleted local node's logs.
Successfully cleaned environment.
Troubleshooting

If the one-click environment cleanup fails, troubleshoot the error according to the log information in "$GAUSSLOG/om/gs_postuninstall-YYYY-MM-DD_HHMMSS.log".