SQL Mirror Failure


  • Got this error when Publishing the Topology. Seems to fail on the mirror creation for the Archive and Monitoring databases. However, the Lync CMS databases worked correctly. Can you not have the same Mirror Port?

      Error: An error occurred: "Microsoft.Rtc.Management.Deployment.MirrorDatabaseException" "Cannot set up mirroring because there is an error configuring endpoint "mirroring_endpoint" of type "DatabaseMirroring" and role type "Partner" on database server "cldbprod05.domain.internal\LyncArchive". Exception: Microsoft.SqlServer.Management.Smo.FailedOperationException: Start failed for Endpoint 'mirroring_endpoint'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: The Database Mirroring endpoint cannot listen on port 5022 because it is in use by another process.


    MCITP Exchange 2010 | MCTS Exchange 2007 | MCITP Lync Server 2010 | MCTS Windows 2008 | MCSE 2003

    Monday, June 10, 2013 5:19 PM


All replies

  • If the destination SQL Server for the mirror is hosting mirrors for other servers, you will need to change the mirror port to an available port (example 5023 via Topology Builder).

    Monday, June 10, 2013 5:49 PM
  • Are you by any chance specifying the mirroring port as the same port you have nominated for the Archive SQL instance?

    Monday, June 10, 2013 7:09 PM
  • No, I chose Port 5022 for all mirror ports and Port 7022 for the Witness, which are the defaults. However, I do have static ports set up on the actual SQL instances, but don't see that as a problem. So, what you are saying is that I need to go back to the Topology Builder and try using different Mirror Ports for the Archive and Monitoring databases?

    MCITP Exchange 2010 | MCTS Exchange 2007 | MCITP Lync Server 2010 | MCTS Windows 2008 | MCSE 2003

    Monday, June 10, 2013 7:46 PM
  • The error is saying 5022 is already in use, so you will need to use a port that is available. This is done in the Topology Builder.
    Monday, June 10, 2013 8:26 PM
  • Any updates?

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, June 14, 2013 9:12 AM
  • I'm having the same issue.  One SQL 2012 server with two SQL instances for Lync DBs and Monitoring/Archiving.  I was abled to mirrored the Lync DBs but when  I tried to mirror the Monitoring/Archiving, i get the same error.  i haven't been able to figure out how to change the mirroring (endpoint) port to 5023 on the 2nd SQL instance.  Any ideas?  Thank you.
    Thursday, October 10, 2013 8:26 PM
  • Hi TTMing, 

    I have got the same problem as you however I got archiving to mirror along with the backend store but once the archiving started mirroring. backend went to disconnect state and since then I removed all mirrroing and not able to mirror anything. 

    This SQL issue is really something else and u don't find easy answers to it. 

    Mohammed JH

    Tuesday, April 22, 2014 7:20 AM
  • Mohammed,

          First setup Mirroring with the backend Store and confirm it is working.  If you have the same setup as me, then when you go to mirror Monitoring and Archiving, launch SQL Studio on the primary SQL instance for Monitoring/Archiving.  Make sure database backup mode is set to FULL.  In Server objects, Endpoints, Database mirroring

    1. Delete mirroring endpoint
    2. Delete mirroring endpoint on the mirror SQL instance for Monitoring/Archiving also

    Launch Topology builder and configure mirroring for monitoring and archiving. Make sure to set the mirror port to something other then 5022.  I used 5023.  Publish topology.  That's how I got mirror working in my environment. 

    Tuesday, April 22, 2014 1:00 PM
  • Hi TTMing,

    I figured it out, I had to uninstall SQL on the Mirror server then re-install it and delete Endpoints from both SQL Servers and recreate the topology for each Role on a different port for the SQL Server store.

    now it works perfectly. but I had to restart the Frontend servers in order for changes to take effect for the SQL Backend, Monitoring and Archiving Mirror and in order to work.


    Mohammed JH

    Thursday, April 24, 2014 11:41 AM