SQLTeam.com | Weblogs | Forums

Restrict listener in high availability group

I have a question about high availability group. Your help will be appreciated.

How can I prevent clients to connect to IPlistener for a while rather than removing it completely?

By disabling TCP/IP in SQL configuration Manager we can limit clients to connect to SQL server instances but when we have high availability group and IPlistener, this way doesn’t work.

I know I can disable logins on server to prevent connecting them to our databases but I hope to find the easier method to reach my goals

It's not really a big deal to remove the listener and then add it back. In any case, you can also modify the port used by the listener to something else (50000 or some other high port number) and then change it back when you want clients to reconnect. I don't know if this will affect existing connections however, you will probably have to kill any existing sessions.

Why do you need to prevent people from connecting on the listener?

By the way, disabling the logins is a good option, and it's probably the easiest of the ones described here.

1 Like

Hi robert_volk
thanks for replying me, I continued that work by removing listening in that time but the way you suggest changing the port is the creative idea for reaching that goal. I couldn't concentrate on it at that time. I'll try it later.
I wanted to prevent them to connect because it had been established another network with new IP addresses and we wanted to transfer the second node (one of my server who has been participating in high availability group) to the new network then I should have leaded all connection to the transferred server and prevent clients to connect to the old one. actually I hadn't known that I wouldn't able to stop connecting with disabling TCP/IP at first so when I see sessions were coming to the old server... I wondered...
yes, disabling logins is a good way as well.

best regards