Why isn't there a function within ArcGIS Server to shutdown a service on an individual machine within a site cluster?
We've had situations like I'm sure many others have, whereby one machine is locking an FGDB because the service has failed to stop on that machine, right? Then ArcGIS Server reports the machine is a status of "Stopping" or "Starting"
So what do you do? You have to "Use a sledgehammer to crack a nut!" i.e. shutdown the whole of ArcGIS Server on the offending node in order to get the SOCs to release their file handles on the FGDB, so you can then swap it out. Even, when the service has been set to schema locking: false?
This isn't sometimes feasible to do especially when you're refreshing a service on a shared platform and general service demand is at peak and operating on just one node within a site is just not an option.
I know you have the ability to shutdown machine within a site but why not add the function to shutdown a service on that machine??
#
# DrainStop.ps1
#
[cmdletbinding()]
param(
$ComputerName=$env:COMPUTERNAME,
[parameter(Mandatory=$true)]
$ServiceName
)
$logdir = 'C:\Scripts\Logs'
$today = get-date -UFormat "%Y%m%dT%H%M"
$logFile = "$logdir\DrainStop_$today.log"
$Processes = Get-WmiObject -Class Win32_Process -ComputerName $ComputerName | Where-Object {$_.CommandLine -like "*$ServiceName*"}
foreach ($process in $processes) {
$returnval = $process.terminate()
$processid = $process.handle
if($returnval.returnvalue -eq 0) {
write-host "The process $ProcessName `($processid`) terminated successfully" | Out-File -FilePath $logFile -Append
}
else {
write-host "The process $ProcessName `($processid`) termination has some problems" | Out-File -FilePath $logFile -Append
}
}
Surely something like this can be done..?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.