p4 serverid
Get or set the unique ID associated with a Helix Server.
Syntax
p4 [g-opts] serverid [serverID]
Description
p4 serverid retrieves or sets the unique ID of a
Helix Server by reading or writing the server.id
file in the
server’s root directory.
When you configure servers in a multi-server installation, assign to each server its own unique ID and specify the server configuration for that unique ID.
Back up the server.id file
The server.id
file is in the server’s root directory (see P4ROOT),
and this file must be backed up. If you are using the p4 server
command to
configure your servers, and one of your servers suffers a catastrophic
data loss, any attempt to restart the restored server requires that the server.id
file be present (or
be re-created).
serverid and P4NAME
Use the p4 serverid command instead of setting the legacy P4NAME
environment variable. If both P4NAME
and serverid
are set, make sure that the value of serverid
matches the value of P4NAME
. Otherwise configuration problems can occur.
serverid and UUID
The p4 serverid
command can be run before or after the creation of a server spec. However, if you are creating a server spec with a unique ID (UUID), first run p4 server -g
to generate a UUID, and then run p4 serverid serverID
where serverID
is the UUID.
To create or reset the serverid
If you want to manually add a server.id
file or change the server ID:
- Run p4 info and make a note of your Helix Core Server root (see P4ROOT).
- Stop the server.
For example:
p4 admin stop -
Remove the existing
server.id
file.
For example:
cd /path/to/your-server-root-directory
rm server.id - Start the server.
- Run the p4 serverid command to assign an new server ID to your server.
p4 serverid yourNewNameForTheServer
- Adjust any configurables associated with the new server ID,
yourNewNameForTheServer
For example:
p4 configure show allservers
p4 configure set yourNewNameForTheServer#monitor=2 - Adjust the fields of the server specification that depend on the serverid value, such as ReplicatingFrom:
Options
|
If supplied, update |
|
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 |
list, or |
Related Commands
To edit or view a server specification |
|
To list all known servers |