【问题标题】:Which tool / technology: System management for databases and dependent services哪个工具/技术:数据库和依赖服务的系统管理
【发布时间】:2010-05-14 20:05:59
【问题描述】:

对此system management question的跟进:

因为我可能不会在serverfault 上得到太多反馈,所以我会在这里尝试一下。

我主要关心的是反映我必须管理的数据库、服务和任务/作业之间的依赖关系。

除了考虑 Powershell 之外,我什至考虑过使用 MSBuild,因为它允许对依赖项进行建模并重用配置目标。

换句话说: 我应该使用什么技术来开发一个灵活的解决方案,让我能够以正确的顺序停止机器 D 上的服务 A、B 和 C 并禁用任务 E关闭数据库 X 时在机器 F 上?

...我想在关闭数据库 Y 时重用该部分来停止服务 B 和 C。

【问题讨论】:

    标签: powershell msbuild systemmanagement


    【解决方案1】:

    如果您熟悉 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 配置好得多,它非常冗长和丑陋(虽然非常强大)。

    【讨论】:

      猜你喜欢
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      • 2019-10-18
      • 1970-01-01
      • 1970-01-01
      • 2010-11-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多