Perforce Public Knowledge Base - Installing Multiple Perforce Services for Windows
Perforce Software logo
Reset Search
 

 

Article

Installing Multiple Perforce Services for Windows

« Go Back

Information

 
Problem

This article describes how a Windows administrator can install multiple Perforce Servers configured as Windows services on the same system. This article is for Windows NT 4.0, Windows 2000, Windows XP and Windows 2003, including both Windows 32bit and Windows 64bit editions. This article also covers configuring a Perforce Proxy or Perforce FTP Plug-in as a Windows service.

Before proceeding you should read Windows Environment Variable Precedence, which describes the precedence of Perforce environment variables on Windows. Configuring Perforce on Windows also covers the registry reflection issues for the Windows 64bit OS.

Solution

The Perforce installer for Windows installs a single Perforce Server as a single Windows Service. If the same Windows system is host to more than one Perforce Server as a Windows service (for example, one for production and one for testing) the additional Perforce Servers must be created manually. The installer can also configure the Perforce Web Client and Perforce Proxy as a Windows service. The Perforce FTP Plug-in is not currently managed by the installer.

Example for creating a second Perforce Windows service

The basic steps to set up additional Perforce Server services are as follows:

  1. Create a new server root directory for the additional Perforce Server.
  2. Copy the server executable to the new server root directory.
  3. Install your duplicate license file into the new server root directory.
  4. Create the new Perforce Server Windows service.
  5. Set the Perforce environment variables.
  6. Start the Perforce Server as a Windows service.

We recommend that you install your first Perforce Windows service using the Perforce installer for Windows (perforce.exe). The installer names this first service "Perforce". The service named "Perforce" is managed by the installer and should not be changed manually. The installer also places the Perforce Server executable, p4d.exe, and other components in the Perforce Server root directory. These same components are used to install the second Perforce Service.

You also need the Perforce Service install application which is named svcinst. This application can be found in the existing Perforce Server root directory. It is comprised of two files, svcinst.exe and svcinst.dll.

Note: As of the 2008.1 release svcinst.dll is no longer necessary or distributed. If you are using a 2008.1 or later release, ignore any instructions pertaining to svcinst.dll.

For this example, assume the existing server root directory is "c:\perforce" with a service name of "Perforce". Also, assume the server root location of the second Perforce Service is "c:\p4root2" and the service name is "Perforce2".

Note: The p4d.exe executable you are using for this procedure must be at Release 99.1/10994 or greater.

  1. Make a P4ROOT directory for the new service.
    mkdir c:\p4root2
    
  2. Using the DOS copy command in a Command Prompt, copy the server executable (with a server named p4d.exe and a service named p4s.exe) into the new server root directory. These two files are the same and only differ by the file name. The first 3 characters of the service filename "p4s" tell the application to operate in a Windows service mode. Next, install the duplicate server license into the new server root directory. For convenience copy the service installer, svcinst.exe and svcinst.dll, into the new server root directory.
    copy c:\perforce\p4d.exe c:\p4root2
    copy c:\perforce\p4d.exe c:\p4root2\p4s.exe
    install {duplicate license} into c:\p4root2\license
    copy c:\perforce\svcinst.exe c:\p4root2\svcinst.exe
    copy c:\perforce\svcinst.dll c:\p4root2\svcinst.dll
  1. Use the service installer to create the "Perforce2" service. See the special considerations section below before creating the "Perforce2" service. Change directories into the new server root directory to run this command.
    cd c:\p4root2
    svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a
    
  2. Set service parameters for the "Perforce2" service. This step requires the Perforce Command Line Client application (p4.exe). The p4.exe application should already be in your execution path after running the Perforce Windows installer.

    The typical variables for a Perforce Server (non-replica) are:

    p4 set -S Perforce2 P4ROOT=c:\p4root2
    p4 set -S Perforce2 P4PORT=1667
    p4 set -S Perforce2 P4LOG=log
    p4 set -S Perforce2 P4JOURNAL=journal
    

    The configuration information for a Perforce Replica Server is usually stored in the Master Server's configuration. (See the Perforce Replication chapter of the Perforce System Administration Guide).  If so, the only the parameters you set would be from the command line to start the replica server:

    p4 set -S Perforce2 P4ROOT=c:\p4\replica
    p4 set -S Perforce2 P4NAME=Replica1
    

    To check these settings, use p4 set with no variable value pair.

    p4 set -S Perforce2
    
  3. Use the service installer to start the "Perforce2" service.
    svcinst start -n Perforce2
    

Creating a Perforce Replica Server as a Windows service

Follow the previous steps for creating a second Perforce Windows service with one notable addition: you must specify the Replica Server's name using the P4NAME registry variable. For example:

p4 set -S Perforce2 P4NAME=Replica1

 

Special considerations for Perforce Windows services

If the Perforce Server root directory is on a network mounted device, the Windows service must be created using an administrative user account. This is done using the -r and -u command line flags to the svcinst application.

Note: Perforce does not recommend locating the Perforce database files on a network mounted device due to performance concerns. See "Server Problems on Windows" for more information.

The following is the amended command to create the "Perforce2" service on a network drive.

svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a -r -u UserName Password

If you have problems running the svcinst command, use the "-d" as the first flag to see more extensive debugging information.

Example for creating a Perforce Proxy service

