cleanup_plugin_for_restore
用于在还原后清理存储插件的插件命令。
概要
plugin_executable cleanup_plugin_for_restore plugin_config_file local_backup_dir scope
plugin_executable cleanup_plugin_for_restore plugin_config_file local_backup_dir scope contentID
描述
gprestore
在gprestore
操作完成时调用cleanup_plugin_for_restore
插件命令,包括成功和失败情况。
scope参数指定执行范围。
gprestore
将使用每个scope值调用该命令。
cleanup_plugin_for_restore
实现应执行还原后清理远程存储系统所需的操作。
清理活动可能包括删除在还原期间创建的远程目录或临时文件,与备份服务断开连接等。
参数
plugin_config_file
插件配置YAML文件的绝对路径。
local_backup_dir
Greenplum数据库主机(master和segment)上的本地目录,gprestore
从该目录读取备份文件。
- 当scope是
master
时,local_backup_dir是Greenplum数据库master服务器的备份目录。- 当scope是
segment
时,local_backup_dir是segment实例的备份目录。 contentID标识segment实例。 - 当scope是
segment_host
时,local_backup_dir是主机上的任意备份目录。
- 当scope是
scope 执行scope值表示主机和插件命令的执行次数。scope可以是以下值之一:
master
- 在master主机上执行一次插件命令。segment_host
- 在每个segment主机上执行一次plugin命令。segment
- 对运行segment实例的主机上的每个活动segment实例执行一次plugin命令。 contentID标识segment实例。
在首次启动备份时,Greenplum数据库master和segment实例基于Greenplum数据库配置。
contentID
与scope对应的Greenplum数据库master或segment实例的contentID。
仅当scope为master
或segment
时才传递contentID。
- 当scope为
master
时,contentID为-1
。- 当scope是
segment
时,contentID是活动segment实例的内容标识符。
- 当scope是
退出码
cleanup_plugin_for_restore
命令必须在成功时以值0退出,如果发生错误则必须为非零。
在非零退出代码的情况下,gprestore
向用户显示stderr
的内容。