简体中文版经机器翻译而成,仅供参考。如与英语版出现任何冲突,应以英语版为准。
使用PowerShell cmdlet备份集群
贡献者
-
本文档站点的 PDF
![](https://docs.netapp.com/common/images/pdf-zip.png)
单独 PDF 文档的收集
Creating your file...
This may take a few minutes. Thanks for your patience.
Your file is ready
备份集群包括与SnapCenter服务器建立连接、添加资源、添加策略、创建备份资源组以及备份。
开始之前
-
您必须已准备好 PowerShell 环境以执行 PowerShell cmdlet 。
-
您必须已添加存储系统连接并创建凭据。
步骤
-
使用 Open-SmConnection cmdlet 为指定用户启动与 SnapCenter 服务器的连接会话。
PS C:\> Open-SmConnection
此时将显示用户名和密码提示符。
-
使用Add-SmResources cmdlet添加手动资源。
以下示例显示了如何添加PostgreSQL实例:
PS C:\> Add-SmResource -HostName 10.32.212.13 -PluginCode PostgreSQL -ResourceType Instance -ResourceName postgresqlinst1 -StorageFootPrint (@{"VolumeName"="winpostgresql01_data01";"LUNName"="winpostgresql01_data01";"StorageSystem"="scsnfssvm"}) -MountPoints "D:\"
-
使用 Add-SmPolicy cmdlet 创建备份策略。
-
使用 Add-SmResourceGroup cmdlet 保护资源或向 SnapCenter 添加新资源组。
-
使用 New-SmBackup cmdlet 启动新的备份作业。
此示例显示了如何备份资源组:
C:\PS> New-SMBackup -ResourceGroupName 'ResourceGroup_wback-up-clusters-using-powershell-cmdlets-postgresql.adocith_Resources' -Policy postgresql_policy1
此示例将备份受保护的资源:
C:\PS> New-SMBackup -Resources @{"Host"="10.232.204.42";"Uid"="MDC\SID";"PluginName"="postgresql"} -Policy postgresql_policy2
-
使用 Get-smJobSummaryReport cmdlet 监控作业状态(正在运行,已完成或失败)。
PS C:\> Get-smJobSummaryReport -JobID 123
-
使用 Get-SmBackupReport cmdlet 监控备份作业详细信息,例如备份 ID 和备份名称,以执行还原或克隆操作。
PS C:\> Get-SmBackupReport -JobId 351 Output: BackedUpObjects : {DB1} FailedObjects : {} IsScheduled : False HasMetadata : False SmBackupId : 269 SmJobId : 2361 StartDateTime : 10/4/2016 11:20:45 PM EndDateTime : 10/4/2016 11:21:32 PM Duration : 00:00:46.2536470 CreatedDateTime : 10/4/2016 11:21:09 PM Status : Completed ProtectionGroupName : Verify_ASUP_Message_windows SmProtectionGroupId : 211 PolicyName : test2 SmPolicyId : 20 BackupName : Verify_ASUP_Message_windows_scc54_10-04-2016_23.20.46.2758 VerificationStatus : NotVerified VerificationStatuses : SmJobError : BackupType : SCC_BACKUP CatalogingStatus : NotApplicable CatalogingStatuses : ReportDataCreatedDateTime :
有关可与 cmdlet 结合使用的参数及其说明的信息,可通过运行 get-help command_name 来获取。或者,您也可以参考 "《 SnapCenter 软件 cmdlet 参考指南》"。