首页 > 数据库 > > 数据库管理工具-gs_postuninstall
GaussDB 100提供了gs_postuninstall工具来帮助清理准备集群环境阶段所做配置,使得卸载后的环境得到清理。
如果在gs_preinstall命令或gs_install命令中指定参数“--sep-env-file=mppfile”进行了环境变量分离,则在进行环境清理之前,需要执行“source mppfile”使环境变量分离文件生效。其中mppfile需要使用绝对路径。
gs_postuninstall -U USER -X XMLFILE [-L] [--delete-user] [--delete-group] [-l LOGFILE]显示帮助信息。
gs_postuninstall { -? | --help }显示版本号信息。
gs_postuninstall { -V | --version }参数说明
运行集群的操作系统用户名。
取值范围:字符串,要符合标识符的命名规范。
集群配置文件路径。
取值范围:clusterconfig.xml的路径。
只清理本主机的环境。
如果集群内某主机做单机环境清理后,集群不能再做全量环境清理。
删除-U参数指定的操作系统用户。
如果在Redhat环境下,且用户名与用户组名相同,选择此项必须指定--delete-group参数。
删除操作系统用户所在的用户组(选择此选项必须指定--delete-user参数)。
指定日志文件名及路径。在内部会自动给日志名添加一个时间戳。

由于在执行gs_postuninstall后,系统会自动删除集群相关目录(包含$GAUSSLOG目录)。因此建议用户通过该参数指定日志文件到非GaussDB 100数据库集群相关路径。
显示帮助信息。
显示版本号信息。
清理主机的环境
[root@plat1 script]# gs_postuninstall -U omm -X /opt/software/gaussdb/clusterconfig.xml
The environment will be cleaned up and cannot be recovered.Are you sure you want to clean up the environment after uninstall (yes/no)?yes
Parsing the configuration file.
Successfully parsed the configuration file.
Please enter password for root.
Password:
Creating SSH trust for the root permission user.
Successfully creating SSH trust for the root permission user.
Checking unpreinstallation.
Success checking unpreinstallation.
Deleting the instance paths.
Deleting the instance paths successfully.
Clean log and dependency.
Clean up the user environment variables
Clean up the user environment variable successfully
Clean SSH trust for the root permission user.
Successfully cleaned SSH trust for the root permission user.
Clean up the local system tool environment variables
Clean log and dependency successfully.
Postuninstall successfully.
Please close the terminal and login again, ensure that the environment variable takes effect.
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3160401/ ,如需转载,请注明出处,否则将追究法律责任。