Multiple Perforce services under Windows

By default, the Helix Server installer for Windows installs a single Helix Core Server as a single service. If you want to host more than one Helix Server installation on the same machine (for instance, one for production and one for testing), you can either manually start Helix Servers from the command line, or use the Perforce-supplied utility svcinst.exe, to configure additional Perforce services.

Warning

Setting up multiple services to increase the number of users you support without purchasing more user licenses is a violation of the terms of your Perforce End User License Agreement.

Understanding the precedence of environment variables in determining Perforce configuration is useful when configuring multiple Perforce services on the same machine. Before you begin, read and understand Configuration parameter precedence.

To set up a second Perforce service:

  1. Create a new directory for the Perforce service.
  2. Copy the server executable, service executable, and your license file into this directory.
  3. Create the new Perforce service using the svcinst.exe utility, as described in the example below. (The svcinst.exe utility comes with the Helix Server installer, and can be found in your Helix Server root.)
  4. Set up the environment variables and start the new service.

We recommend that you install your first Perforce service using the Helix Server installer. This first service is called Perforce and its server root directory contains files that are required by any other Perforce services you create on the machine.

Example   Adding a second Perforce service

You want to create a second Perforce service with a root in C:\p4root2 and a service name of Perforce2. The svcinst executable is in the server root of the first Helix Server installation you installed in C:\perforce.

Create a P4ROOT directory for the new service:

C:\> mkdir c:\p4root2

Copy the server executables, both p4d.exe (the server) and p4s.exe (the service), and your license file into the new directory:

C:\> copy c:\perforce\p4d.exe c:\p4root2
C:\> copy c:\perforce\p4d.exe c:\p4root2\p4s.exe
C:\> copy c:\perforce\license c:\p4root2\license

Use svcinst.exe (the service installer) to create the Perforce2 service:

C:\> svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a

After you create the Perforce2 service, set the service parameters for the Perforce2 service:

C:\> p4 set -S Perforce2 P4ROOT=c:\p4root2
C:\> p4 set -S Perforce2 P4PORT=1667
C:\> p4 set -S Perforce2 P4LOG=log2
C:\> p4 set -S Perforce2 P4JOURNAL=journal2

Finally, use the Perforce service installer to start the Perforce2 service:

$ svcinst start -n Perforce2.

The second service is now running, and both services will start automatically the next time you reboot.