2010-05-14 55 views
3

这个system management question后续系统管理:哪些工具/技术:数据库和相关服务

因为我可能不会在serverfault得到更多的反馈,我会试试看这里。

我主要关心的是反映数据库之间的依赖关系,我将不得不管理的服务和任务/工作。

除了考虑Powershell之外,我甚至考虑过使用MSBuild,因为它允许建模依赖和重用配置目标。

换句话说:我应该使用什么样的技术,开发出灵活的解决方案,让我停止服务A,B和C上机d按照正确的顺序和禁用任务E对机F取下来的时候数据库X?

...我想重用的部分停止服务B和C取下数据库Y.

回答

5

时,如果您熟悉PowerShell和希望与依赖于工作,尝试psake 。是什么样子:

psake script.ps1:------- 
properties { 
$dbServer = 'sqlexpress' 
... 
} 
task default -depend StopServer1, StopServer2 

task StopS1 -depend MakeS1Backup, StopSqlServer1 { 
... 
} 
task MakeS1Backup { 
... make backup 
} 
task StopSqlServer1 { 
stop-service ... 
} 
# and anything similar to StopServer2 

然后,你可以这样调用(有更多的选择):

Invoke-Psake script.ps1 
#or 
Invoke-Psake script.ps1 -task StopS1 #calls only StopS1 task and all other scripts it depends on 
#or 
Invoke-Psake script.ps1 -task MakeS1Backup #only backups S1, it doesn't depend on anything else 

它所做的 - 它停止服务器1(任务StopS1),并在此之前,它的过程StopS1依赖的所有任务。因此,在停止S1的S1备份并停止Sql server 1之前等等。

我喜欢它比msbuild配置,这是非常详细和丑陋(虽然非常强大),好得多。

+0

这看起来很有希望。 – Filburt 2010-05-14 20:28:43