The Perforce Server Windows Installer is capable of creating a Windows service for your Proxy Server.   Start the Windows installer and select the "Proxy (P4P)" feature for installation.

The manual steps to set up an additional Perforce Proxy windows service are:
  1. Create a new proxy cache directory for the Perforce Proxy.
  2. Install the proxy executable in the new proxy cache directory.
  3. Create the Perforce Proxy Windows service.
  4. Set up the environment variables for the Proxy.
  5. Start the Perforce Proxy Windows service.

We recommend that you do not run a Perforce Proxy against a Perforce Server which is on the same machine. The Perforce Windows installer makes an effort to prevent such a configuration as well.

  • Create a Proxy cache directory.
    mkdir c:\p4proxy
    
  • Download the latest Proxy executable from our ftp site and place it in the Proxy cache directory. Using the DOS copy command in a Command Prompt, copy the file p4p.exe to create the special Windows service file p4ps.exe. The first 4 characters, "p4ps" tell the application to operate in a Windows service mode.
    (ftp) c:\p4proxy\p4p.exe
    copy c:\p4proxy\p4p.exe c:\p4proxy\p4ps.exe
    
  • Create the Perforce Proxy Windows service. The Perforce Windows installer uses Perforce Proxy as the Proxy's service name.
    svcinst create -n "Perforce Proxy" -e c:\p4proxy\p4ps.exe -a
    
  • Set the Proxy Service environment variables. The value for P4PORT is the local listen address used to connect to the Perforce proxy. The value for P4TARGET is the address of the remote Perforce Server. The value for P4CACHE is the directory that you created for the Proxy's cache, and the location where you placed the executables.
    p4 set -S "Perforce Proxy" P4PORT=9991
    p4 set -S "Perforce Proxy" P4TARGET=perforce:1666
    p4 set -S "Perforce Proxy" P4PCACHE=c:\p4proxy
    p4 set -S "Perforce Proxy" P4LOG=log
    

    To check these settings, use p4 set with no variable value pair. See the "Perforce Proxy SAG" chapter in the Perforce System Administrator's Guide for more information on these settings.

    p4 set -S "Perforce Proxy"
    
  • Use the service installer to start the "Perforce Proxy" service.
    svcinst start -n "Perforce Proxy"
    

Example for creating a Perforce FTP Plug-in service

The basic steps to set up an additioanl Perforce FTP Plug-in service are:
  1. Create a new, or use an existing, Perforce Client installation directory.
  2. Install the Perforce FTP executable in the Client installation directory.
  3. Create the Perforce FTP Plug-in Windows service.
  4. Set up the Perforce FTP environment variables.
  5. Start the Perforce FTP Plug-in Windows service.

Before going further, determine if there are special modes you want to use for the Perforce FTP Plug-in. See the Perforce FTP Plug-in User's Guide to make this decision. The following example configures the plug-in for use with Dreamweaver.

  • Create a new, or use an existing, Perforce client directory.
    mkdir c:\Perforce
    
  • Download the latest Perforce FTP Plug-in executable from our ftp site and place it in the Client installation directory. Using the DOS copy command in a Command Prompt, copy the file p4ftpd.exe to create the special Windows service file p4ftps.exe. The first 6 characters, "p4ftps" tell the application to operate in a Windows service mode.
    (ftp) c:\Perforce\p4ftpd.exe
    copy c:\Perforce\p4ftpd.exe c:\Perforce\p4ftps.exe
    
  • Create the Perforce FTP Plug-in Windows service. Perforce FTP is used in the following example as the Plug-in's Windows service name.
    svcinst create -n "Perforce FTP" -e c:\Perforce\p4ftps.exe -a
    
  • Set the FTP Plug-in Service environment variables. The value for P4PORT is the address of the remote Perforce Server. The value for P4FTPPORT is the port your ftp application uses when connecting to the Perforce FTP Plug-in. The value for P4FTPOPTIONS determines the mode in which the FTP Plug-in operates. The settings indicated here are for Adobe Dreamweaver application compatibility. The next two variables P4FTPDEBUG and P4FTPLOG are configured if logging is required.
    p4 set -S "Perforce FTP" P4PORT=perforce:1666
    p4 set -S "Perforce FTP" P4FTPPORT=21
    p4 set -S "Perforce FTP" P4FTPOPTIONS=dwlocking,keepfiles,autosync,syncdelay=10
    p4 set -S "Perforce FTP" P4FTPDEBUG=5
    p4 set -S "Perforce FTP" P4FTPLOG=c:\Perforce\p4ftpd.log
    

    To check these settings you use p4 set with no options. See the Perforce FTP Plug-in User's Guide for more information on P4FTP settings.

    p4 set -S "Perforce FTP"
    
  • Use the service installer to start the "Perforce FTP" service.
    svcinst start -n "Perforce FTP"
    

For additional help on using the Perforce service installer, run svcinst with the -h flag.

svcinst -h

If you need help or have questions, please contact support@perforce.com.

Notes:
  • Running multiple Perforce Servers on a single machine might have adverse performance implications.
     
  • If your intent is to set up multiple services to increase the number of Perforce users without purchasing more user licenses, you are in violation of the terms of your Perforce License Agreement.
     
  • You need to Contact Perforce Customer Service to obtain a duplicate server license with a different port assignment than your production server.
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255