This post has already been read 4064 times!
In this article I will walk you through the process of configuring the Microsoft SQL Database fail over for AppSense Personalization Server as well as the Management Server components of the AppSense UEM infrastructure.
The reason for writing this is that whilst building a config recently there is very little clear documentation for configuring the fail over aspect for the Microsoft SQL Database. There are details about setting this up in the AppSense guides but it is a small chapter right at the end of the document, also no single guide for configuring BOTH Environment Manager and the Management Center.
If you want to know about setting up Personalization Server fail over using Citrix NetScaler then please read my previous post here that details the steps you will need to achieve this.
I am assuming that you have a Microsoft SQL Mirror Pair already configured and a witness server in place to handle the fail over. For the purpose of this guide we can assume that our databases are running on the following servers:
- SQLSERVERA\INSTANCE (Primary)
- SQLSERVERB\INSTANCE (Mirror Pair)
Please note, this is only 1 way of achieving high availability of a database. You could front the SQL Database with a Citrix NetScaler and remove the need to edit the config files on the Personalization or Management Servers at all. If you want to read more about this click on this article.
Navigate to the following directory: C:\Program Files\AppSense\Environment Manager\Personalization Server
Open the “web.config” file and find the following line:
<add key=”SqlConnectionString” value=”RANDOM_TEXT_ENC#AQAAANCMnd8BFd” />
Now replace that line with: value=”Failover Partner=SQLSERVERB\INSTANCE”
NOTE: You do need to replace the line, the AppSense user guide is a little unclear about this. Remove the existing value and REPLACE it with the value of your Fail Over Partner. If you run the SQL instance on the default instance you would only specify the server name instead of servername\instancename
Log into your management server and open up powershell as an Administrator.
Run the following commands:
1. This command imports the module required to add the Failover Server
Import-ApsInstanceModule -ProductName “Management Server” – IsDefault
2. This command creates a variable called SecurePassword and assigns the encrypted password you specify to it. NOTE: This should be the password for your AppSense Service Account for access to the database.
$SecurePassword = ConvertTo-SecureString -AsPlainText “YourServiceAccountPassword” – Force
3. This creates a new object for the Service Account Credentials. NOTE: The username should be the Service Account you created for the AppSense Database Connection.
$ServiceCredential = New-Object System.Management.Automation.PSCredential (“DOMAIN\ServiceAccount”, $SecurePassword)
4. This command actually creates the connection to the primary and failover AppSense Management Database. If you are prompted to add missing data to the database feel free to click Yes. NOTE: If you changed the database name from the default ManagementServer you will need to change it in this command after -DatabaseName
Set-ApsServerDatabase -DatabaseServer “SQLSERVERA\INSTANCE” – DatabaseName ManagementServer -ServiceCredential $ServiceCredential – ConnectionString “Failover Partner=SQLSERVERB\INSTANCE”
Thats it, once you have done this you will have bothe Management and Personalization set up for SQL Mirroring fail over.