Deployment Manager on a cluster
dykesa
Posts: 16 Bronze 1
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
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
Redgate Software
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
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
Developer
Redgate Software Ltd
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
Developer
Redgate Software Ltd
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
Developer
Redgate Software Ltd
Problem solved?