Creating the replica
To configure and start a replica server, perform the following steps:
-
Boot-strap the replica server by checkpointing the master server, and restoring that checkpoint to the replica:
$ p4 admin checkpoint
(For a new setup, we can assume the checkpoint file is named
checkpoint.1) -
Move the checkpoint to the replica server’s
P4ROOTdirectory and replay the checkpoint:$ p4d -r /p4/replica -jr $P4ROOT/checkpoint.1
-
Copy the versioned files from the master server to the replica.
Versioned files include both text (in RCS format, ending with
,v) and binary files (directories of individual binary files, each directory ending with,d). Ensure that you copy the text files in a manner that correctly translates line endings for the replica host’s filesystem.If your depots are specified using absolute paths on the master, use the same paths on the replica. (Or use relative paths in the
Map:field for each depot, so that versioned files are stored relative to the server’s root.) -
To create a valid ticket file, use
p4 loginto connect to the master server and obtain a ticket on behalf of the replica server’s service user. On the machine that will host the replica server, run:$ p4 -u service -p master:11111 login
Then move the ticket to the location that holds the
P4TICKETSfile for the replica server’s service user.
At this point, your replica server is configured to contact the master server and start replication. Specifically:
- A service user (
service) in a group (service_group) with a long ticket timeout - A valid ticket for the replica server’s service user (from
p4 login) -
A replicated copy of the master server’s
db.config, holding the following preconfigured settings applicable to any server with aP4NAMEofReplica1, specifically:- A specified service user (named
service), which is equivalent to specifying-u serviceon the command line - A target server of
master:11111, which is equivalent to specifying-t master:11111on the command line - Both
db.replicationandlbr.replicationset toreadonly, which is equivalent to specifying-M readonly-D readonlyon the command line - A series of
p4 pullcommands configured to run when the master server starts
ImportantTo avoid configuration problems, the value of
serverIDshould always match the value of P4NAME if both are set. We recommend settingserverID, but supportP4NAMEfor backward compatibility.Next step
- A specified service user (named
Your search for returned result(s).






