Deployment Manager on a cluster

Automated deployment for web applications and databases

Moderators: Mike Upton, justin.caldicott, Sean.newham, csmith, chirayu, DavidSimner, david.conlin

Deployment Manager on a cluster

Postby dykesa » Tue Oct 22, 2013 3:36 pm

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.)?
dykesa
 
Posts: 11
Joined: Thu Jan 19, 2012 3:24 pm
Location: Indianapolis, IN

Postby csmith » Wed Oct 23, 2013 5:09 pm

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
Chris Smith
Project Manager
Deployment Manager
csmith
 
Posts: 118
Joined: Thu Jun 30, 2011 2:15 pm
Location: Cambridge

Postby dykesa » Wed Oct 23, 2013 8:37 pm

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
dykesa
 
Posts: 11
Joined: Thu Jan 19, 2012 3:24 pm
Location: Indianapolis, IN

Postby justin.caldicott » Thu Oct 24, 2013 4:43 pm

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
Product Manager - Deployment Manager
Red Gate
justin.caldicott
 
Posts: 55
Joined: Wed Apr 20, 2011 5:42 pm

Postby dykesa » Thu Oct 24, 2013 4:51 pm

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
dykesa
 
Posts: 11
Joined: Thu Jan 19, 2012 3:24 pm
Location: Indianapolis, IN

Postby justin.caldicott » Thu Oct 24, 2013 4:57 pm

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
Product Manager - Deployment Manager
Red Gate
justin.caldicott
 
Posts: 55
Joined: Wed Apr 20, 2011 5:42 pm

Postby dykesa » Fri Oct 25, 2013 3:18 pm

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
dykesa
 
Posts: 11
Joined: Thu Jan 19, 2012 3:24 pm
Location: Indianapolis, IN

Postby justin.caldicott » Fri Oct 25, 2013 3:20 pm

Thanks Alan!
Justin Caldicott
Product Manager - Deployment Manager
Red Gate
justin.caldicott
 
Posts: 55
Joined: Wed Apr 20, 2011 5:42 pm

Postby DatabaseJase » Fri Nov 01, 2013 11:32 am

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?
DatabaseJase
 
Posts: 7
Joined: Fri Sep 20, 2013 10:53 am
Location: Northamptonshire

Postby dykesa » Fri Nov 01, 2013 12:52 pm

It's possible that would work. I still don't have a test setup to try it on.
dykesa
 
Posts: 11
Joined: Thu Jan 19, 2012 3:24 pm
Location: Indianapolis, IN


Return to Deployment Manager

Who is online

Users browsing this forum: No registered users and 1 guest