## Secondary Publishing Agents To ensure users do not experience an interruption of the service due to a failure of the master RAS Publishing Agent, one or more secondary Publishing Agents can be added to a site. With one or more secondary agents installed, the runtime data is replicated on each agent, so if any service fails, the downtime is reduced to a minimum. In addition, any active RAS Publishing Agent will be used for authentication purposes with both the AD and any 2nd level authentication provider used. The master RAS Publishing Agent performs the same tasks as secondary Publishing Agents but has additional responsibilities. It manages certain processes that have to be managed by a single Publishing Agent. The following table lists processes managed by the master Publishing Agent and secondary Publishing Agents:
Process | Master Publishing Agent | Secondary Publishing Agents
Monitor PAs (counters) | Yes | Yes
Monitor Terminal Servers (counters) | Yes | Yes
Monitor VDI Hosts (counters) | Yes | Yes
Monitor TS Sessions (reconnection) | Yes | Yes
Monitor Deployed TS applications | Yes | Yes
Monitor VDI session (reconnections) | Yes | Yes
Manage system settings | Yes | No
Send licensing information & heart beat | Yes | No
Process and send CEP information | Yes | No
Send information to reporting server | Yes | No
Manage TS scheduler | Yes | No
Reporting engine information | Yes | Future versions
Shadowing | Yes | Future versions
Send email notifications | Yes | No
As a demonstration of how load distribution between multiple Publishing Agents works, consider the following example: Suppose we have two Publishing Agents: PA1 (master) and PA2 (secondary). Suppose we also have 10 Terminal Servers: TS1, TS2 ... TS10 The resulting load will be distributed as follows: TS1, TS2 ... TS4 will use PA1 as their preferred Publishing Agent. TS5, TS6 ... TS10 will use PA2 as their preferred Publishing Agent. Planning for secondary publishing agents RAS Publishing Agents running on the same site communicate with each other and share the load. The amount of data being transmitted from one agent to another is quite large, so a reliable high-speed communication channel must be ensured (e.g. a subnetwork can be configured for Publishing Agent communications). When adding a secondary Publishing Agent to a site, you specify an IP address for it. Make sure that the IP addresses of all agents belong to the same network segment. The port that Publishing Agents use to communicate with each other is TCP 20030. There's no physical limit to how many Publishing Agents you can add to a site. However, the best results are achieved with only 2-3 agents present (the two agent scenario is recommended). Note: Adding more than 2-3 secondary Publishing Agents to a site may have a reverse effect and actually degrade the system performance. Adding a secondary RAS Publishing Agent to a site To add a secondary RAS Publishing Agent: In the RAS console, navigate to Farm / Site / Publishing Agents. Click the Tasks drop-down menu and choose Add to launch the Add RAS Publishing Agent wizard. The Server field specifies the FDQN or IP address of the server that hosts the RAS Publishing Agent. The IP field specifies the server IP address. Click the Resolve button to obtain the IP address automatically using the FQDN specified in the Server field. The Alternative IPs field specifies one or more alternative IP addresses, separated by a semicolon. These addresses will be used if RAS Secure Client Gateways fail to connect to the RAS Publishing Agent using it's FQDN or the address specified in the IP field. This can happen, for example, if Gateways are connecting from a different network, which is not joined to Active Directory. Select the Install a gateway with a publishing agent option if you also want to install a RAS Secure Client Gateway on the specified server. If you select this option, you may also select the Add an SSL certificate and enable HTML5 Gateway option (for more info, please see Enable HTML5 Support on the Gateway). Select the Add Firewall Rules option to automatically configure the firewall on the server. Click Next. On the next page, click Install to install the RAS Publishing Agent on the server. The Installing RAS Redundancy Service dialog opens. Select the server on which the RAS Publishing Agent is to be installed and click Install. Click Done. Click OK to add the server to the farm.