-
系统回显 [perfadm@ecs-env-2988 test]$ python3 $GPHOME/script/DisasterFineGrained.py -t prepare --local-dn-num 3 --remote-dn-num 3 --config-file /home/mpp/mppcases_c10/cluster/gs_rch_DR-v6/test/backupRestore.ini
[Start ESL disaster fine grained process]
set guc 'enable_metadata_tracking' to 'on' on 192.168.250.152.
set guc 'disaster_cluster_dn_nums' to '3,3' on 192.168.250.152.
set guc 'enable_metadata_tracking' to 'on' on 192.168.244.53.
set guc 'disaster_cluster_dn_nums' to '3,3' on 192.168.244.53.
set guc 'view_independent' to 'on' on 192.168.244.53.
Success set guc prepare.
[Finished ESL disaster fine grained process]
-
参数说明 完整选项 缩写选项 数据类型 说明 取值类型 缺省值 应用实例 -t 不涉及 字符串 接口支持多种功能。指定该参数为prepare,执行主备集群准备工作。 -t generate-config -t prepare -t create-publication -t alter-publication -t cancel-publication -t get-current-disaster 不涉及 -t prepare --local-dn-num 不涉及 字符串 本地集群DN数 不涉及 不涉及 --local-dn-num 6 --remote-dn-num 不涉及 字符串 远端集群DB数 不涉及 不涉及 --remote-dn-num 3 --config-file 不涉及 字符串 双集群容灾配置文件存放路径。 说明: 该路径操作系统用户omm必须拥有读权限。 关于配置文件如何配置,请参见生成配置文件命令。 不涉及 不涉及 --config-file /home/userA/config.ini
-
使用指南 prepare命令需在主集群的主节点上执行。 表1 设置GUC参数 设置集群 参数 参数说明 取值范围 设置值 主集群/备集群 enable_metadata_tracking 在细粒度容灾的主集群上,用于追踪细粒度容灾相关对象的元数据(包括DDL、DCL)变更,用于向备集群同步变更的元数据。 布尔型: on表示开启元数据变化追踪功能,此后发生元数据变更,可以通过细粒度容灾同步到备集群。 off表示不开启元数据变化追踪功能。 on 主集群/备集群 disaster_cluster_dn_nums 用于设置细粒度容灾主备集群DN数,格式是“本地集群DN数,远端集群DB数”,主要用于小集群向大机群同步时的数据分桶。 字符串,根据主备集群DN情况进行设置,比如DN数比例6:3的容灾,大小集群分别设置为“6,3”和“3,6”。 命令行传入参数值 备集群 view_independent 视图解耦功能。 布尔型: on表示开启视图解耦功能。 off表示不开启视图解耦功能。 on
-
使用指南 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 backupStop 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]
-
参数说明 完整选项 缩写选项 数据类型 说明 取值类型 缺省值 应用实例 -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