一键式环境清理

一键式环境清理

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

前提条件

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

操作步骤

  1. 以root用户登录openGauss服务器。

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

    查看互信是否建成功,可以互相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:~ # 
    
  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
    

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

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

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

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

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

  6. 注销root用户。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值