一、概述
卸载openGauss的过程包含卸载openGauss和对openGauss服务器的环境做清理。
卸载只是清理预编译环境以后得操作,解压的安装包目录不会清理
1、执行卸载
1、以操作系统用户omm登录数据库服务器
su - omm
2、使用gs_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.
错误排查
如果卸载失败请根据"$GAUSSLOG/om/gs_uninstall-YYYY-MM-DD_HHMMSS.log"中的日志信息排查错误。
2、一键式环境清理
在openGauss卸载完成后,如果不需要在环境上重新部署openGauss,可以运行脚本gs_postuninstall对openGauss服务器上环境信息做清理。
openGauss环境清理是对环境准备脚本gs_preinstall所做设置的清理。
1、前提条件
openGauss卸载执行成功。
2、以root用户登录openGauss服务器
3、进入script路径下。
cd /opt/software/openGauss/script
4、使用gs_postuninstall进行清理。
若为环境变量分离的模式安装的数据库需要source环境变量分离文件ENVFILE。
./gs_postuninstall -U omm -X /opt/software/openGauss/cluster_config.xml --delete-user --delete-group
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.
错误排查
如果一键式环境清理失败请根据“$GAUSSLOG/om/gs_postuninstall-YYYY-MM-DD_HHMMSS.log”中的日志信息排查错误。
3、清理安装目录
1、执行完前面两步,发现opengauss安装目录依旧存在,使用tree命令查看
[root@gsdb01 huawei]# tree
.
├── corefile
└── install
├── app_70980198
├── data
│ └── dn01
└── om
6 directories, 0 files
/var/log/omm 也存在
存在一些空的目录,需要手动删除
rm -rf /opt/huawei /var/log/om