Drain stopping an Individual ArcGIS Server service on an individual machine within a cluster

596
2
05-23-2018 08:08 AM
PaulBatley
New Contributor III

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??

There is a workaround to this dilemma. Firstly, go to arcgis/manager and look at the service to see how many SOCs are running:

<servicename> (Map Service)

Status: Started
Instances Running: 2
Instances in Use: 0
Maximum Instances: 4

Now you know how many logs you've got to trawl through

Go to the logs on the node having the issue usually held under
C:\arcgisserver\logs\<hostname>.MSPX.APP\services\<servicefolder>\<servicename>.MapServer

And open the latest logs and look for the following:

<Msg time='2018-02-22T00:00:56,837' type='INFO' code='80003' target='<servicefolder>/<servicename>.MapServer' methodName='ImageServer.Construct' machine='<hostname>' process='34876' thread='36816'  >Successfully initialized from a raster dataset.</Msg>

<Msg time='2018-02-22T00:00:56,837' type='INFO' code='80003' target='<servicefolder>/<servicename>.MapServer' methodName='ImageServer.Construct' machine='<hostname>' process='40296' thread='36816'  >Successfully initialized from a raster dataset.</Msg>

Now you've got the process PID launch CMD prompt in Administrtor mode(**Important**) and type taskkill /F /PID 34876 /PID 40296

Another useful tool to assist you here is ProcessExplorer by SysInternals - Sysinternals Process Utilities - Windows Sysinternals | Microsoft Docs 

But seriously. ESRI add the function in to the Manager

2 Replies
JonathanQuinn
Esri Notable Contributor

If you enable the Command Line column, you can see which ArcSoc.exe process corresponds to which service:

You can then kill these processes through Task Manager without trawling through log files to find the PIDs.

I'd also suggest you add your idea to the Ideas site.

PaulBatley
New Contributor III

Thanks Jonathan.. Slick tip!

0 Kudos