Backing up services
How you back up a service in your multi-server deployment depends upon the service type:
Broker |
|
Proxy |
|
Server |
|
Taking checkpoints on Edge and Replica Servers
First, run p4 admin checkpoint
against the edge or replica:
p4 -p edge:1666 admin checkpoint -Z
The background journal
pull
command will perform the checkpoint at the next rotation of the journal on the master.This results in a message about the scheduling of the checkpoint and a file called
stateCKP
being written to the edge or replica server root (P4ROOT) directory containing information about the scheduling of the checkpoint. For example:
Checkpoint scheduled at 1472141783 (2020/03/26 09:16:23 -0700 PDT ); opts:
To cancel a scheduled checkpoint, remove the
stateCKP
file from the edge or replicaP4ROOT
prior to rotating the journal on the commit or master server.
Second, run p4 admin journal
against the commit or master:
p4 -p commit:1666 admin journal
Rotating journal to journal.40...
NoteDo not use the
-z
flag top4 admin journal
orp4d -jj
This is because rotated commit and master server journals initially need to be uncompressed. Otherwise replication could be adversely affected.
Detecting coordinated checkpoint completion
To determine that a coordinated checkpoint has completed, record the journal counter on the commit or master at the time the edge or replica checkpoint is scheduled. For example, the following counter
command, run against your commit or master server, reports the current value of the journal counter on that server. The admin checkpoint
command, run on the edge or replica, schedules a checkpoint on that server the next time a journal rotation is detected on the master.
p4 -p commit:1666 counter journal 40 p4 -p edge:1666 admin checkpoint -Z The 'pull' command will perform the checkpoint at the next rotation of the journal on the master.
In the example above, the journal counter is reported as 40
, which means that the next checkpoint will be 41
. To find out whether the checkpoint has completed, use one of the following.
Checkpoint ChecksumWhen a checkpoint completes, an md5 checksum of the checkpoint contents is written alongside the checkpoint: $ ls -l edge1/checkpoint.41* -r--r--r-- 1 bruno staff 11833462 Aug 25 09:59 checkpoint.41 -r--r--r-- 1 bruno staff 55 Aug 25 09:59 checkpoint.41.md5 Look for the writing of the md5 checksum, which means the checkpoint has completed. |
A
|
Checkpoint HistoryThe p4 journals command displays information from the p4 journals -F type=checkpoint -m1 ... start 1472142210 ... startDate 2018/08/25 09:23:30 ... end 1472142211 ... endDate 2018/08/25 09:23:31 ... pid 53536 ... type checkpoint ... flags -q true (admin checkpoint) ... jnum 40 ... jfile checkpoint.40 ... jdate 1472142211 ... jdateDate 2018/08/25 09:23:31 ... jdigest 7A5080F52EC13518305AD2A93919864A ... jsize 11833462 ... jtype text Once a checkpoint has been scheduled and you know the checkpoint sequence number of the next edge or replica checkpoint, poll the edge or replica using p4 journals for the next checkpoint:
The command returns without providing any output until the checkpoint has completed, at which time you'll see the details of the checkpoint completion in the p4 journals output:
Note
If a checkpoint fails, the p4 journals output contains information about the failure, including the error message related to the failure. For example: p4 journals -m1 ... start 1452184543 ... startDate 2018/01/07 08:35:43 ... end 1452184543 ... endDate 2018/01/07 08:35:43 ... pid 98622 ... type checkpoint ... flags (admin checkpoint) ... jnum 41 ... jfile /Volumes/backups/checkpoint.41 ... jdate 1452184543 ... jdateDate 2018/01/07 08:35:43 ... jdigest CFF44FD4B9B26AD90F93AC71D4E47418 ... jsize 65536 ... jtype text ... failed 1 ... errmsg write: /Volumes/backups/checkpoint.41: No space left on device |