|
-
Sep 11th, 2006, 10:32 AM
#1
Thread Starter
Fanatic Member
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:
If App.PrevInstance Then
Exit Sub
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 ...
-
Sep 11th, 2006, 10:36 AM
#2
Frenzied Member
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.
-
Sep 11th, 2006, 12:54 PM
#3
Thread Starter
Fanatic Member
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 ...
-
Sep 11th, 2006, 01:12 PM
#4
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.
-
Sep 11th, 2006, 01:25 PM
#5
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|