暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

华为openGauss 一键式环境清理

华为高斯 2020-06-01
1668

在openGauss卸载完成后,如果不需要在环境上重新部署openGauss,可以运行脚本gs_postuninstall对openGauss服务器上环境信息做清理。openGauss环境清理是对环境准备脚本gs_preinstall所做设置的清理。

前提条件

  • openGauss卸载执行成功。
  • root用户互信可用。
  • 只能使用root用户执行gs_postuninstall命令。

操作步骤

  1. 以root用户登录openGauss服务器。
  2. 进入script路径下

    cd /opt/software/openGauss/script

  3. 查看root用户互信是否建立,如果root用户没有建立互信,需要手工建立root用户互信,操作参考3.2.2手工建立互信。

    查看互信是否建成功,可以互相ssh主机名。输入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:~ #

  4. 使用gs_postuninstall进行清理。若为环境变量分离的模式安装的集群需要source环境变量分离文件ENVFILE。

    gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user --delete-group

    或者在openGauss中每个节点执行本地后置清理。

    gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.xml --delete-user --delete-group -L

    omm为运行openGauss的操作系统用户名,/opt/software/openGauss/clusterconfig.xml为openGauss配置文件路径。

    若为环境变量分离的模式安装的集群需删除之前source的环境变量分离的env参数

    unset MPPDB_ENV_SEPARATE_PATH

  5. 删除openGauss数据库各节点root用户的互信,操作参考3.2.2手工建立互信的删除root用户互信部分内容。

示例

清理主机的环境

gs_postuninstall -U omm -X /opt/software/openGauss/clusterconfig.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.

错误排查

如果一键式环境清理失败请根据“$GAUSSLOG/om/gs_postuninstall-YYYY-MM-DD_HHMMSS.log”中的日志信息排查错误。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

文集目录
暂无数据