Deployment Manager on a cluster

dykesadykesa Posts: 16 Bronze 1
edited November 1, 2013 7:52AM in Deployment Manager
Does the deployment agent work on a cluster and are there any important installation points about it(Does the agent need to be installed on each node, etc.)?

Comments

  • csmithcsmith Posts: 138 Bronze 1
    Hi

    The Deployment Manager agent was not designed to be cluster aware, I'm afraid. You would have to install DM agent specifically on each node. So, in the DM web portal, you'd create an environment and add each node in the cluster as an agent.

    Making the Agent cluster-aware is something we want to do in the future. How, ideally, would you like it to work?

    Best regards,
    Chris
    Divisional Development Lead
    Redgate Software
  • dykesadykesa Posts: 16 Bronze 1
    Hi Chris,

    Thanks for your response. I haven't tried this live (and I don't have a test cluster setup) but I would imagine that attempting to deploy to the passive node would fail. As for how I think it should work:

    Optimally I think that it should only attempt to deploy to the active node if its cluster aware.

    Additional options: Allowing the Deployment Manager to have variables set by powershell script so that step 1 could be to execute a powershell script that sets the databaseServer variable to the active node.

    These are just a couple of thoughts.

    Alan
  • Hi Alan,

    You're right you would need to just deploy out to the active node. The only reason to do otherwise is if the changes took too long to replicate to the passive nodes, but that might involve disabling the clustering during the deployment which may not be ideal.

    You mention wanting to set the databaseServer variable from PowerShell. If just deploying to the active node, you can just configure to point to the appropriate server using variables specified for each of the environments you need. Does this do what you need?

    Best wishes,

    Justin
    Justin Caldicott
    Developer
    Redgate Software Ltd
  • dykesadykesa Posts: 16 Bronze 1
    Hi Justin,

    Technically yes, that would allow the deployment to go to only the active node. The reason I was mentioning being able to set a Deployment Manager variable from powershell (as a step of the deployment) is that it is possible to get the active node through powershell and the deployment could always be set to the active node.

    It was just a thought about possible ways around the agent knowing about the cluster.

    Thanks,

    Alan
  • I see, yes that would be nice if it could auto-detect the active node. Would you still have to pass all of the nodes into the PowerShell for it to be able to work out which is active? If you can point me to any PowerShell to do this that would be great.
    Justin Caldicott
    Developer
    Redgate Software Ltd
  • dykesadykesa Posts: 16 Bronze 1
    I think there are cleaner ways to do this (if you have access to run a powershell directly on the cluster) but the below script I worked up can determine the active node of a cluster remotely through the SQL Server.

    Call with:

    .\{scriptname} <CLUSTERNAME> <USER> <PASSWORD>

    ex: .\get_active_node.ps1 MYCLUSTERNAME ALAN SuperPass123

    Powershell:

    param(
    [string]$inst=$null,
    [string]$user=$null,
    [string]$pass=$null
    )


    $assemblylist =
    "Microsoft.SqlServer.Smo",
    "Microsoft.SqlServer.Dmf ",
    "Microsoft.SqlServer.SqlWmiManagement ",
    "Microsoft.SqlServer.ConnectionInfo ",
    "Microsoft.SqlServer.SmoExtended ",
    "Microsoft.SqlServer.Management.RegisteredServers ",
    "Microsoft.SqlServer.Management.Sdk.Sfc ",
    "Microsoft.SqlServer.SqlEnum ",
    "Microsoft.SqlServer.RegSvrEnum ",
    "Microsoft.SqlServer.WmiEnum ",
    "Microsoft.SqlServer.ServiceBrokerEnum ",
    "Microsoft.SqlServer.ConnectionInfoExtended ",
    "Microsoft.SqlServer.Management.Collector ",
    "Microsoft.SqlServer.Management.CollectorEnum"


    foreach ($asm in $assemblylist)
    {
    $asm = [Reflection.Assembly]::LoadWithPartialName($asm)
    }

    # Handle any errors that occur
    Trap {
    # Handle the error
    $err = $_.Exception
    write-host -ForegroundColor Red $err.Message
    while( $err.InnerException ) {
    $err = $err.InnerException
    write-output $err.Message
    Write-Host -ForegroundColor Red $err.Message
    };
    Exit 1
    # End the script.
    break
    }

    $svrConn = New-Object Microsoft.SqlServer.Management.Common.ServerConnection
    $svrConn.ServerInstance=$inst
    $svrConn.LoginSecure=$false
    $svrConn.Login=$user
    $svrConn.Password=$pass

    $srv = new-object Microsoft.SqlServer.Management.Smo.Server($svrConn)
    $db = $srv.Databases["master"]
    $cmdstring = "SELECT SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS [CurrentNodeName]"
    $result = $db.ExecuteWithResults($cmdstring)
    Write-Host $result.Tables[0].Rows[0].Item("CurrentNodeName")

    Exit 0
  • Thanks Alan!
    Justin Caldicott
    Developer
    Redgate Software Ltd
  • I think the latest release with "1st class database support" would resolve this issue, because now you'd just define a "database" connection with the clustered resource name.

    Problem solved?
  • dykesadykesa Posts: 16 Bronze 1
    It's possible that would work. I still don't have a test setup to try it on.
Sign In or Register to comment.