更新时间:2025-01-22 GMT+08:00

创建发布命令

功能

create-publication命令用于创建细粒度容灾发布。

命令格式

python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file <disasterObjectListFile> --config-file <configFile>

参数说明

完整选项

缩写选项

数据类型

说明

取值类型

缺省值

应用实例

-t

不涉及

字符串

接口支持多种功能。指定该参数为create-publication,执行创建发布。

  • -t generate-config
  • -t prepare
  • -t create-publication
  • -t alter-publication
  • -t cancel-publication
  • -t get-current-disaster

不涉及

-t create-publication

--disaster-object-list-file

不涉及

字符串

容灾对象列表文件

不涉及

不涉及

--disaster-object-list-file /home/userA/disaster_object_list.txt

--config-file

不涉及

字符串

双集群容灾配置文件存放路径。

说明:
  • 该路径操作系统用户omm必须拥有读权限。
  • 关于配置文件如何配置,请参见生成配置文件命令

不涉及

不涉及

--config-file /home/userA/config.ini

使用指南

  • create-publication命令需在主集群的主节点上执行。当前备份过程结束之后,该命令会停止后续的周期性备份。
  • create-publication命令--disaster-object-list-file需传入全量容灾对象。
  • 首次发布DB和schema时,会将DB和schema下所有enable_disaster_cstore非on,但支持设置enable_disaster_cstore="on"的表自动转为容灾表并同步,后续DB和schema下新增表,需要设置enable_disaster_cstore="on"才会自动同步。
  • 发布的表需要是支持设置enable_disaster_cstore="on"的表才能同步。
  • 发布失败的容灾对象会在命令执行完后写入$HOME/config/fail_disaster_object.txt。
  • 默认生成的publication参数文件路径为$HOME/config/pub.list。
  • 需手动创建容灾对象列表文件--disaster-object-list-file,文件格式如下:
    db_name                            //db级
    db_name.schema_name                //schema级
    db_name.schema_name.table_name     //table级

命令示例

创建发布。

python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini

系统回显

[perfadm@ecs-env-2988 config]$ python3 $GPHOME/script/DisasterFineGrained.py -t create-publication --disaster-object-list-file $HOME/config/disaster_object_list.txt --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini
[Start ESL disaster fine grained process]
Stop backup loop.
Stop crontab for backup
Stop crontab successfully.
Stop backup successfully.
Start parse disaster object file.
parse disaster object file end, [disaster object num]: 1, [time]: 0.000s.
Start filter disaster object.
filter disaster object end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.020s.
Start transfer disaster object.
transfer disaster object end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.018s.
Start alter publication.
Start cancel all publication.
cancel all publication end, [pub num]: 0, [time]: 0.044s.
Start add publication.
add publication end, [db num]: 1, [schema num]: 0, [table num]: 0, [time]: 0.030s.
alter publication end, [time]: 0.074s.
The publication file path: /home/perfadm/config/pub.list
[Finished ESL disaster fine grained process]