Wednesday, August 22, 2012

Adding a SQL Mirror to an Existing Lync Server 2013 Back-End

NOTE: The following post is based on Lync Server 2013 Preview. Procedures and screenshots are subject to change when Lync Server 2013 is RTM.

Lync Server 2013 now supports SQL mirroring (synchronous) for back-end databases.  In fact, this is the preferred/supported configuration.  This post will describe how to add a SQL mirror database to an existing pool’s back-end SQL instance.  This post is not meant to show SQL specific configurations. 

Here are a few prerequisites, requirements, and notes:

  • All SQL servers including the mirror must be at the same SQL version
  • The two SQL mirror nodes must use the same Edition, the mirror can be different
  • Use a witness server if you want to achieve automatic failover of the SQL database between the mirror
  • You must deploy the witness at the same time as the mirror is set up within the Lync topology
  • The database instance that will be used as the mirror should have the same LUN/file path configuration as the primary database
  • The SQL mirror does not need to be configured beforehand, publishing the Lync topology will configure and enable mirroring
  • The SQL servers and witness must be members of the same domain

In my example, I am going to deploy the SQL mirror without a witness server due to lab constraints.  This post also assumes that you have a second SQL instance already configured to host the mirrored databases.

If you are adding the SQL mirror after deploying your primary database, make sure that the mirroring port is configured on the SQL instance in the topology.  You can see this setting by navigating to Site –> Shared Components –> SQL Server Stores

Lync 2013 - SQL Mir - 2 primary port define

First step is to edit the topology.  Navigate to the Enterprise Front-End pool and select Edit Properties…

Lync 2013 - SQL Mir - Edit Pool

Check the option to Enable SQL Server store mirroring, then click the New… button:

Lync 2013 - SQL Mir - Edit Pool - assoc - markup

Next define SQL server store for the mirror:

Lync 2013 - SQL Mir - define sql

Click OK and then publish your topology.  You will be prompted to configure a File Share on the Create Mirror Databases dialog:

Lync 2013 - SQL Mir - publish

Click on the “File Share is required” error and click Settings… button and define a files share:

Lync 2013 - SQL Mir - publish - sql file share2

Remember, for your file share to make sure the proper permissions are set up so that both SQL servers have access to the share.  Thanks to Doug Deitterick’s Blog for that help.

Lync 2013 - SQL Mir - file share perms

Finish the Publishing Wizard, make sure everything is a “Success”. 

Lync 2013 - SQL Mir - publish - success

Also, check the “To-Do List” link. It says I need to restart my Lync services on the FE Pool servers.  This can easily be done by running:

Get-CsWindowsService | Stop-CsWindowsService

Get-CsWindowsService | Start-CsWindowsService

Lync 2013 - SQL Mir - restart services

Checking the SQL Mirror Node, we can see the Lync databases:

Lync 2013 - SQL Mir - mirror node check

You can also added your Monitoring and Archiving databases to the SQL mirror by editing the topology and adding the already defined mirror on those databases:

Lync 2013 - SQL Mir - Edit Pool - ArchMon

This post described how to add SQL mirroring to your Lync Server 2013 back-end.

7 comments:

  1. Hi Tim, a couple of questions.

    re: "The database instance that will be used as the mirror should have the same LUN/file path configuration as the primary database".

    I am confused by this. Are you saying the the SQL instance used for the mirror needs to be on the same file path as the SQL instance I use for the mirror?

    re: The File Path.

    Why is there a file share needed? Isn't the mirror all done in SQL (i.e. SQL db mirroring)?

    Maybe I am not understanding the SQL mirroring functionality. Does the primary write to disk (the file share) before sending it to another SQL instance to be mirrored?

    Thanks

    ReplyDelete
  2. Apologies...in that first question I meant "...the same SQL instance used as the PRIMARY (not the mirror)"

    ReplyDelete
  3. Hi Tim,

    The file share that the mirroring initially uses, after is has set up the mirror does it ever use this again i.e. is the file share used in-line once the mirror is set-up? I am just wondering if it should be set-up using DFS or another HA model?

    Regards,

    Dave

    ReplyDelete
  4. In SQL Server 2012 SQL Mirroring has been depreciated and will not be supported in future versions of SQL Server. Since AlwaysOn Availability Groups (SQL Server 2012)is now recommended has anyone deployed Lync 2013 with AAG's?

    ReplyDelete
    Replies
    1. Yes. AAG works great. I have tested it in the Lab. No user impact during failover.

      Delete
  5. Can i use the same Witness server for multiple BE pair. As per Technet yes but when you actually try to add the same from topology builder it gives error " Server is already in use in this topology"

    So in my pool1 i have mirroring with withness (Witness server xyz)
    I am trying to setup mirroring with withness for pool2 and in toplogy if i try to use the server XYZ as witness server it gives me error "same server is in use in published topology"

    ReplyDelete