Setting up a SQL AlwaysOn Availability Group for App-V 5

App-V 5 uses two Microsoft SQL databases. One to store information about virtual applications, users, configuration settings, etc. And another to store Reporting information.

There are two common ways to create the databases:

– Run the App-V setup on the SQL server;

– Extract the SQL scripts, modify the content and run the scripts on the SQL server;

The second method is also possible in combination with Falko’s PowerShell scripts to modify the SQL script. More info here.

When the database is created, it is possible to make this database high available using the options within SQL server.

There are two options to make the database high available:

– Mirroring

– AlwaysOn

Pros and Cons of SQL of SQL High Available options:

Mirroring AlwaysOn
Feature of SQL Standard
Feature of SQL Enterprise
Requires Windows Cluster
Creates DNS record
Creates computer account
Group failover (multiple databases at once)
Accessible replica (for backup, reports, etc)
Preferred by Microsoft

I prefer to use AlwaysOn even if it requires the Enterprise edition of SQL and a Windows Cluster is required (more complex). Shared storage is not necessary for the cluster and you can use Windows Server 2012 R2 Standard.

This post describes the complete installation of the cluster, SQL Server 2012 Enterprise and the configuration of SQL AlwaysOn. If you are only interested in AlwaysOn, skip to step 3.

The following steps will be described:

1) Create a Windows 2012 R2 Cluster

2) Set up SQL 2012 R2

3) Create a High Available AlwaysOn database

 

Step 1 – Create a Windows cluster



 

Start Server Manager and click on Add Role

Click Next

image
Click Next image
Click Next image
image
Click Next image
Select Failover Clustering image
Click Add Features image
Click Next image
Click Install image
Click Close image

 

Repeat the steps above for the second (and perhaps more) server(s).
Make sure the drive letters are identical.

When the Windows Cluster role is installed on all servers, open the Windows Cluster Manager on the first server.

 

Configure the Windows cluster

 

Right click on Fail Over Cluster
Click on Create Cluster
image
Click Next image
Add all the computer objects that will be part of the cluster

Click Next

image
Click Next image
Click Next image
Click Next image
Click Next image
image
Click Finish image
Specify the cluster name and the IP address where clients will connect to.

Click Next

image
Click Next image
image
image
Click Finish image

The cluster is now created with (in my case) two nodes.

 

Step 2 – Set up SQL 2012 R2



 

Mount the SQL 2012 R2 Enterprise ISO

Click on New SQL Server Stand-Alone installation

(no need to click on SQL Server Failover Cluster!)

image
Click Ok image
Click Next image
Click Next image
No connection to Windows Update

Click Next

image
Click Install image
Click Next image
Click Next image
I installed the minimal required components for the App-V AlwaysOn configuration. And Reporting for future usage.

Click Next

image
Optional change the values.

Click Next

image
Click Next image
Optional: Change the Service Accounts image
Click Next image
Optional: Change the Authentication Modes image
In my configuration I have two additional disks. One for the databases and backup (D:\) and one for the Logs (E:\)

I modified the directories to these disks.

image
Click Next image
I will not configure reporting at this moment.

Click Next

image
Click Next image
Click Next image
Click Install image
image
Click Close image

 

Service Pack 1 Update

 

Click Next image
Click Next image
Click Next image
Click Next image
Click Next image
Click Update image
image
Click Close image

 

Enable AlwaysOn



 

AlwaysOn is disable by default, this must be enabled before this feature can be used.

Open the SQL Server configuration manager
Open the properties of the SQL Server service
image
Enable Enable AlwaysOn Availability Groups

Click Ok

image

 

Step 3 – Create a High Available AlwaysOn database

 

Now that all the pre-requisites are in place, it is possible to start with the set-up of the AlwaysOn configuration.

Open the properties of the App-V databases

Change the recovery model to Full

image
Create a backup of the database SNAGHTML13120fd
Create a new Availability Group image
Click Next image
Select both database

(group members will failover at the same time)

Click Next

image
Click Connect image
Select Automation Failover for both databases.

Select Synchronous Commit for both databases

(this makes transactions a bit slower but availability higher)

Select Readable Secondary for the Secondary database

Click Next

image
Click Next image
Click Next image
Enter the IP address of the Listener image
Enter the DNS name of the Listener

Click Next

image
Enter the path of the network folder. This folder will be used initially to synchronize the database. Afterwards it can be deleted.

Click Next

image
Click Next image
Click Finish image
image
The database is now in sync with the secondary on the second server. SNAGHTML14086f1

After the database is synchronized, the wizard has also created:

– A computer account in Active Directory with the Listener name;

– A DNS record with the name of the Listener;

– The Role within the Windows Cluster;

SNAGHTML17e3ca9

– Added the Listener IP address to the active node.

Using the Windows Cluster is it possible to failover de App-V database between two (or more) servers. It will do this automatically if a server is unavailable.

 

Modify the database connection afterwards

 

If the management server is already installed, it is possible to point to the AlwaysOn database by modifying the following registry keys:

 

HKEY_LOCAL_MACHINE\Software\Microsoft\AppV\Server\ManagementService

 

Modify:

– MANAGEMENT_DB_SQL_INSTANCE (default MSSQLSERVER)

– MANAGEMENT_DB_SQL_SERVER_NAME (change to Listner DNS name)

 

Check if MANAGEMENT_DB_NAME (AppvManagement) is still correct.

Restart the App-V

Advertisements
This entry was posted in App-V and tagged . Bookmark the permalink.

One Response to Setting up a SQL AlwaysOn Availability Group for App-V 5

  1. Pingback: App-V 5 Management Server DB on Remote Machine Configuration | Confessions of a Guru

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s