Tuesday, May 28, 2013

Secondary Replica of AlwaysOn Availability group is in "Resolving" state after fail over

While testing AlwaysOn Availability groups I failed over primary to secondary couple of times. However 3rd time when I failed over the secondary did not come up immediately and was in “Resolving” state.

Problem was with maximum failures threshold. By default it is set to 2 failures in 6 hours.


So since I failed over AG more than 2 times within an hour it tripped the maximum failures threshold for this clustered resource and came up with “Resolving” state.

Solution 1: wait for default period of 6 hours.
Solution 2: Change the threshold and fail back to original primary.

Default failback setting is set to immediate. I would also recommend setting it to Prevent Failback.

Here is how I have configured my availability group clustered resource


Following KB also has other scenarios

http://support.microsoft.com/kb/2833707?wa=wsignin1.0

Please note that I used these configurations only for testing. You may need to reconsider for your production setup depending your fail over needs



Friday, May 17, 2013

Error while adding Replica to SQL Server 2012 AlwaysOn Availability group


Problem: While adding secondary replica to AlwaysOn Availability group you get following error




TITLE: Connect to Server
------------------------------
Cannot connect to REPLICASERVER.
------------------------------
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 5)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=5&LinkId=20476

Solution: Most likely Named Pipe provider for SQL is disabled on secondary instance


Open SQL Server Configuration Manager and click on Protocols for MSSQLSERVER under SQL Server Network Configuration

Enable Named Pipes provides


Restart SQL Services

Then try adding the replica again in New AlwaysOn Availability Group Wizard







Error when opening New AlwaysOn Availability Group Wizard in SSMS 2012


Problem: If you are setting up availability group using New AlwaysOn Availability Group Wizard and if you get following error message.


TITLE: Microsoft SQL Server Management Studio
------------------------------
The local node is not part of quorum and is therefore unable to process this operation. This may be due to one of the following reasons:
•   The local node is not able to communicate with the WSFC cluster.
•   No quorum set across the WSFC cluster.
 For more information on recovering from quorum loss, refer to SQL Server Books Online.
(Microsoft.SqlServer.Management.HadrTasks)


Solution 1: Go to SQL Server Configuration Wizard and disable AlwaysOn High Availability 


Restart SQL.
After restart enable AlwaysOn High Availability again thru SQL Configuration Manager. 
Restart SQL Services
and try again to open the wizard

Solution 2: make sure all pre-requisites are setup properly. Refer to following link