嵌套并行工作流与暂停 [英] Nested Parallel Workflow With Pause
问题描述
尝试在每个SQL Server上同时在两个数据库上运行SharePoint Upgrade-SPContentDatabase命令。我们有四个SQL服务器托管几TB的SharePoint数据。使用powershell工作流程我可以完成它,但是存在以下问题。
Trying to run SharePoint Upgrade-SPContentDatabase command on two database concurrently per SQL server. We have four SQL servers hosting few terabytes of SharePoint data. Using the powershell workflows I can accomplish it but there are some issues as below.
1)升级命令导致SharePoint生成日志文件,因为我并行执行,SP生成错误消息日志文件<< filename>>已经存在。
1) Upgrade command causes SharePoint to generate log file, since I am executing in parallel, SP generates error message that log file <<filename>> already exist.
2)我必须在服务器上升级Powershell版本才能使用工作流程。
2) I have to upgrade Powershell version on server in order to utilize Workflows.
想知道是否有人可以帮我介绍在每个Upgrade命令之前暂停并行进程或使用其他方法。第二个问题是次要问题。
Wondering if somebody can help me either with introducing pause in parallel process before each Upgrade command or use a different approach. The second issue is minor.
以下是我正在使用的代码
The following is the code I am using
workflow UpgradeContentDB
{
Param($csvPath,$throttle,$sleepSec)
$dbColl = Import-Csv $csvPath |
Select-Object Server,Name,@{ n = "Size"; e = { [int]($_.Size) } } |
Sort-Object Size -Descending |
Group-Object -Property "Server"
foreach -Parallel ($svr in $dbColl)
{
foreach -Parallel -throttlelimit $throttle ($db in $svr.Group)
{
Sequence
{
InlineScript {
Add-PSSnapin Microsoft.Sharepoint.Powershell;
Get-Date -Format G
" Server: " + $using:db.Server + " Database: " + $using:db.Name + " Size: " + $using:db.Size;
Upgrade-SPContentDatabase $using:db.Name -Confirm:$false;
Start-Sleep -Seconds $using:sleepSec;
}
}
}
}
}
推荐答案
也许这篇文章对您有用,它更多地讲述了"如何在单个工作流内嵌套两个工作流,以便两个工作流并行运行":
Maybe this post is useful to you, it tells more about "how to nest two workflows inside of a single workflow so the two workflows function in parallel":
祝你好运,
Allen Bai
Allen Bai
这篇关于嵌套并行工作流与暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!