This document is to failover an edge server to the standby edge that is using journalcopy for replication.
We assume the instance number for the server you are failing over to be 1 in this document.
Conventions:
edge_id = server id for your edge server
edge_standby_id = server id for your edge standby server
svc_edge_id = service user for the edge master
svc_edge_standby_id = service user for the edge standby
The OSUSER name is assumed to be perforce
Planned failover:
Current edge master:
/p4/1/bin/p4d_1_init stop
Current edge standby that you are converting to the edge master:
/p4/1/bin/p4d_1_init stop
cd /p4/1/root
echo edge_id > server.id
echo p4d_edge > sdp_server_type.txt
rm state*
rm -f /p4/1/logs/journal
ls -lah /p4/1/journals.rep/
(Look for the highest numbered journal file. I'll use p4_1.jnl.12 in this example)
mv /p4/1/journals.rep/p4_1.jnl.12 /p4/1/logs/journal
/p4/1/bin/p4d_1 -r /p4/1/root -jr -f /p4/1/logs/journal (This will ensure the whole journal is replayed into the database)
/p4/1/bin/p4d_1_init start
If you use the server address field on the server form, be sure to update that to have the correct information.
Now you can update DNS or move the VIP depending on how you handle getting users to the correct machine.
rsync -av perforce@original_edge_master.company.com:/p4/1/checkpoints/ /p4/1/checkpoints/ (This is to make sure the new edge master has all of the rotated journals and the current checkpoint)
Back on the original edge master, now to be the standby.
cd /p4/1/root/
echo edge_standby_id > server.id
echo p4d_edgerep > sdp_server_type.txt
rm -f state*
rm -f rdb.lbr
rm -f /p4/1/journals.rep/*
rm -f /p4/1/logs/journal*
/p4/common/bin/p4master_run 1 p4 -p edge_master_server:port login -a < /p4/common/config/.p4passwd.p4_1.admin
/p4/common/bin/p4master_run 1 p4 -p edge_master_server:port login svc_edge_standby_id
/p4/1/bin/p4d_1_init start
Unplanned failover:
Just do the steps under "Current edge standby that you are converting to the edge master:" section.
Note, if the edge master is down and the edge standby did not get to run the sync_replica.sh script to pull over the most recent checkpoint and rotated journal, then you will need to move the previous rotated journal from /p4/1/journals.rep/ over to /p4/1/checkpoints/. In our example above, the command would be:
mv /p4/1/journals.rep/p4_1.jnl.11 /p4/1/checkpoints/