Law Thirty-Six

You gotta go with what works

SDP logo

Running multiple instances of ServiceDesk Plus on a server

| 0 comments

In our organisation, we now have four instances of ServiceDesk Plus in use in different departments of the company. The one used by the IT department has the heaviest usage, and we run it on a dedicated VM. The other three have lighter usage, and so we have them set up on a single Windows Server 2008 VM. Having to run each instance on its own server would be expensive in terms of hardware and server licences. Of course, SDP can be run on LINUX to reduce licence costs, but in our organisation that was not an option.

Ideally, you would be installing these multiple instances of SDP at the same time as each other. If you decide to add a second instance to an existing box at a later date, this is still possible and you can pick up the instructions from “Tweaking the first installation”. It goes without saying that you need to size your server for these multiple instances, including making sure that you have sufficient disk space on the various partitions.

The instructions assume Windows Server and MS SQL Server but should outline an approach you can use for other operating systems and database.

The first installation

  1. Let’s do a little bit of planning first of all:
    1. Decide what ports each instance will run on. If port 80 is available, go ahead and use that for one instance. 8080 is the default offered when you install SDP, but I’ve tended to use 81, 82, 83 etc – just stay away from any well known ports that are in use on your server.
    2. Create a SQL login on the data server. It will need to have the appropriate rights to be able to create a database at least while you’re doing the installations, although you can scale that back later. I’m assuming the most difficult configuration, where you’ll be hosting multiple SDP databases on a single SQL Server. Unless you have security reasons not to, there’s no issue with sharing a single SQL login for the multiple instances.
  2. On the Windows server, run the installer, accepting the licence agreement and choosing your SDP edition. When you get asked for a folder to install the application into, give it a name that’s unique to this instance. So, rather than D:\ManageEngine\ServiceDesk, perhaps D:\ManageEngine\ServiceDesk_Alpha.
  3. Set the web server port to whatever you chose for this instance (let’s assume that the Alpha team got Port 80).
  4. Specify your SQL Server connection info, and notice that you cannot change the database name. Don’t worry about that for now.
  5. At the end of the installation process, allow SDP to start and then browse to the web application to make sure that it has started properly.
  6. If you have any patches to install, then go through that process now, testing at the end to make sure that you have a working instance of SDP.
  7. Stop the service from Administrative Tools | Services

Tweaking the first installation

What we’re going to do here is to rename the SQL database to something more specific to this instance and then modify the way the ManageEngine service appears in Administrative Tools | Services.

  1. On the SQL Server, rename the SQL database to something that indicates the instance it’s running, for example servicedesk_alpha. You can do this from SQL Server Management Studio by right-clicking the database and choosing Rename or by executing the command: ALTER DATABASE servicedesk MODIFY NAME=servicedesk_alpha
  2. On the SDP server, open a command prompt and navigate to D:\ManageEngine\ServiceDesk_Alpha\bin (assuming you used the installation folder above).
  3. Run changedbserver.bat and change the name of the database to your new name, for example servicedesk_alpha. Click Test then click Save. A message will appear to warn that the database already exists, then another saying that the change was successful.
  4. From Administrative Tools | Services, start SDP again and verify that everything is up and running.
  5. Run regedit.exe. Usual warnings apply about making changes directly to the registry…
  6. Navigate to HKLM\System\CurrentControlSet\Services\ServiceDesk. Set the following:
    1. DisplayName to something like “ManageEngine ServiceDesk Plus (Alpha)”
    2. Description, if you wish, to something that identifies the instance of SDP this service applies to.
  7. The changes to the way the service is displayed won’t take effect until you restart Windows – do that now if you wish, but as it’s a cosmetic change you can leave it until later.

The second installation

You cannot simply run the installer to create your second installation as it will try to uninstall the first instance. Instead, we’re going to use some Copy and Paste.

If your first installation is brand new and if your second installation will be the same edition as the first, you can just take a copy of the D:\ManageEngine\ServiceDesk_Alpha folder, then paste and rename it to create D:\ManageEngine\ServiceDesk_Beta (or whatever you want to call your second instance).

If your first installation is not brand new, you are likely to have files within the application folder (such as file attachments and inline images) that would need to be cleared down. Rather than do that, the approach where you don’t have a clean source to copy from is to install SDP on a spare machine and copy from there. That could be a Windows workstation and use a SQL Express database if that was what you have available. If you want to use the 64-bit version of SDP, then you will need another 64-bit machine for this temporary installation. It will help, but is not essential, if you specify the web port you’ve decided to use during the installation process. When you’re done, copy the \ServiceDesk folder to your destination server and rename it to create D:\ManageEngine\ServiceDesk_Beta (or whatever).

Don’t start your second instance yet!

Then:

  1. Open a command prompt and navigate to D:\ManageEngine\ServiceDesk_Beta\bin — make sure you’re in the second instance’s folder. Run the command changewebserverport 81 http, or where 81 is the port number you’ve chosen for this new instance.
  2. If you created your second installation by running the installer, and if you created a database for it on the live SQL Server, then follow the instructions from earlier and rename this database as something specific to this instance, such as servicedesk_beta.
  3. Back in D:\ManageEngine\ServiceDesk_Beta\bin, run changedbserver.bat. Set the database name to servicedesk_beta and make sure the SQL login and password are correct. Click Test then click Save. You may get warned that there is already a database with this name, depending on the route you took to get here.
  4. In the same folder, run the command run.bat. This will launch SDP and initialise the database. Allow time for the server to initialise then check that you can browse to the web application on http://servername:81.
  5. The next step is to set up this second instance of SDP as a Windows service. For Windows Server 2003, you’ll need  Windows Resource Kit tools installed. You will also need a different user account for each instance of SDP you’re running. A local user account should be fine – create one now from Administrative Tools | Computer Management.
  6. From a command prompt, running as an administrator, run instsrv ServiceDesk2 “D:\ManageEngine\ServiceDesk_Beta\bin\wrapper.exe”. You should be told that the service is installed and ask you to modify its settings. Don’t try starting it yet! There are a few changes to make before it will work.
  7. Open regedit.exe and navigate to HKLM\System\CurrentControlSet\Services\ServiceDesk2. Set the following:
    1. Append the ImagePath with the following:  -s D:\ManageEngine\ServiceDesk_Beta\server\default\conf\wrapper.conf
    2. Set DisplayName to “ManageEngine ServiceDesk Plus (Beta)”
    3. If you wish, set the Description to something that indicates which instance this is.
  8. In Administrative Tools | Services, locate the new service. It will probably still be called ServiceDesk2. Open the Properties of the service and on the Log On tab, specify the account you created earlier. Click OK.
  9. Start the service and make sure that SDP comes up as expected.
  10. Just to check everything, restart the Windows Server but do not log on as a user. From a remote machine, make sure that you can browse to the two SDP instances and log on to each.

One thing to note is that if you cannot be logged on to both instances using a single browser instance due to the way that the login process uses cookies.

Leave a Reply

%d bloggers like this: