0

In my testing of SQL Server 2019 Basic Availiiblity Group on Ubuntu 20.04, I successfully created AG1 for DB1 and AG2 for DB2 with only AG1 config'ed with listener IP. But when I use sqlcmd to test, I can connect to AG1's listener and use AG2's DB, do DDL and DML. Is it OK for this configuration? Only 1 listener for several AG.

Besides, I'm using pacemaker for cluster management, is it possible to config no listener for AG, just use pacemaker's IP resource to bind IP on master server?

1
  • Since you're using pacemaker, I assume this testing is being done on Linux? If so, update your question to include the fact that it's on Linux, and the version of SQL Server you're using (2017? 2019?). May 11, 2021 at 14:31

2 Answers 2

0

The listener has to be unique. When you attempt to create the listener you will get an error message that is difficult to understand, but basically, the listener setup program detects that it is in use.

Multiple AGs on the same nodes can share a listener.

0

Each AG can have one (or more) listener that must have an unique FQDN and IP address. You can share a listener between different groups but when you connect to an instance with the listener you see all the databases in tha instance. But another database can be secondary on that instance. Do not relay on listner for database outside the AG group.

The listener is usefull for applications. Using that, they do not need to know which server is primary. They always goes on it. Try to test it moving the AG non the secondary node.

The listener is not mandatory but it is usefull for application.

https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/availability-group-listener-overview?view=sql-server-ver15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.