openGauss学习笔记-146 openGauss 数据库运维-备份与恢复-配置文件的备份与恢复

openGauss学习笔记-146 openGauss 数据库运维-备份与恢复-配置文件的备份与恢复

146.1 背景信息

在openGauss使用过程中,如果静态配置文件无意损坏后,会影响openGauss感知openGauss拓扑结构和主备关系。使用gs_om工具生成的静态配置文件,可以替换已经损坏的配置文件,保证openGauss的正常运行。

146.2 前置条件

无。

146.3 操作步骤

  1. 以操作系统用户omm登录数据库主节点。

  2. 执行如下命令会在本服务器指定目录下生成配置文件。

    gs_om -t generateconf -X /opt/software/openGauss/clusterconfig.xml --distribute
    

    /opt/software/openGauss/clusterconfig.xml为openGauss安装时的XML配置文件。

    img 说明:

    • 执行命令后,日志信息中会有新文件的存放的目录。以一主两备环境为例,打开新文件存放目录,会出现3个以主机名命名的配置文件,需要用这3个文件分别替换对应主机的配置文件。
    • 若不使用–distribute参数,需执行步骤3将静态配置文件分配到对应节点;若使用–distribute参数,则会将生成的静态配置文件自动分配到对应节点,无需执行步骤3
  3. (可选)分别替换3台主机的/opt/gaussdb/app/bin目录下损坏的静态配置文件。

    这里以其中一台主机为例进行介绍。

    mv /opt/huawei/wisequery/script/static_config_files/cluster_static_config_SIA1000056771  /opt/gaussdb/app/bin/cluster_static_config
    

146.4 示例

在openGauss中的任意主机上执行如下命令,生成配置文件:

gs_om -t generateconf -X  /opt/software/openGauss/clusterconfig.xml --distribute
Generating static configuration files for all nodes.
Creating temp directory to store static configuration files.
Successfully created the temp directory.
Generating static configuration files.
Successfully generated static configuration files.
Static configuration files for all nodes are saved in /opt/huawei/Bigdata/mppdb/wisequery/script/static_config_files.
Distributing static configuration files to all nodes.
Successfully distributed static configuration files.

打开生成的配置文件目录,会看到新生成的3个文件:

cd /opt/huawei/Bigdata/mppdb/wisequery/script/static_config_files
ll
total 456
-rwxr-xr-x 1 omm dbgrp 155648 2016-07-13 15:51 cluster_static_config_plat1
-rwxr-xr-x 1 omm dbgrp 155648 2016-07-13 15:51 cluster_static_config_plat2
-rwxr-xr-x 1 omm dbgrp 155648 2016-07-13 15:51 cluster_static_config_plat3

👍 点赞,你的认可是我创作的动力!

⭐️ 收藏,你的青睐是我努力的方向!

✏️ 评论,你的意见是我进步的财富!

图片

最近更新

  1. TCP协议是安全的吗?

    2023-12-11 02:16:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2023-12-11 02:16:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2023-12-11 02:16:03       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2023-12-11 02:16:03       20 阅读

热门阅读

  1. 文本转图像 学习笔记

    2023-12-11 02:16:03       40 阅读
  2. 分布式事务实现方案

    2023-12-11 02:16:03       38 阅读
  3. git上传流程

    2023-12-11 02:16:03       39 阅读
  4. MySQL 添加注释(comment)

    2023-12-11 02:16:03       35 阅读
  5. 挖漏洞之文件上传

    2023-12-11 02:16:03       36 阅读
  6. Linux C语言 41-进程间通信IPC之共享内存

    2023-12-11 02:16:03       37 阅读
  7. Linux-实现没有血缘关系的进程之间的通信

    2023-12-11 02:16:03       35 阅读
  8. 【力扣】160.相交链表

    2023-12-11 02:16:03       38 阅读
  9. 关于 UbuntuServer 的一些配置

    2023-12-11 02:16:03       32 阅读
  10. SpringBootAdmin设置邮件通知

    2023-12-11 02:16:03       34 阅读
  11. 顺序表的应用

    2023-12-11 02:16:03       37 阅读