p4 servers
Display list of all server specifications or evaluate replication status.
A user with operator privileges can execute p4
servers
and p4 servers -J
.
Syntax
p4 [g-opts] servers [-J | --replication-status]
Description
Syntax variants are described in the following subsections.
Listing server specifications
p4 servers lists all server specifications stored at a master Helix Core Server.
edge-server_1 server edge-server_1 10.0.101.55:41261 edge-server 'edge-server ' edge-server_2 server edge-server_2 10.0.101.55:47050 edge-server 'edge-server '
Output lists the server ID, the type, the services provided, and the description supplied when the server was created.
The output of p4 servers
is easier to parse if
you retrieve it in tagged form by including the -ztag
option (see Global options):
p4 -ztag servers
... ServerID commit-1
... Name
... Address
... Type server ... Services commit-server ... Options nomandatory ... Description commit-1 ... ServerID edge-server-1 ... Name ... Address ... Type server ... Services edge-server ... Options nomandatory ... Description edge-server-1 ... ServerID edge-server-2 ... Name ... Address ... Type server ... Services edge-server ... Options nomandatory ... Description edge-server-2 ... ServerID remote-standby ... Name ... Address ... Type server ... Services standby ... Options nomandatory ... ReplicatingFrom commit-1 ... Description Remote DR server ... ServerID standby-1 ... Name ... Address ... Type server ... Services standby ... Options mandatory ... ReplicatingFrom commit-1 ... Description Local HA server
The Options and ReplicationFrom fields that appear in tagged output are related to the failover feature. See p4 failover.
Evaluating replication status
Using the -J
or --replication-status
option
allows you to check how efficiently one or more replicas are replicating
the master server’s records. Given a server A
and a replica
B
, output for this command gives you two basic pieces of
information:
- The size and update time of
A
's journal. - For every server,
B
, that has sent ap4 pull
orp4 journalcopy
request, information is given as to when that request was sent and what is the persisted and applied state ofB
's journal. (In the case of a simple master and replica, the persisted and applied numbers are always the same:B
's journal is updated by thep4 pull
command.
This assumes that the command is executed with the master server as the target. A standby server can replicate master server records using two operations:
- It uses the
p4 journalcopy
command to copy (persist) the master server’s journal to the standby’s journal. - It uses the
p4 pull -L
command to apply the copied journal records to the standby’s database and to update its state file.
You can look at the output to evaluate the load on various parts of your multi-server system and to see how well your replicas are keeping up with the master. Growing lag times might be a reason for concern.
The untagged output of p4 servers -J
looks like
this:
edge-server_1 '2014/09/18 13:14:58' edge-server 5/258 5/258 WaDl/10 1 edge-server_2'2014/09/18 13:14:57' edge-server 5/258 5/258 WaDl/10 1
It is easier to interpret this output in tagged form:
... ServerID edge-server_1 ... Updated 2014/09/18 13:14:58 ... ServerType edge-server ... PersistedJournal 5 ... PersistedSequence 258 ... AppliedJournal 5 ... AppliedSequence 258 ... JAFlags WaDl/10 1 ... IsAlive 1 ... ServerID edge-server_2 ... Updated 2014/09/18 13:14:57 ... ServerType edge-server ... PersistedJournal 5 ... PersistedSequence 258 ... AppliedJournal 5 ... AppliedSequence 258 ... JAFlags WaDl/10 1 ... IsAlive 1
The meaning of the fields are described in the following table.
|
The server ID of the server. |
|
The date and time the requesting server last requested journal records from this server (normally the master). |
|
The server type. One of the following: |
|
The rotation number of the journal to which records are being persisted. |
|
The persisted journal position. For master servers, replicas, and workspace servers, the persisted and applied positions are always the same. They differ only for all types of standby servers. |
|
The rotation number of the applied journal. |
|
The applied journal position. For master servers, replicas, and workspace servers, the persisted and applied positions are always the same. |
|
Set of fields printed in upper-case if set or lower-case if not. The numeric value of the flags is displayed after the alphabetic display. Common field displays with their associated pull or journalcopy commands are as follows:
Symbols are to be interpreted as follows:
|
|
1 if the server is up; 0 if it’s down. |
Pull or journal-copy requests are recorded in the db.jnlack
table only if they are made from a replica that has a serverID
(or a P4NAME
, which is deprecated).
Options
|
Provides information about the server’s journal and about the replication status of all replicas that replicate from this server. |
|
See Global options. |
Usage notes
Can File Arguments Use Revision Specifier? | Can File Arguments Use Revision Range? | Minimal Access Level Required |
---|---|---|
N/A |
N/A |
an operator user can run |
Related commands
To edit or view a server specification |
|
To set a server’s unique ID |