Perforce 2000.1 System Administrator's Guide (2000.1.sa.3) | ||
<< Previous Chapter Tuning Perforce for Performance |
Table of Contents Index Perforce on the Web |
Next Chapter >> Perforce Server (p4d) Reference |
If you have Administrator privileges, it is usually best to install Perforce as a service. If you don't, install it as a server.
You will be prompted to specify the location of the client executables, the port (P4PORT) on which the client should attempt to contact the Perforce server , the default editor, and the default username.
When specifying the port for the client to use, don't forget to include the hostname in the form hostname:port. See "Telling Perforce clients which port to talk to" on page 10 for details on P4PORT.
If the installer detects older versions of Perforce client or server software on the machine, you will be given the option to rename the old executables to prevent PATH-dependent conflicts.
You will be prompted to specify the directory for the client and server executables, the port on the local machine where the Perforce server or NT service will listen to client requests (P4PORT), the default editor, and the default username.
The installer will select default locations for the P4LOG error log file and the journal file. If an earlier version of Perforce was installed on the machine, these locations will be based on those already in use.
If you have Administrator privileges, the installer will install Perforce and configure it to run as an auto-starting NT service. The service will be set up and started after the installation is complete, and will automatically restart whenever the machine is rebooted. If you do not have Administrator privileges, a shortcut to run Perforce as a server will be placed into your Start menu.
If the installer detects older versions of Perforce client or server software on the machine, you will be given the option to rename the old executables to prevent PATH-dependent conflicts.
As with the typical administrator install, you will be prompted to specify the location of client and server executables, the port on the local machine where the Perforce server or NT service will listen to client requests, the default editor, and the default username.
Unlike the typical administrator install, you will be allowed to optionally specify separate directories for the client and server executables, as well as server root, server port, and whether to set up Perforce as an auto-starting (or non-auto-starting) NT service or server process. The locations of any existing P4LOG file and journal file are displayed for reference, and may be changed later using p4 set.
If you try to install a Perforce service while another Perforce server is running, you will see the error message:
Setup has determined that a Perforce Server could be running. Please shut down all Perforce Servers before continuing the installation.
Failure to shut down the running Perforce server(s) will result in conflicts between the newly-installed service and the existing server.
As with the other installation options, if the installer detects older versions of Perforce client or server software on the machine, you will be given the option to rename the old executables to prevent PATH-dependent conflicts.
The uninstall procedure removes everything except your server data; the Perforce server, service, and client executables, registry keys, and service entries will all be deleted. The database and depot files in your server root, however, will be preserved.
Throughout most of the documentation set, the terms "Perforce server" or "p4d" are used to refer to "the process at the back end that manages the database and responds to requests from Perforce clients". Under NT, this can lead to ambiguity; the back-end process can run as either an NT service (p4s.exe, which runs as a thread) or as an NT server (p4d.exe, which runs as a regular process). From an NT administrator's point of view, these are important distinctions; consequently, the terminology used in this chapter uses the more precise definitions.
The Perforce service (p4s.exe) and the Perforce server (p4d.exe) executables are copies of each other; they are identical apart from their filenames. When run, they use the first three characters of the name with which they were invoked (i.e. either p4s or p4d) to determine their behavior. For example, invoking copies named p4smyserver.exe or p4dmyservice.exe will invoke a service and a server, respectively.
If you are running at Release 99.2 or above, you can also use the command:
p4 admin stop
to stop the Perforce NT service.
You can also start the Perforce server manually from an MS-DOS window. The server executable, p4d.exe, is normally found in your P4ROOT directory. To start the server, first make sure your current P4ROOT, P4PORT, P4LOG, and P4JOURNAL settings are correct, then run: %P4ROOT%\p4d
If you want to start a server using settings different than those set by P4ROOT, P4PORT, P4LOG, or P4JOURNAL, you can use p4d command line flags. For example:
c:\test\p4d -r c:\test -p 1999 -L c:\test\log -J c:\test\journal
will start a Perforce server process with a root directory of c:\test, listening to port 1999, logging errors to c:\test\log, and with a journal file of c:\test\journal.
Note that p4d command line flags are case-sensitive.
If you are running at Release 99.2 or above, use the command:
p4 admin stop
to stop the Perforce NT server.
If you are installing your server root on a network drive, the Perforce installer (perforce.exe) will request a valid combination of userid and password at the time of installation. This user must have administrator privileges. (The service will also run as this user, rather than System)
While the Perforce NT service will run reliably using a network drive as the server root, there is still a marked performance penalty due to of increased network traffic and slower file access; for this reason, we recommend that the depot files and Perforce database be on a drive local to the machine on which the Perforce NT service is running.
You can, however, install additional NT services to start up additional Perforce servers (i.e. as NT services) automatically.
If your intent is to set up multiple services to increase the number of users you support without purchasing more user licenses, you are violating the terms of your Perforce License Agreement.
Before you begin, you should read and understand "NT configuration parameter precedence" on page 77. Once you understand the precedence of environment variables in determining Perforce configuration, you'll find setting up multiple Perforce NT services to be straightforward. To add a new service, you need only:
You wish to create a second Perforce service with a root in C:\p4root2 and a service name of
"Perforce2". You're running Release 99.1/10994 or greater, and the svcinst executable is in the server
root of his first Perforce NT service, which is in C:\perforce.
Verify that your p4d.exe executable is at Release 99.1/10994 or greater:
(We'll assume the revision level is correct; if not, you'd have to download a newer version from
http://www.perforce.com and upgrade the server before continuing.)
Create a P4ROOT directory for the new service:
Copy the server executables - both p4d.exe (the server) and p4s.exe (the service) - and your license file into
the new directory:
copy c:\perforce\p4d.exe c:\p4root2
copy c:\perforce\p4d.exe c:\p4root2\p4s.exe
copy c:\perforce\license c:\p4root2\license
Use svcinst.exe, (the service installer) to create the "Perforce2" service:
svcinst create -n Perforce2 -e c:\p4root2\p4s.exe -a
After the "Perforce2" service has been created, set the service parameters for the "Perforce2" service:
p4 set -S Perforce2 P4ROOT=c:\p4root2
p4 set -S Perforce2 P4PORT=1667
p4 set -S Perforce2 P4LOG=log2
p4 set -S Perforce2 P4JOURNAL=journal2
Finally, use the service installer to start the "Perforce2" service:
The second service is now running, and both services will be started automatically when you next reboot NT.
While not all Perforce failures are caused by OS-level problems, a number of symptoms may indicate the OS is at fault. Examples include: the system crashing, the Perforce server exiting without any error in its log and without Windows indicating that the server crashed, or the Perforce NT service not starting properly.
Many of these problems may be resolved by installing NT Service Packs. A machine running NT 4.0 with Service Pack 6 and a plain VGA video driver is very stable.
In particular, Perforce support personnel have also found that many NT sites have been able to reduce or eliminate OS-level instability problems by re-installing NT Service Pack 6; consequently, we recommend that SP6 be installed on any Windows NT system running the Perforce server or service.
In some cases, installing third-party software after installing an NT Service Pack can overwrite critical files installed by the service pack; reinstalling your last-installed service pack will often correct these problems. If you've installed another application after your last service pack, and server stability appears affected since the installation, consider reinstalling the service pack.
As a last resort, it may pay to install Perforce on another system to see if the same failures occur, or even to reinstall the OS and Perforce on the faulty system.
The reason for this is that Perforce clients sometimes use the DOS shell (cmd.exe) to start programs such as user-specified editors or diff utilities. Unfortunately, the DOS shell knows that when a Windows command is run (e.g. a GUI-based editor like notepad.exe), it doesn't have to wait for the command to complete before terminating. When this happens, the Perforce client then mistakenly believes that the command has finished, and attempts to continue processing, often deleting the temporary files that the editor or diff utility had been using, leading to errors about temporary files not being found, or other strange behavior.
You can get around this problem in two ways:
Perforce 2000.1 System Administrator's Guide (2000.1.sa.3) | ||
<< Previous Chapter Tuning Perforce for Performance |
Table of Contents Index Perforce on the Web |
Next Chapter >> Perforce Server (p4d) Reference |