Discussion:
[p4] Converting commit server to replica without checkpoint?
Michael Mirman
2017-02-23 22:48:08 UTC
Permalink
We swap a commit server with a standby replica on a monthly basis (controlled fail-over).
When we start any server, we use the -In option, which specifies the server id.
(We also write P4ROOT/serverid file, but it's more for an assertion check.)

So, when we fail over, we have to swap those id's. Say, if your commit server is called Master and replica is Replica, you shut down both, and then restart with the swapped id's in the -In option.
Does it make sense?
--
Michael Mirman
MathWorks, Inc.
3 Apple Hill Drive, Natick, MA 01760
508-647-7555
-----Original Message-----
Behalf Of Sean Houghton
Sent: Thursday, February 23, 2017 5:35 PM
Subject: [p4] Converting commit server to replica without checkpoint?
Posted on behalf of forum user 'Sean Houghton'.
I'm setting up commit and replica servers and I would like to swap their
roles automatically on a schedule. Stopping the old commit server and
restarting
the replica as the new commit server works, but when I try to start the old
commit server as a replica I get errors about it still being a commit-server.
I'm assuming this is because the "p4 server" definition still
includes "Services commit-server" locally (the services have been
swapped in the new commit server's database).
I know I could take a synchronous checkpoint on the new commit server to
seed
the new replica, as mentioned here
[http://answers.perforce.com/articles/KB/2495] , but that could take hours
or
days. Is there any way to convert the old commit server into a functional
replica without causing a huge service outage? I could introduce a third
replica
and take an "offline" checkpoint there, but that just makes things
more complicated to orchestrate.
I'm using P4NAME to control replication configuration which has been
pre-configured for each server to function as either commit or replica
servers.
server_1��|���� This server is configured as a
type of commit-server. Database and librarian replication flags have been
ignored.
server_1��| Perforce Server starting...
server_1��|���� 2017/02/23 19:59:10 pid 45
server_1��|���� Pull only allowed on replica
servers.
--
http://forums.perforce.com/index.php?/topic/5192-converting-commit-
server-to-replica-without-checkpoint
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http://maillist.perforce.com/mailman/li
Michael Mirman
2017-02-24 18:17:17 UTC
Permalink
Our procedure is shorter. We don’t have to change P4TARGET on disk. We have -t option on the command line.

The command line to start p4d actually does not change. What changes is *where* we run it.
The commit server is always started by something like
p4d -d -p 1666 -In Master -u service -r $dbroot -J $jnlroot/journal
and its standby replica is always started by
p4d -d -p 1666 -In Standby -r $dbroot -J off -t $master:1666

In these commands $dbroot and $jnlroot actually don’t change.
What changes is $master - depending on which host it is today, and *where* these commands run (again, they flip).

Back to the list of actions:
- make sure the replica is completely caught up with the commit server
- stop both servers
- swap server ID on both servers - meaning, rewrite P4ROOT/serverid on both hosts
- start up the new commit server (no -t option, and -In Master)
- start up the old commit server server (-t option, and -In Standby)
- change Address and ExternalAddress values for both server IDs with "p4 server" on the new commit server

We do other things, but they are probably irrelevant for you.
For example, we keep the archive mounted read-only on the replicas and writable on the actual servers (commit and edge).
But that's to make sure that replicas don't interfere in any way with the archive files.
--
Michael Mirman
MathWorks, Inc.
3 Apple Hill Drive, Natick, MA 01760
508-647-7555
-----Original Message-----
Behalf Of Sean Houghton
Sent: Friday, February 24, 2017 1:00 PM
Subject: Re: [p4] Converting commit server to replica without checkpoint?
Posted on behalf of forum user 'Sean Houghton'.
I'm only changing the "-In" argument when I restart pd4 which
changes P4NAME but leaves the server id intact. My expectation was that
you
could change the "role" of a server while still keeping its identity.
It sounds like the common practice is to actually swap the identity of two
servers rather than just changing the configuration with P4NAME.
The documentation says
The recommended technique for configuring servers in a multi-server
installation
is to give each server its own serverid, and specify the server configuration
for that serverid; specifying a separates P4NAME
[https://www.perforce.com/perforce/r14.2/manuals/cmdref/P4NAME.html
] for the
server is generally not necessary,
" give each server its own serverid " is misleading given that you
need to play musical chairs with serverids as part of a controlled failover.
So this is the process?
- stop both servers
- swap server ID on both servers
- start up the new commit server
- change��Address value for both server IDs with "p4
server" on the new commit server
- change P4TARGET for the replica with "p4 configure" on the new
commit server
- change P4TARGET for the replica with "p4d -cset" on the old commit
server
- start up the old commit server server
--
http://forums.perforce.com/index.php?/topic/5192-converting-commit-
server-to-replica-without-checkpoint
_______________________________________________
perforce-user mailing list - perforce-***@perforce.com
http:/
Robert Cowham
2017-02-24 18:34:57 UTC
Permalink
This post might be inappropriate. Click to display it.
Loading...