Link to home
Start Free TrialLog in
Avatar of dthansen
dthansen

asked on

Same Windows Service - Multiple Instances

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
Avatar of Justin Owens
Justin Owens
Flag of United States of America image

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
Avatar of dthansen
dthansen

ASKER

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?
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
How would you install the service with names?

Dean
Dean,

What process are you using to create your first service?

Justin
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\installutil "c:\program files\DTH Software\DTH Billing\Service_CDRPolling.exe"
ASKER CERTIFIED SOLUTION
Avatar of Justin Owens
Justin Owens
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That method looks good to me!