Configuring the master server for the forwarding replica
The steps on this page assume you have logged into the master server as the Helix Core user with the access level of super. See Permission levels and access rights in the p4 protect topic of Helix Core Command-Line (P4) Reference. That user can have any name, but for convenience the examples use super:
p4 -u super login
On the master server, configure the forwarding replica. We might name the forwarding replica fwd-1667 because we will configure it to use port 1667:
$ p4 -u super server fwd-1667
A default server spec appears.
Spec configuration
On the master server, configure the server spec for the forwarding replica by adding some configurables and setting their values. In this example, the ServerID is fwd-1667, the replica host name is forward, and forward:1667 is its Address:
ServerID: fwd-1667
Name: fwd-1667
Type: server
Services: forwarding-replica
Address: forward:1667
DistributedConfig:
db.replication=readonly
lbr.replication=readonly
lbr.autocompress=1
startup.1=pull -i 1
startup.2=pull -u -i 1
startup.3=pull -u -i 1
P4TARGET=master:1666
serviceUser=service
monitor=1 # optional but required if using the 'p4 monitor show' command
journalPrefix=/p4/journals/fw-replica # recommended
P4TICKETS=/p4/.p4tickets # recommended
P4LOG=/p4/logs/fw-replica.log # recommended
Description:
Forwarding replica pointing to master:1666
- For the optional fields, you can use your own naming conventions.
- For the Address field, see Communicating port information.
- The DistributedConfig: section might contain fields starting any#, such as
any#P4LOG=perforce.log
any#serverlog.file.2=logs/commands.csv
These are options configured on the master server that, by default, apply to any server for which it is a master. To override such a configurable for the replica, add it before or after the fields containing any#
For example:
any#P4LOG=perforce.log
any#serverlog.file.2=logs/commands.csv
P4LOG=perforce.read-only.log
serverlog.file.2=logs/my-subdirectory/commands.csv
Service user creation
In replicated and multi-server environments, a service user is required. See p4 user in the Helix Core Command-Line (P4) Reference.
The steps on this page assume you have logged into the master server as the Helix Core user with the access level of super. See Permission levels and access rights in the p4 protect topic of Helix Core Command-Line (P4) Reference. That user can have any name, but for convenience the examples use super:
p4 -u super login
-
Create the service user for the replication service. For example:
$ p4 -u super user -f service
The default user specification opens in your default editor. To make this user be of type service, add the following line:
Type: service
- Save the user specification and exit your default editor.
-
Use the p4 group command to create a group for your service users and set the value of the timeout field. To avoid service users being logged out, consider using unlimited as the Timeout value. See Tickets and timeouts for service users.
-
Set the service user group protections to
superin your protections table. See Service users. - Set the level of security to 3 or higher on the master server. See Server security levels.
For example,
$ p4 -u super configure set security=4 - Ensure the service user is protected with a password:
$ p4 -u super passwd service






