Results 1 to 5 of 5

Thread: VB.NET service in a clustered environment

  1. #1

    Thread Starter
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    VB.NET service in a clustered environment

    Hi

    I have a windows VB.NET service that works perfectly on a normal standalone server. However when installed in clustered environment (2 machines) it seems to be fired twice.

    I initiate a timer in the OnStart event and when a particular file is detected in a specific folder I execute some actions. It appears that both machines attemt to start the action since I get two log entries for the start action. Is there any special code I should include in my service to silently exit of the service has already started by the second machine of the cluster, may be something similar to
    VB Code:
    1. If App.PrevInstance Then
    2.     Exit Sub
    3.  End Sub

    that I would include in a VB6 executable.

    Thanks
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  2. #2
    Frenzied Member
    Join Date
    Jul 2005
    Posts
    1,168

    Re: VB.NET service in a clustered environment

    Could you just check for running processes? If the process of that service already exist, then don't run.

  3. #3

    Thread Starter
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Re: VB.NET service in a clustered environment

    benmartin101, thanks. I googled and it seems that I have to use the Cluster API to make my service cluster aware. I'm looking for links to specific articles and if possible code samples. I'm still googling for this Cluster API thing ....
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

  4. #4
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: VB.NET service in a clustered environment

    Geez, I hate having to do that. A customer once asked to make one of our products cluster-aware. We told'em that getting a fault-tolerant server would cost them less in terms of upfront and maintenance costs.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

  5. #5

    Thread Starter
    Fanatic Member Mr.No's Avatar
    Join Date
    Sep 2002
    Location
    Mauritius
    Posts
    651

    Re: VB.NET service in a clustered environment

    Well I found Server Cluster WMI provider from MSDN help, I'll read it tomorrow at the office and give it a try.
    Using VB.NET 2003/.NET 1.1/C# 2.0
    http://del.icio.us/rajoo
    Blow your mind, smoke gunpowder
    Ashes to ashes, dust to dust
    If God won't have you, the devil will. - Author unknown
    Don't follow me, I'm lost too ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width