Helix Core Server Administrator Guide: Multi-Site Deployment (2019.1)

Creating the replica

To configure and start a replica server, perform the following steps:

Important

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.

  1. 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)

  2. Move the checkpoint to the replica server’s P4ROOT directory and replay the checkpoint:

    $ p4d -r /p4/replica -jr $P4ROOT/checkpoint.1
  3. 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.)

  4. 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 a P4NAME of Replica1, 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 and lbr.replication set to readonly, 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

    Starting the replica