Creating the replica
To configure and start a replica server, perform the following steps:
To avoid configuration problems, the value of serverID
should always match the value of P4NAME if both are set. We
recommend setting serverID
, but support P4NAME
for backward compatibility. Use the p4 serverid command to set the serverID.
-
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
P4ROOT
directory 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 login
to 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
P4TICKETS
file 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 aP4NAME
ofReplica1
, specifically:- A specified service user (named
service
), which is equivalent to specifying-u service
on the command line - A target server of
master:11111
, which is equivalent to specifying-t master:11111
on the command line - Both
db.replication
andlbr.replication
set toreadonly
, which is equivalent to specifying-M readonly
-D readonly
on the command line - A series of
p4 pull
commands configured to run when the master server starts
Next step
- A specified service user (named
Your search for returned result(s).