Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Same Windows Service - Multiple Instances

Posted on 2009-12-28
8
Medium Priority
?
225 Views
Last Modified: 2012-05-08
We have a service we built that collect records from remote MySQL databases and stores them in our SQL database. We normally only have 1 instance of the service per windows server but we have a scenario coming up wherein we will need multiple instances of the service, each with its own config file.

Is it possible to install the same service multiple times, in separate folders, so it has its own config file?

Thanks,
Dean
0
Comment
Question by:dthansen
  • 4
  • 4
8 Comments
 
LVL 31

Expert Comment

by:Justin Owens
ID: 26131753
Yes, theoretically it is possible to do so.  You would need to make sure that each app running as a service is looking at the correct config file, but other than that it would be very straight forward.

Justin
0
 

Author Comment

by:dthansen
ID: 26131801
I can put the different instances in separate folders, this would handle the config file issue. the question is then, how would I install the same service repeatedly but have them recognized by the OS as separate instances?
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 26131871
You can run the exact same app 100 times as a service as long as each service has a unique setup.  The fact that you have each app in its own folder means your service will have a different path.  This, in and of itself, should be unique enough to be fine.  As an additional step, make sure each service has a unique name (service001, service002, etc).  This way you can use console commands on them more easily.

Justin
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dthansen
ID: 26131947
How would you install the service with names?

Dean
0
 
LVL 31

Expert Comment

by:Justin Owens
ID: 26132072
Dean,

What process are you using to create your first service?

Justin
0
 

Author Comment

by:dthansen
ID: 26132087
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil "c:\program files\DTH Software\DTH Billing\Service_CDRPolling.exe"
0
 
LVL 31

Accepted Solution

by:
Justin Owens earned 2000 total points
ID: 26132133
Use the /ServiceName= parameter.  For example:

c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil /ServiceName=Service_CDRPolling1 /i "c:\program files\DTH Software\DTH Billing\Service_CDRPolling.exe"

Source: http://dotnetstep.blogspot.com/2009/06/passing-parameter-to-installutil.html

If you don't like that method, there is a builtin service creator in Server 2003:
sc create ServiceName binpath= c:\windowservice1\windowservice1.exe     

Justin
0
 

Author Comment

by:dthansen
ID: 26132888
That method looks good to me!
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question