Always on Availability groups using static SQL Tcp Port
Hi, I have 2 SQL 2012 servers in my DMZ and I have assigned SQL to run on a static TCP Port. I would like to setup Always On availability groups on the servers but I cannot get the failover to work with the static TCP port. It works fine
with dynamic ports.
When the failover is initiated it attempts to connect to the secondary replica with out using the static port, can someone tell me how to setup the availability group using static tcp ports.
Thanks,
When I setup the secondary replica I added the port number, but it doesn't appear to use it for failover. I add the secondary replica w/o errors.
I am not sure how to add the port number to the primary.
Dave
Hi Dave,
Based on your description, could you please post the error message when getting failover to the secondary replica?
In addition, If you use the default port of 1433 for availability group listener VNNs, you will still need to ensure that no other services on the cluster node are using this port; otherwise this would cause a port conflict.
If one of the instances of SQL Server is already listening on TCP port 1433 via the instance listener and there are no other services (including additional instances of SQL Server) on the computer listening on port 1433, this will not cause a port conflict
with the availability group listener. However multiple instances of SQL Server (side-by-side)should not be configured to listen on the same port.
For more details, please review this article:
Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server).
Thanks,
Lydia Zhang
Similar Messages
-
Sql 2012 always on availability group use cases
i have setup the always on availability group between 2 sql servers.
in the primary site, my app is connected to the primary site.
The DB is in an always on group replicated to the secondary site.
so what is the use of the secondary replica for?
If the primary db server goes down, what will happen?
Can apps use the replica db? but its read only
what is the purpose of this?I agree with David.
JonDoe,
What you are asking is known as "active secondary" in AlwaysOn
http://msdn.microsoft.com/en-us/library/ff878253.aspx
Automatic failover can be configured. Refer
http://msdn.microsoft.com/en-us/library/hh213151.aspx
Be aware of http://support.microsoft.com/kb/2833707
Balmukund Lakhani
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
| Facebook
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
Cannot connect to SQL SERVER with Always on availability group listener name
Hi everyone,
I have setup always an availability group listener for sql server on port 1433, have opened the port in firewall , remote connections are enabled in the sql server, but still I am not able to connect to the sqlserver instance with the help
of the availability group listener name.
I get the following error.
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:
TCP Provider, error: 0 - The wait operation timed out.)"} System.Exception {System.Data.SqlClient.SqlException
Have gone through several blogs for the solution but none of them helped.
Please let me know if anyone has fixed the issue.
Regards,
DivyaPrior to making SS connection, can you establish the connection with a networking tool?
SS connectiviy trouble shooting:
http://technet.microsoft.com/en-us/library/ms378845.aspx
http://stackoverflow.com/questions/5919524/not-able-to-telnet-sql-port-1433-locally-or-remotely
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/227f431a-4274-4d95-b605-67541d78ef03/test-sql-connection-with-telnet?forum=sqldataaccess
Kalman Toth Database & OLAP Architect
Free T-SQL Scripts
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
Setting Up Alerts for Always on Availability Groups Failover
Hi Folks,
In SQL Server 2008R2 we set up alerts for Mirroring failover using WMI Alerts. As Like this.
Now we need to configure similar alerts for Always on Availability Groups(AAG) in SQL Server 2012, but it seems that there is no such WMI Alerts or any standard way to set up the alerts for getting notified for AAG Failover. Click
Here
Should I manually Create a SQL Agent Job using
these DMVs and schedule it at frequent Interval to get notified about any AAG failover or is there any standard way as for mirroring Failover alerts? Any suggestion or help is appreciated.
Pranshul GuptaMaybe you wanna have a look at this:
http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-1.aspx
http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/13/monitoring-alwayson-health-with-powershell-part-2.aspx
http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/monitoring-alwayson-health-with-powershell-part-3.aspx
http://blogs.msdn.com/b/sqlalwayson/archive/2012/02/15/the-always-on-health-model-part-4.aspx
Bodo Michael Danitz - MCT, MCITP - free consultant - performance specialist - www.sql-server.de -
How do I remove a node from Always on Availability Group in SQL 2012
Hello I was wondering if anyone could tell me to remove a node from an AOG group in SQL 2012. We currently have a two node Always on availability group and I need to replace one of the servers. My plan is to bring the
new server on to the group then remove the old server and I am having issues finding documentation on this. Could someone explain how to do this or if it is even possible.
ThanksAfter the new server is added to the cluster and the AG, remove the old one by first
ALTER AVAILABILITY GROUP [YourAG]
REMOVE REPLICA ON N'OldServer';
Remove a Secondary Replica from an Availability Group
Then evict the old server from the cluster with the cluster administrator or
Remove-ClusterNode OldServer
Remember to verify the quorum configuration after adding the new server and removing the old server.
David
David http://blogs.msdn.com/b/dbrowne/ -
SQL 2012 Always On Availability Groups
Has anyone configured FIM SYnc, FIM Service and MSF in SQL 2012 Always On Availability groups
I do not believe we can configure the SQL connection string for FIM Sync or FIM Service to include "multisubnetfailover"
TIA
NigelI commented on this here:https://social.technet.microsoft.com/Forums/en-US/64f55628-3b5d-4d16-9044-dcbe7053581d/lack-of-support-for-fim-database-mirroring?forum=ilm2
Additional comments:
SQL Server Always On Failover Cluster Instances should be supported just as SQL Clustering is supported.
SQL Server Always On Availability Groups are not supported, just as Database Mirroring in synchronous mode (which is required for automatic failover) is not supported. I can't find authoritative statements of this on the web. But I know this to be the
case.
Ultimately, the reason for lack of support for mirroring (for automatic failover or in synchronous mode) is that the product group has said so (in conferences and webinars). Meaning the product group has not tested it or has and decided that it doesn't
work or adds risk.
Possible underlying reasons:
1) To do automatic failover with mirroring or Availability groups you must edit the connection string. The way FIM builds the connection string out of the components in the registry don't permit this.
2) Running mirroring in synchronous mode slows down performance in two ways: first is the additional traffic to send it to the mirror partner (or replica), second and most important is that synchronous requires that the primary not truly commit the transaction
until it has been committed to the secondary which means transactions take longer. For some products this can result in an unacceptable performance degradation.
Hopefully, MIM will support Availability groups.
David Lundell, Get your copy of FIM Best Practices Volume 1 http://blog.ilmbestpractices.com/2010/08/book-is-here-fim-best-practices-volume.html -
Hello everyone!
I am currently planning to implement SQL Always On Availability Groups.
Mainly i have one sql server so apparently i need to setup a new sql server.
In the wizard there is a page where I need to select Initial data synchronization full or join.
What’s the difference?? Is choosing the full option requires me to provide a Third server to temporarily store my database so my 2 main SQL server can sync for the first time? And if yes can I remove this shared location (Third server) after the database
are synced??
Thank You.Join option only if the new
secondary databases already exist on each server instance that hosts a secondary replica for the availability group. That is you have manually restore a recent database backup of the primary database using RESTORE WITH NORECOVERY, and then restore each
subsequent log backup using RESTORE WITH NORECOVERY.
Full option
creates a full and log backup of the primary database, create the corresponding secondary databases by restoring these backups on every server instance that is hosting a secondary replica, and join each secondary database to availability group.
When you use full you have to
specify a network share folder in order for the wizard to create backups and secondary replica will access backups to perform restores from this stage. Yes you can remove the share once the all databases are in sync. -
Always on Availability on 2 different SQL Server clusters
SQL Server 2012 EE on WIndows 2008 R2.
Is it possible to have Always on Availability on 2 different SQL Server clusters ?. Could 2 SQL Server clusters be on 1 Windows server failover cluster (WSFC) ?. We have a Prod domain and DR01 domain with 3 nodes SQL Server clusters each. How can we setup
Always On Availability groups on these clusters to make replica of Production databases on the Prod to DR01 domain cluster ?. What do we need to do to get this working ?...................Thanks.DCarlos unfortunately the requirement for AlwaysOn Availability Groups are a Single Domain, A single WSFC. The WSFC in multiple sites is supported with either a stretched VLan or multiple Subnets.
If your environment does require you to have different Domains for Prod and DR then you would have to look at potentially other ways of achieving your data replicated across from prod to DR.
You could look at using Database Mirroring (Yes I know this has been marked for deprecation) to achieve your data transfer. Or depending on your RPO and RTO requirements Logshipping may be an option.
Thanks
Warwick Rudd (MCM - SQL 2008 | MCT)
(SQL Masters Consulting |
My SQL Server Blog | Twitter) -
Some Quick clarification about 2012 and always on Availability groups
Hi guys, just need some clarification about always on.
I've got plenty of experience with normal SQL Clusters, but just need some clarification around always on availability groups.
I presume with AG, you setup a listener and this becomes your point of connection, IE this is what you use in the you connection string for you applications, so can I use this when I am setting up a new application, and will this automatically make the Database
that's created by the APP, Highly available. ? or do you still have to add it to the AG afterwards. ?
I have also read that you can still point to the installed SQL instance, and you don't need to use the AG group listener, but how does this make your DB HA ? how does the failover work.
I also presume you don't need to use any roles under the MSC anymore.
Kind regards
Mark.GHi Mark
I presume with AG, you setup a listener and this becomes your point of connection
That's right, the listener is a virtual network name and you can use this to connect to the primary or secondary replica. Your connections will go in against the primary unless you're using
read-only routing.
so can I use this when I am setting up a new application, and will this automatically make the Database that's created by the APP, Highly available
The first thing you'll have to do is set up the availability group (AG). You can then associate a listener to the AG. I know you're familiar with failover clustering but the mechanics of this are much closer to database mirroring. For every database that's
part of the AG you'll have at least one secondary replica, it's possible to automatically failover to this if you're in synchronous mode.
I have also read that you can still point to the installed SQL instance, and you don't need to use the AG group listener, but how does this make your DB HA ? how does the failover work.
Yes you can do, but from an application perspective you should only do this for databases that are not part of an AG. If you connect to the instance directly and you have a failover your app will no be able to connect to the database (on the assumption your
secondary isn't read-only). App connections should always be via the Virtual Network Name.
I also presume you don't need to use any roles under the MSC anymore.
Not sure I understand this? Do you mean will roles be available in cluster manager? Each AG group will have a role but failover is now controlled through the SQL Server rather than the cluster manager. -
We have requirement like to Install the SSAS as Cluster instance where SQL Server Database engine was installed with Always On availability group.Please help me to how configure it
Currently we have following configuration in Current steup.
Node1 and Node2 are in windows cluster
Node1 has SQL Server Database engine Instance1 as Standalone
Node2 has SQL Server Database engine Instance2 as Standalone
Instance1 and Instance2 configured for Always On availability group with Listener.
Now we have to steup SSAS instance with High availibilty. I know we have only option is to install cluster SSAS instance.
Can some one provide information below.
1. How to steup Cluster SSAS instance in this servers.
2. Is this will have any dependancy on exisiting Listner name.
3. Is this affects the availiblity groups, if SSAS instance failed over to another node.
Thanks in Advance
SriramYou will need to have SSAS installed as a clustered instance with shared storage. Refer to the whitepaper from this MSDN article
How To Cluster SQL Server Analysis Services
Availability Group is in it's own Role/Resource Group. When you create the clustered SSAS, it will create its own Role/Resource Group. This means that it will require its own virtual network name and virtual IP address and will not affect the existing Availability
Group. You can also have it on the existing Availability Group if you want to. However, you need to decide if you want SSAS to failover with the Availability Group or not. Your design choices will depend on that decision.
Edwin Sarmiento SQL Server MVP | Microsoft Certified Master
Blog |
Twitter | LinkedIn
SQL Server High Availability and Disaster Recover Deep Dive Course -
Which Edition of Windows is required for using SQL 2012 Always On Availability Groups
I want to use the new feature of having 2 secondary mirror replicas. the first secondary replica will be sync the second one will be async.
Currently I have SQL Enterprise license and Windows 2008 R2 Standard license.
Will I be required to upgrade to Windows Enterprise license to use Always On? (since this feature depends on Windows clustering?)
Can you please confirm if SQL Always On feature can be used on Windows 2008 R2 standard or not?
MSDNStudent Knows not much!Always On is available with Standard Edition but it supports only 2 nodes.
AlwaysOn is a bigger umbrella which covers two features. AlwaysOn Availability Groups (AG) and AlwaysOn Failover Cluster Instance (FCI).
FCI for 2 node is supported. You can't use AG feature in SQL Server Standard Edition
Balmukund Lakhani
Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
This posting is provided "AS IS" with no warranties, and confers no rights.
My Blog |
Team Blog | @Twitter
| Facebook
Author: SQL Server 2012 AlwaysOn -
Paperback, Kindle -
Clustering Pre-reqs for sql 2012 always on availability group
Hello,
I'm currently in the planning stages of building a sql 2012 alwaysON cluster on Windows server 2012. I'm a bit confused with some of the requirements.
Does windows 2012 clustering require a heartbeat network as well a nic that communicates with the domain?
For a 2 node 2012 always on sql cluster which type of cluster should I use? node majority? node majority plus fileshare?
thanks!I found this information regarding SQL 2014. This could be helpful
"We strongly recommend that you use the same network links for communications between WSFC cluster members and communications
between availability replicas. Using separate network links can cause unexpected behaviors if some of links fail (even intermittently).
For example, for an availability group to support automatic failover, the secondary replica that is the automatic-failover partner must be in the SYNCHRONIZED state. If the network link to this secondary replica fails (even intermittently), the replica enters
the UNSYNCHRONIZED state and cannot begin to resynchronize until the link is restored. If the WSFC cluster requests an automatic failover while the secondary replica is unsynchronized, automatic failover will not occur."
source:http://msdn.microsoft.com/en-us/library/ff878487.aspx#NetworkConnect -
SQL 2014 Always On Availability Groups
It appears to be working. I've attached a picture of the role that was created when I was finished configuring WSFC. Is there something that would I can check that would give me a definitive answer?
I am testing SQL 2014 availability groups and I have run into a snag. I setup a win2k8 r2 DC and two windows 2012 R2 servers running SQL 2014 standard. I setup failover clustering for the two SQL servers. In SQL Management Studios I have setup the availability group and everything seems to have been successful. except when the wizard completes I get an error Creating availability group listener resulted in an error.....Error 41009.The AG seems to be working I can connect to the AG in SSMS using the listener name. But in the Availability Group Listener section there is no listener setup. Also the databases also seem to be read only if I connect thru the listener name. The AD computer account seems to be setup correctly. I am just unable to create the listener in SQL. Is there a security permission in SQL that I could have missed. Any...
This topic first appeared in the Spiceworks Community -
Adding Availability Group to Existing SQL Server 2012 Enterprise installation
Looking at an existing SQL Server 2012 Enteprise vm. We'd like to add availability group functionality. It seems that we should be able to create a second VM and install SQL on it in an identical configuration. Then create a windows cluster with
the two nodes. From there we should be able to configure avaialbility groups.
I've set up avaialbility groups before but have not retrofitted one before. It seems possible though since the instances are standalone. Anyone see a problem with doing this?
thanks
PeterHello,
What you have is pretty much it. Since AGs require clustering but do not require a clustered install (stand alone install is used) there shouldn't be any changes with the actual install. You will have to enable the HADR option in the configuration manager
once the clustering is setup.
Sean Gallardy | Blog |
Twitter -
Get count per each group using t-sql
Hi All, I have a table with 5 columns and my source data looks like this...
ID Doctor NurseType VisitID Date
1 Sam Main-Nurse 10 09/23/2013
1 Tom Sub-Nurse 10 09/23/2013
1 Sub-Nurse 10 09/23/2013
2 Ryan Sub-Nurse 24 10/29/2013
2 Ron Main-Nurse 24 10/29/2013
3 Main-Nurse 35 04/12/2014
3 Main-Nurse 35 04/12/2014
3 Sub-Nurse 35 04/12/2014
3 Main-Nurse 40 05/12/2014
3 Greg Main-Nurse 40 05/12/2014
3 Sub-Nurse 40 05/12/2014
4 susan Main-Nurse 45 06/12/2014
4 Roby Main-Nurse 45 06/12/2014
4 Sub-Nurse 45 06/12/2014
I want output to be in this format. I want number of doctors present in each ID group per each date using t-sql.
Output:
ID Comments VisitID Date
1 2 doctors 10 09/23/2013
2 2 doctors 24 10/29/2013
3 0 doctor 35 04/12/2014
3 1 doctor 40 05/12/2014
4 1 doctor 45 06/12/2014
Note:
1)NurseType column always will have Main-Nurse and sub-nurse values.Each ID group will have minimum one main and sub-nurses.
2) In the above sample date , Id=3 repeated 2 times becoz visitID and date is different.
3) Also in ID=4(records), even though we have 2 doctors susan and roby we consider them as one doctor becoz NurseType is same(main-nurse).
4) Values in the comments field will always be 2 doctors , 1 doctor and 0 doctor. Rules for populating this column
a) In a ID group if Main-Nurse and sub-nurse has nay doctors then will show as 2 doctors.
b) In a ID group if Main-Nurse or sub-nurse (any one) has doctor then will show as 1 doctor.
c) In a ID group if Main-Nurse and sub-nurse both doesn't have any doctors then will show as 0 doctor
Create statement:
Create table sample ( ID Int null ,Doctor varchar(25) null,NurseType varchar(20) null ,VisitID int null,Date datetime null)
Insert statement:
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1,'Sam,Main-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1,'Tom,Sub-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1, ,'Sub-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (2,'Ryan','Sub-Nurse' , 24 ,10/29/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (2,'Ron' , 'Main-Nurse' , 24,'10/29/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, , 'Main-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, , 'Main-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, , 'Sub-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, , Main-Nurse', 40 ,'05/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3,'Greg', 'Main-Nurse', 40 ,'05/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, , 'Sub-Nurse' , 40,'05/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (4, 'susan' , 'Main-Nurse' , 45,'06/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (4, 'Roby' , 'Main-Nurse' , 45,'06/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (4, , 'sub-Nurse' , 45,'06/12/2014')
Thanks.
sqlI had to correct the sample script a bit. The query you are asking for comes after the inserts.
Create table sample ( ID Int null ,Doctor varchar(25) null,NurseType varchar(20) null ,VisitID int null,Date datetime null)
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1,'Sam','Main-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1,'Tom','Sub-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (1, NULL,'Sub-Nurse' , 10 , '09/23/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (2,'Ryan','Sub-Nurse' , 24 ,'10/29/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (2,'Ron' , 'Main-Nurse' , 24,'10/29/2013')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, NULL, 'Main-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, NULL, 'Main-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, NULL, 'Sub-Nurse' , 35 ,'04/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, NULL, 'Main-Nurse', 40 ,'05/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3,'Greg', 'Main-Nurse', 40 ,'05/12/2014')
Insert into sample (ID,Doctor,NurseType,VisitID,Date) values (3, NULL , 'Sub-Nurse' , 40,'05/12/2014')
go
SELECT ID, COUNT(Doctor) DoctorCnt, VisitID, Date
FROM sample
GROUP BY ID, VisitID, Date
go
DROP TABLE sample
Erland Sommarskog, SQL Server MVP, [email protected]
Maybe you are looking for
-
IIOP connection from JDeveloper does not work
I'm trying to run some sample EJB programs but cannot connect to the IIOP port from JDeveloper. I have installed Oracle 8.1.7 Enterprise on my machine, and it includes a listening location for IIOP on port 2481 under the listener. I can connect to JS
-
How do i make my iphone 5 bluetooth not discoverable
How do i make my iphone 5 bluetooth feature "not" discoverable so that my phone is secure from hacking while i am in public and the bluetooth feature is turned on.
-
Safari 5.1.7 keeps freezing,
I had this problem before on 5.1.6 and ultimately chucked it and installed a fresh 5.1.7. This seemed to solve my problems, at first. But today i'm noticing already that when trying to navigate to another page, the browser hangs and becomes complet
-
How do i save a image that i have just edited
Hi Please help, i just edited an image on my Mac and i saved it as a PSD file, i reopened the image and it has saved the whole image and the Elements tool bars as well, how do i save just the image ?
-
Hi Experts, I am installing Solution manager EHP1 on SUSE Linux 10 , SP2 on Database Oracle 10g . While Instlling , i am struck in the Phase "Create Database " Pls find the error screen shot ERROR 2009-09-01 09:49:58.594 CJSlibModul