locked
Configure Mirroring for Monitoring Database RRS feed

  • Question

  • I have mirroring configured for RTC instance. I have Mirror1, Mirror2, and Witness servers.

    Everything works and I decided to add mirroring for Monitoring. I added the second instance on each server (Mirror1, Mirror2, and Witness). I have problem when I try to setup mirroring.

    I run PowerShell command:
    Install-CsMirrorDatabase -DatabaseType Monitoring -FileShare "\\fileshare.domain.com\TMP" -SqlServerFqdn mirror1.domain.com -SqlInstanceName SfBMonitor

    This commands creates new databases: lcscdr and qoemetrics, but fails after that. I hope that someone could help me with this. I have following errors for each of the databases:

     	Error setting up mirroring or witness for database qoemetrics: Microsoft.Rtc.Management.Deployment.MirrorDatabaseException: Cannot setup mirroring for database "qoemetrics". Exception: Microsoft.SqlServer.Management.Smo.FailedOperationException: Alter failed for Database 'qoemetrics'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: The server network address "TCP://Mirror2:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.
    at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplFinish(StringCollection alterQuery, ScriptingPreferences sp)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplWorker()
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    at Microsoft.Rtc.Management.Deployment.InstallMirrorDatabaseCmdlet.SetUpDatabaseMirroring(DbInfo dbInfo, Server primaryServer, Database databaseOnPrimary, Server mirrorServer, Database databaseOnMirror) ---> Microsoft.SqlServer.Management.Smo.FailedOperationException: Alter failed for Database 'qoemetrics'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: The server network address "TCP://Mirror2:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.
    at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplFinish(StringCollection alterQuery, ScriptingPreferences sp)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplWorker()
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    at Microsoft.Rtc.Management.Deployment.InstallMirrorDatabaseCmdlet.SetUpDatabaseMirroring(DbInfo dbInfo, Server primaryServer, Database databaseOnPrimary, Server mirrorServer, Database databaseOnMirror)
    --- End of inner exception stack trace ---
    at Microsoft.Rtc.Management.Deployment.InstallMirrorDatabaseCmdlet.SetUpDatabaseMirroring(DbInfo dbInfo, Server primaryServer, Database databaseOnPrimary, Server mirrorServer, Database databaseOnMirror)
    at Microsoft.Rtc.Management.Deployment.InstallMirrorDatabaseCmdlet.ConfigureMirroringAndWitness(DbInfo dbInfo, Server primaryServer, Server mirrorServer, Server witnessServer):Microsoft.SqlServer.Management.Smo.FailedOperationException: Alter failed for Database 'qoemetrics'. ---> Microsoft.SqlServer.Management.Common.ExecutionFailureException: An exception occurred while executing a Transact-SQL statement or batch. ---> System.Data.SqlClient.SqlException: The server network address "TCP://Mirror2:5022" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.
    at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(StringCollection sqlCommands, ExecutionTypes executionType)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplFinish(StringCollection alterQuery, ScriptingPreferences sp)
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImplWorker()
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    --- End of inner exception stack trace ---
    at Microsoft.SqlServer.Management.Smo.SqlSmoObject.AlterImpl()
    at Microsoft.Rtc.Management.Deployment.InstallMirrorDatabaseCmdlet.SetUpDatabaseMirroring(DbInfo dbInfo, Server primaryServer, Database databaseOnPrimary, Server mirrorServer, Database databaseOnMirror)



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Wednesday, February 21, 2018 8:26 PM

All replies

  • Hi,

    Can you telnet to Mirror2 on port 5022 (telnet MIRROR2 5022)?

    Is Windows Firewall on?  If so, can you see traffic being blocked?

    Wednesday, February 21, 2018 8:37 PM
  • I can telnet and firewall is off.

    It creates database, so I guess that it can connect and do some operations, but cannot finish.



    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Wednesday, February 21, 2018 8:44 PM
  • Hi Igor,

    Please check TCP/IP and Name pipe connection is enabled in both principle and mirror server configuration.

    And try to use different port number and make a test.

    It seems that lots of problems will lead to these error,You could refer to the following link.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/dd4bc7cf-32da-44ec-9850-b1a70d7a4123/the-server-network-address-can-not-be-reached-or-does-not-exist?forum=sqldatabasemirroring


    Best Regards,
    Leon Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Sunday, February 25, 2018 2:47 AM
  • Name Pipe and TCP/IP are enabled. I changed port to 5023 and it did not help.


    Please “Vote As Helpful” and/or “Mark As Answer” if this post helped you.

    Sunday, February 25, 2018 3:16 AM
  • Hi Igor,

    Thanks for your reply and waiting.

    Based on my research, I would provide you some suggestions:

    1. Please check that on Mirror Server the database is restored with NO RECOVERY option.

    2. Please verify that the endpoints are started on the servers, you could use the ‘state’ or ‘state_desc’ column of the sys.database_mirroring_endpoints catalog view.

    You could try to delete the end points and recreate them if possible.

    3. Accounts running the SQL Servers on all primary and mirror SQL servers have read/write permission to the file share.

    You could also refer to this links:

    https://docs.microsoft.com/en-us/sql/database-engine/database-mirroring/troubleshoot-database-mirroring-configuration-sql-server


    Best Regards,
    Leon Lu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnsf@microsoft.com.


    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Thursday, March 1, 2018 6:52 AM