Leave feedback
  • Discussion

    Running StreamServer as a MS Cluster Server Resource

Enter a new topic
  • David Shih David Shih StreamServe Employee
    0 likes 2553 views

     

    Running the StreamServe Communication Server itself within a cluster manager is UNSUPPORTED. But a cluster manager can be awfully useful to ensure that only one node is active at any given time.

    If, for some reason, you wanted to try registering your StreamServer applications as a Generic Service, you'd run into some problems:

    • MSCS requires the service names (not the display names) to be the same between nodes
    • But in the StreamServe Enterprise Repository (and therefore MGW and Control Center), the actual service names are GUIDs: they differ between multiple nodes. (e.g. "889DD0CA-9B71-4BA5-B851-DCC48 7F40B03" and "3106EB89-4BBD-4920-9E2D-313AA 8E9B08B")

    If you copied and pasted the startup command lines from the Services Control Panel, you'd run into some problems:

    • Control Center would not be able to tell if the StreamServer instance was running.
    • You would need to slip in a "runas" command in order to have the communiation server run in a different user context as the cluster manager.
    • The startup command line is different between nodes.

    So. What can you do? Well, you could throw together a batch file that would start the appropriate Windows Service on each node. And register that as a Generic Application resource in the MSCS Administrator. But then you'd need to make sure that the application stays alive as long as the service is running. And it would be convenient if the script were able to determine whether the service was running on the other node. And if StreamServer were running on the other node, it should decide whether or not to stop it.

    Such a script would be completely and totally UNSUPPORTED. A sample is attached for your convenience.

    @ECHO off
    REM * This script is UNSUPPORTED. But so is running StreamServer within a cluster manager.
    REM * This batch file allows you to start and monitor StreamServe on two nodes as Windows Services,
    REM *   but define them as a Generic Application Resource type in MS Cluster Administrator.
    REM *     The nodes are assumed to be Active-Passive
    REM *     StreamServe Control Center requires Services to have unique names,
    REM *       but unique names across nodes does not work with MSCS Generic Services
    REM *     Set the startup type of the StreamServer services to Manual,
    REM *       and logging in as a Domain Service Account
    REM * On Windows 2003 Server, this script requires SLEEP.EXE (redistributable from Resource Kit)
    REM * On Windows 2000 Server, this script also requires sC.EXE (redistributable from Resource Kit)

    SETLOCAL
    SET sleep_interval=60
    REM * Set the debug log to NUL or a filename
    SET debug_log=start_strs.log
    REM * Assuming Active-Passive, set this shared resource to a file/directory that only one node can own at once
    SET shared_resource="E:\StreamServ e"
    REM * Update the following three environment variables on both nodes!
    SET node_remote=FAYSAPSSP2
    SET service_local="889DD0CA-9B71- 4BA5-B851-DCC487F40B03"
    SET service_remote="3106EB89-4BBD -4920-9E2D-313AA8E9B08B"

    :check_remote
    REM * Check whether StreamServe is already running on the other node
    REM *   If Strs is happily running on the other node, leave it alone and do nothing.
    REM *   If Strs on the other node cannot access the shared IN directory, stop it. (Its log will be full of errors)
    SC %node_remote% query %service_remote% | FIND /c "STATE              : 4  RUNNING" >NUL
    SET ERR=%ERRORLEVEL%
    REM ECHO Error Level is %ERR% >%debug_log%
    IF %ERR% NEQ 0 GOTO start_local
    ECHO %DATE% %TIME%  The StreamServe service appears to be running on the other node %node_remote%. >>%debug_log%
    IF EXIST %shared_resource% GOTO kill_remote
    ELSE SLEEP %sleep_interval%
    GOTO check_remote

    :kill_remote
    REM * Stop StreamServe running on the other node
    ECHO %DATE% %TIME%    ...but the Cluster resource is local. Stopping remote StreamServe instance! >>%debug_log%
    SC %node_remote% stop %service_remote%

    :start_local
    REM * Start StreamServe on the local node
    ECHO %DATE% %TIME%  Starting the StreamServe service locally. >>%debug_log%
    NET start %service_local% >>%debug_log% 2>NUL
    SET ERR=%ERRORLEVEL%
    REM ECHO Error Level is %ERR% >>%debug_log%

    :check_local
    REM * Check whether StreamServe is running on the local node
    SLEEP %sleep_interval%
    SC query %service_local% | FIND /c "STATE              : 4  RUNNING" >NUL
    IF %ERRORLEVEL% NEQ 0 GOTO stopped_local
    ECHO %DATE% %TIME%  The StreamServe service appears to be running locally. >>%debug_log%
    GOTO check_local

    :stopped_local
    REM * Perhaps the StreamServe Administrator has redployed (and restarted) the service? Check one more time.
    ECHO %DATE% %TIME%  StreamServe service is not running locally... checking again... >>%debug_log%
    SLEEP %sleep_interval%
    SC query %service_local% | FIND /c "STATE              : 4  RUNNING" >NUL
    IF %ERRORLEVEL% NEQ 0 GOTO end

    :end
    REM * StreamServe seems to have stopped. Quit, and let the Cluster Administrator deal with it.
    ECHO %DATE% %TIME%  The StreamServe service appears to have stopped. >>%debug_log%
    ENDLOCAL
    EXIT 1

     

    Monday 18 January, 2010

    Attached files

  • Henrik Wejdmark Henrik Wejdmark StreamServe Employee Administrator
    0 likes

    An unsupported bump :)

    Wednesday 19 May, 2010