Installing Multiple Perforce Services for Windows

Info & Tags

Article #:
35
Created:
04/16/07
Modified:
05/26/08

Links

  1. Configuring Perforce on Windows
    Tech
  2. Perforce FTP Plug-in
    Product Page
  3. Perforce FTP Plug-in User's Guide
    Documentation
  4. Perforce Proxy
    Product Page
  5. Perforce Proxy SAG
    Perforce System Administrator's Guide
  6. Perforce Web Client
    Product Page
  7. Perforce Web Client Guide
    Documentation
  8. Server Problems on Windows
    Tech

SUMMARY

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

Before proceeding you should read Tech Note 36: Configuring Perforce on Windows, which describes the precedence of Perforce environment variables on Windows. Tech Note 36 also covers the registry reflection issues for the Windows 64bit OS.

DETAILS

The Perforce installer for Windows will install 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 (one for production and one for testing) the additional Perforce Servers must be created manually. The installer will also configure the Perforce Web Client and Perforce Proxy as a service. The Perforce FTP Plug-in is not currently handled by the installer.

Example for creating a second Perforce Windows service:

The basic steps to set up additional Perforce Server services:

  1. Create a new server root directory for the additional Perforce Server.
  2. Copy the server executable to the 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 up the 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. The installer will name this first service "Perforce". The service named "Perforce" is managed  by the installer and should not be changed manually. The installer will also place the Perforce Server executable, p4d.exe, and other components in the Perforce Server root directory. We will use these same components to install the second Perforce Service.

You will 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.

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

Remember, the p4d.exe executable you are using for this procedure must be at Release 99.1/10994 or greater.

  • Make a P4ROOT directory for the new service.
    mkdir c:\p4root2
  • Using the DOS copy command in a Command Prompt, copy the server executable (with a server name p4d.exe and a service name p4s.exe) into the new server root directory. These two files are the same and only differ by the filename. 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
  • 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.
    svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a
  • Set service parameters for the "Perforce2" service. The p4.exe application should already be in your execution path from running the Perforce Windows installer.
    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

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

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

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.   Please note we recommend against this type of configuration due to performance concerns. See "Server Problems on Windows" for more information.

Here is the amended command to create the "Perforce2" service.

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 basic steps to set up additional Perforce Proxy services:
  1. Create a new proxy cache directory for the Perforce Proxy.
  2. Install the proxy executable in the 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 this 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, so will we do the same in this example.
    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 we created for the Proxy's cache and the location where we placed the executables.
    p4 set -S "Perforce Proxy" P4PORT=1666
    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 you use p4 set with no variable value pair. See the "Perforce Proxy SAG" chapter in the Perforce Web Client 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

Outline:
  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. This example will configure the plug-in for use with Dreamweaver.

  • Create a new or use and 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.   We will use Perforce FTP 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 Dream Weaver 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.

Note:
  • 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 must download Perforce 99.1/10994 or a newer release in order to use the procedure described here.

  • You will need to contact Perforce Customer Service to obtain a duplicate server license with a different port assignment than your production server.