sql-serveralwayson

What is the purpose of static IPs for SQL HAG listener?


Can somebody answer following questions. I have 2 Azure VMs with HAG setup but no HAG listeners are setup. The reason being I'm confused where those static IPs are supposed to come from and if they are needed in a first place.

Questions:

  1. Why do I need HAG listener at all if I can just use IP address of each host to connect to SQL
  2. If add additional IP addresses, are those supposed to be manually added to TCP/IP properties of adapter or WSFC will take care of that during failover
  3. What is difference between using HAG DNS name vs just using database mirroring type (Data Source/Failover Partner) connection string. They seemed to be doing the same thing, i.e. providing alternative IPs where service is being hosted
  4. Does WSFC needs to have "Server Name" under core cluster resources? What is the point of that name in terms of HAG functionality? Can I just delete it? enter image description here

Solution

    1. Why do I need HAG listener at all if I can just use IP address of each host to connect to SQL Answer: Listener is part of cluster resources. Connection first connect to listener, and depends the setting it will be relay to different replica. Of course, you can connect to each of the replica directly by their instance name or by IP. However, having listener would provide you the HA. That is, if your primary replica failover to secondary replica, the listener will automatically point to the new primary replica.

    If add additional IP addresses, are those supposed to be manually added to TCP/IP properties of adapter or WSFC will take care of that during failover

    Answer: I assume here you were asking additional IP for listener. Noticed you have replicas in multiple subnets. Your listener had to have two IPs, each for separate subnets. These settings could not be manually added to TCP/IP. You had to configure them while creating listener.

    What is difference between using HAG DNS name vs just using database mirroring type (Data Source/Failover Partner) connection string. They seemed to be doing the same thing, i.e. providing alternative IPs where service is being hosted

    Answer: Mirroring is in singel database level. AG is for group of databases. Both use end points to communicate between.

    Does WSFC needs to have "Server Name" under core cluster resources? What is the point of that name in terms of HAG functionality? Can I just delete it?

    Answer:

    WSFC is the foundation of AG. You need to create WSFC first. It has it's name and IP and other properties. No you cannot delete it.