HOW TO

Determine primary and standby machines in a highly available Portal for ArcGIS deployment (Windows)

Last Published: April 9, 2026

Summary

In a highly available Portal for ArcGIS deployment, administrators may need to determine which portal machine is acting as primary or standby when troubleshooting replication or synchronization issues. Highly available Portal deployments rely on PostgreSQL replication between machines. When replication or synchronization issues occur, validating backend role assignment helps confirm which machine is acting as primary or standby.

Use the following workflow when

  • Portal machines appear out of sync or report conflicting roles
  • High availability state is unclear during troubleshooting
  • Administrators need to verify which machine is primary and which is standby

Procedure

  1. Remote desktop to a portal machine.
  2. Check the database user.
    1. In File Explorer, navigate to C:\arcgisportal\db\pg_hba.conf.
    2. Open the file and check the database user.

The pg_hba.conf file open in Notepad with the username associated with address 127.0.0.1/32 highlighted by a red box.

Note:
If the username is not consistent for all local connections, use the one associated with 127.0.0.1/32.
  1. Open Command Prompt. 
  2. In Command Prompt, navigate to C:\Program Files\ArcGIS\Portal\framework\runtime\pgsql\bin.
  3. Run the command below, replacing <database_user> with the username retrieved in step 2.
psql.exe -U <database_user> -d gwdb -p 7654 -c "select pg_is_in_recovery();"
Note:
This command is read only. It does not modify portal data.
Note:
'-p 7654' refers to the PostgreSQL port.
Note:
This command is written for Windows, which does not require ./ before psql.exe.
  1. Enter the database password when prompted.
  2. Interpret the output.
    • If the output is f (false), the machine is the primary machine.
    • If the output is t (true), the machine is the standby machine.

The command and its output. In this example, the output is f.

  1. If the primary and standby roles are incorrect or inconsistent, follow established highly available portal recovery procedures or contact Esri Support for assistance. For more information, refer to the following articles:

Article ID: 000040488

Software:
  • Portal for ArcGIS

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options