Re: General Script Resource





cspm2003 wrote:
> Hello,
>
> I have a problem where Im in desperate need of help. Heres my situation:
>
> I've setup a Windows Cluster with 2 servers. Both are running Server2003
> with SP1. The cluster is up and running and all the resources I created are
> working, but theres one Problem.
>
> I want to launch Tomcat using a general script resource. I looked in the
> Server 2003 SDK how to create that kind of script and found out how the
> layout of the script should be. Here's the script that I came up with:
>
> ------------------------------------------------------------------------------
>
> Function Open( )
> End Function
>
> Function Online( )
> dim ShellWSH
> dim CommandToExecute
> Set ShellWSH = CreateObject("WScript.Shell")
> CommandToExecute = "C:\Programme\tomcat\bin\startup.bat"
> ShellWSH.Run CommandToExecute
> wscript.sleep 15000
> Online = True
> End Function
>
> Function LooksAlive( )
> ProcessName= "notepad.exe"
> ServerName= "wuno-messmer1"
>
> looksAlive = false
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & ServerName &
> "\root\cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_Process",,48)
>
> For Each objItem in colItems
> if objItem.Name =ProcessName then
> LooksAlive = True
> end if
> Next
> End Function
>
> Function IsAlive( )
> objArgs WScript.Arguments
>
> ProcessName= "notepad.exe"
> instance= "1"
> ServerName= "wuno-messmer1"
> IsAlive = False
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:\\" & ServerName &
> "\root\cimv2")
> Set colItems = objWMIService.ExecQuery("Select * from
> Win32_Process",,48)
>
> For Each objItem in colItems
> if objItem.Name =ProcessName then
> IsAlive = True
> end if
> Next
> End Function
>
> Function Offline( )
> End Function
>
> Function Close( )
> End Function
>
> Function Terminate( )
> End Function
>
> ------------------------------------------------------------------------------
>
> I tested all the functions by putting them in seperate vbs files, and they
> worked fine. However, when I set the status of the resource to online in the
> Cluster Administrator, it goes offline after a few secounds with an error. I
> checked the cluster log, and it says
>
> Script Error: Line 9, Character 1
>
> which would be this line:
>
> ShellWSH.Run CommandToExecute
>
> Do you know what I am doing wrong or have any ideas what I could try?
>
> Regards,
>
> Maximilian Messmer

Hi Maximilian,
I encounter same kind of limitations during my first try of creating a
Generic Script resource (in order to properly manage a French scheduler
called $Universe in one of our W2003 cluster). And in my opinion ,
there is not enough detailled documentation provided by MS or any other
third party websites on how-to manage non-cluster applications without
coding a resource DLL (just with a generic vbscript ressource). Or
maybe, I don't know how to search...

#1 : CommandToExecute = "C:\Programme\tomcat\bin\startup.bat"
Could you try to move Tomcat to a shared disk resource on same cluster
group than generic script + set up a dependancy between your script and
this drive ?

2# : More generally, I think that for some internal reasons (maybe du
to execution context of this special script) in 'Scripting Entry
points' of a Generic Script resource you can't code everything you
usually do in a standard VBS file , and more specially for WSSHell
objects. But, in fact it's not a bad thing , because theses internal
limitations could avoid some major issues due to potentials deadlocks
nightmares. I haven't yet implemented a resource DLL but I think that
DLL is clearly more adapted to build from scratch a true cluster-aware
application (but sometimes it can takes more time to do than a simple
vbscript, or maybe impossible if you try to give cluster capabilities
to an external application).

For example , in my case, workaround was to create a .WSC (Windows
Script Component) file to implement a custom components to launch +
control supplier batch files . Register this WSC file on every node of
our cluster. After this you can create your objects in generic script
and call functions exposed by your component. For you , it could be
something like creation of a tomcatLauncher.wsc with startup() and
shutdown() methods wich contains wsShell calls to Tomcat startup and
shutdown batches.

Useful stuff for WSC creation :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/letcreates.asp

Maybe I'm totally wrong , so if some people have already coded a
stand-alone generic script with some advanced features to manage
external third-party application , I will be really happy to read it !

3# (and last item) : Be careful with Tomcat, if you need to be
session-stateful maybe you have to build an NLB with specific settings
in Tomcat config.
=> Read
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/cluster-howto.html

Hope that helps

Regards

Pierre-Olivier BLU-MOCAER
Technical Account Manager - Windows Server Team
Societe Generale Corporate & Investment Banking

.



Relevant Pages

  • Re: IIS script failing to come online - but everything actuall still working
    ... Generic script resources should run as the cluster service account. ... Event Category: Resource Monitor ... Cluster resource IIS Script failed to come online. ...
    (microsoft.public.windows.server.clustering)
  • Re: IIS6 on 2003 Cluster - cannot get working!!
    ... I have called the resource IIS. ... > Microsoft Cluster Server ... I have setup the generic script as described below. ... >> However, whenever I try to bring this service online, I get the following ...
    (microsoft.public.windows.server.clustering)
  • Windows 2003 Enterprise Edition clustered IIS locks up server
    ... We're running two Windows 2003 server Enterprise Edition servers with MSCS ... The cluster contains a SQL Server 2000 resource ... is reporting that "ERR Generic Script: ...
    (microsoft.public.windows.server.clustering)
  • IIS6 on 2003 Cluster - cannot get working!!
    ... I am attempting to get an IIS 6 website running on a Win 2003 Server ... I have setup the generic script as described below. ... The cluster resource could not be brought online by the resource monitor. ...
    (microsoft.public.windows.server.clustering)
  • Upgrade cluster from 2000 to 2003
    ... I have managed to do inplace upgrade of win2000 cluster to win2003 cluster. ... In win2000 there was IIS Instance resource, ... Generic Script in Resource types in my cluster. ...
    (microsoft.public.windows.server.clustering)