Perforce Public Knowledge Base - Server and Broker Addresses in "p4 info" Output on Linux
Reset Search
 

 

Article

Server and Broker Addresses in "p4 info" Output on Linux

« Go Back

Information

 
Problem

Where do the server address and broker address fields in the "p4 info" output come from?

Solution

SERVER ADDRESS

The p4 info command output on a server Server address field gets the address from the server. The server will either resolve the host name from the IP address, or if from the localhost, it will resolve to localhost.

When changing the system /etc/hosts on a Linux server entry to "bogus", the p4 info output for this server will be changed in the Server address field.

Example:

p4 info
User name: john
Client name: my_client
Client host: atlantic
Client root: e:\frombliss
Current directory: e:\frombliss
Client address: 10.0.10.51:1475
Server address: bogus:5493
Server root: /home/perforce/20111
Server date: 2012/02/06 17:20:26 -0800 PST
Server uptime: 100:00:32
Server version: P4D/LINUX26X86_64/2011.1/397313 (2012/01/04)
Authorization server: atlantic:15493
Server license: atlantic:15493
Case Handling: sensitive

A client on the Linux server that comes in through using the global option -p localhost will resolve the localhost address specified in the Server address field.

Example

 p4 -p localhost:5493 info
User name: bruno
Client name: myclient
Client host: gabriel
Client root: /home/perforce/myclient
Current directory: /home/perforce/main/release1/proj
Client address: 127.0.0.1:57255
Server address: localhost.localdomain:5493
Server root: /home/perforce/20111
Server date: 2012/02/06 18:00:42 -0800 PST
Server uptime: 100:40:48
Server version: P4D/LINUX26X86_64/2011.1/397313 (2012/01/04)
Authorization server: atlantic:15493
Server license: atlantic:15493
Case Handling: sensitive

This is because nsswitch.conf is set by default as follows:

hosts:      files dns

If /etc/nsswitch.conf is set to use DNS first, like this:

hosts:       dns files

The hostname will be resolved through DNS instead.

BROKER ADDRESS

The Broker address also comes from the server hosting the Perforce Broker. The name will change to localhost if the client specifies localhost.

Examples

Here the server is named bogus1. The user uses the IP address to connect to the Perforce Broker:

p4 -p 10.5.16.33:1668 info

User name: bruno Client is  broker-atlantic
User name: bruno
Client name: broker-atlantic
Client host: atlantic
Client root: E:\broker
Current directory: e:\broker
Client address: 10.5.16.33:59924
Server address: bogus1:5493
Server root: /home/perforce/20111
Server date: 2012/02/06 17:52:11 -0800 PST
Server uptime: 100:32:17
Server version: P4D/LINUX26X86_64/2011.1/397313 (2012/01/04)
Authorization server: atlantic:15493
Server license: atlantic:15493
Case Handling: sensitive
Broker address: bogus1:1668
Broker version: P4BROKER/LINUX26X86_64/2011.1.main/279655

In this example, the user is connecting to a Broker located on localhost:

p4 -p localhost:1668 info

User name: bruno Client is  broker
User name: bruno
Client name: broker
Client host: gabriel
Client root: /home/perforce/broker
Current directory: /home/perforce/broker
Client address: 10.5.16.33:59930
Server address: bogus1:5493
Server root: /home/perforce/20111
Server date: 2012/02/06 17:53:51 -0800 PST
Server uptime: 100:33:57
Server version: P4D/LINUX26X86_64/2011.1/397313 (2012/01/04)
Authorization server: atlantic:15493
Server license: atlantic:15493
Case Handling: sensitive

Broker address: localhost.localdomain:1668
Broker version: P4BROKER/LINUX26X86_64/2011.1.main/279655

Or the Perforce Broker broker.conf file specifies localhost instead
of an actual host name:

