From my previous post of Implementing RD Connection broker High availability, I have described step by step on how to implement remote desktop connection broker in a high available scenario. It will make brokers high available but both brokers depend on one SQL server. Failure to the SQL server can lead to a service disruption.
From this article I’m going to high available the SQL server by using a SQL mirror. So brokers will not depend on one database server. Solution will be fully high availability supported J
![](/blog-images/blobs/post_83/blobid60.jpg?1603887798157)
Deployment prerequisites
- Please refer the Implementing RD Connection broker High availability article to create the high available RD brokers with SQL server.
- Another server to create the SQL mirror, Install the same SQL server version in the new server, use the same accounts as in mirror server.
- Witness server – this is for automatic fail over purpose. It can be another SQL server or Install SQL Express version on a server. No need of a dedicated server this can be a server that uses for other purpose
- Added firewall exceptions to all SQL servers.
Step 01 – Configure SQL mirror
- Please refer the following technet articles when crating the mirror.
http://technet.microsoft.com/en-us/library/ms189053.aspx
http://technet.microsoft.com/en-us/library/ms189047(v=sql.105).aspx
- Login to principle SQL server and connect to mirror database and witness database server from that management consol. Perform this step to identify the connectivity to all principle, witness and mirror database servers.
![](/blog-images/blobs/post_83/blobid61.jpg?1603887798157)
- Change the principle server’s RD database to full recovery mode.
- Please refer the technet article, I’m just only giving the steps that you have to perform.
http://technet.microsoft.com/en-us/library/ms189047(v=sql.105).aspx
- Backup the principle database and restore it in mirror server using NO RECOVERY mode
- Backup the transactions and restore it in mirror server using NO RECOVERY mode
Note – all SQL servers SQL service should run as a domain user. And check in mirror server side, Database should have sysadmin, owner, public right to the security group of RD brokers.
- Note – all SQL servers SQL service should run as a domain user. And check in mirror server side, Database should have sysadmin, owner, public right to the security group of RD brokers.
- Expand Databases, and select the database to be mirrored. Right-click the database, select Tasks, and then click Mirror. This opens the Mirroring Page of the Database Properties dialog box.
- Click Configure Security.
http://technet.microsoft.com/en-us/library/ms175919.aspx
If the mirror successful, check the failover
Step 02 – Configure RD brokers to support SQL mirror.
When configuring Remote desktop connection broker high availability, you have to provide the database connection string. Connection string point the SQL database to the brokers. Implementing RD Connection broker High availability article cover this. To support the SQL Mirror this connection string need to be changed. Modifying the connection string is not supported in GUI, but it can be edited using PowerShell.
- Login to a Broker server and open PowerShell in run as a administrator.
- to import the PowerShell module type
Import-Module remotedesktop
- To check the current configurations type following command –
Get-RDConnectionBrokerHighavailablity
- Set the connection string
Set- RDDatabaseConnectionString -DatabaseConnectionString “DRIVER=SQL Server Native Client 10.0;SERVER=<Principle server name>;Failover_Partner=<Mirror Server>;Trusted_Connection=Yes;APP=Remote Desktop Services Connection Broker;Database=<DatabaseName>;
- If the command succeeds, confirm it in GUI mode.
![](/blog-images/blobs/post_83/blobid62.jpg?1603887798158)
To test the configurations, fail over the principle database to the mirror using SQL management console. After that refresh the connections from Server manager – Remote desktop services - collections – connections and refresh. If mirror successful RD connections will remain connected.
If the connections are empty, that means broker servers are not connecting to the mirror server database, most common problem is database security in mirror server. So check all brokers have full access to the mirror database and mirror database saved folder.
![](/blog-images/blobs/post_83/blobid63.jpg?1603887798158)
Hope this information is useful
Cheers
Asitha