target          = localhost:1666;
listen          = 1668;
zeroconf        = false;
E:\>p4 -p 10.0.0.242:1668 info
User name: rfong
Client name: myvm
Client host: thisvm
Client root: E:\myvm
Current directory: e:\myvm
Peer address: 127.0.0.1:45926
Client address: 10.0.100.151
Server address: localhost.localdomain:1666
Server root: /home/perforce/20131
Server date: 2013/06/05 14:36:04 -0700 PDT
Server uptime: 19:51:36
Server version: P4D/LINUX26X86_64/2013.1/610569 (2013/03/19)
Server license: Foo Software 1000 users (expires 2013/12/31)
Server license-ip: 10.0.0.242
Case Handling: sensitive
Broker address: thebroker.perforce.com:1668
Broker version: P4BROKER/LINUX26X86_64/2012.1/473528

On Windows, when setting the server hostname in the C:\Windows\System32\drivers\etc\hosts file on the client the server name does not change because the Broker address field still comes from the Perforce server and not the client.  Here, the address was set to bogus3:

p4 -p bogus3:1668 info

User name: bruno 
Client Name: broker-atlantic
User name: bruno
Client name: broker-atlantic
Client host: atlantic
Client root: E:\broker
Current directory: e:\broker
Client address: 10.5.16.33:43461
Server address: bogus1:5493
Server root: /home/perforce/20111
Server date: 2012/02/06 17:57:14 -0800 PST
Server uptime: 100:37:20
Server version: P4D/LINUX26X86_64/2011.1/397313 (2012/01/04)
Authorization server: atlantic:15493
Server license: atlantic:15493
Case Handling: sensitive
Broker address: bogus1:1668
Broker version: P4BROKER/LINUX26X86_64/2011.1.main/279655

IP-LESS LICENSES

An IP-less license works with a specified fully qualified server, or domain, name (you may see this referenced as a FQDN). It can also do so with an alias on the Perforce server, such as the "hosts" file under Linux.

Example

With the following IP-less license:

# Perforce License File.
#
# This file enables the Perforce Server to support multiple users and
# workspaces.
#
# Install this file as 'license' (no extension) in the Perforce server
# root directory, where the db.* files live, then stop and restart the 
# server.  Run 'p4 info' to verify the server can read the license.
#
# The order of entries in this file is not important, but the values
# must be preserved literally.

License:    C8464AA5DD7A7824FD8F32DE32EFB1D6

License-Expires:    1339920000    # 2012/06/17

Customer:    Perforce Software

IPaddress:    bar.foo.com:22222

Users:    400

# This license works with 97.2 or later servers.

If hostname is not specified for the Perforce server, and the current host is not blah.foo.com, attempting to start the server with this license will result in a licensing error, as follows:

Perforce server error:
    Licensing error -- invalid server IP address.
    Name or service not known

This can be fixed by adding "blah.foo.com" as an alias to the server "hosts" file, as follows:

cat /etc/hosts

127.0.0.1 localhost.localdomain localhost
10.5.16.33 my_host bar.foo.com

Perforce Server now starts properly because it recognizes the machine it is running on is blah.foo.com, the licensed name.

p4 info

User name: bruno
Client name: a_client
Client host: my_host
Client unknown.
Current directory: /home/perforce/20121/a_client/workspace
Peer address: 127.0.0.1:39254
Client address: 127.0.0.1
Server address: my_host.foo.com:22222
Server root: /home/perforce/20121/blah
Server date: 2012/05/03 11:29:24 -0700 PDT
Server uptime: 00:00:05
Server version: P4D/LINUX26X86_64/2012.1/442152 (2012/04/06)
Server license: Perforce Software 400 users (expires 2012/06/17) 
Server license-ip: bar.foo.com:22222
Case Handling: sensitive

CLIENT HOST NAME

Perforce clients look at the client name sent.  If you receive the error
Client 'colombia' can only be used from host 'gabriel'
then run p4 info and change the "Client Host:" field to reflect this name. You can run
p4 client <clientname>
to change the "Client Host:" field.


IP ADDRESS IN P4 PROTECT

If an IP address is specified in p4 protect also run p4 info on the client. Make sure the IP address listed in the "Client address:" field matches the IP address.
Related Links

Feedback

 

Was this article helpful?


   

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255