0

I have set up an NLB with two servers (nodes) which are running the same service. The filtering is single host, because I don’t want them to run at the same time, because there is data in the cache DB, so every time there is new data or a failover I would need to restart the second service to update it.

How can I know which server in the cluster is answering? (I don’t mind whether this uses a command, a script, C#, or whatever. I haven’t yet decided what to use: I just want whatever’s easiest.)

I am using SQL Server 2008 R2.

Secondly (and less importantly): Is there a good monitoring tool for this purpose? I was looking into Spiceworks, Zabbix or Nagios.

TRiG
  • 1,181
  • 3
  • 13
  • 30
Horaceman
  • 145
  • 1
  • 4
  • What kind of database server are you running? – Belmin Fernandez Jul 28 '14 at 19:55
  • SQL Server 2008 R2. – Horaceman Jul 28 '14 at 19:59
  • 2
    NLB is exactly the wrong way to cluster an MS SQL server. It should be clustered using Windows Cluster Services, which is active/passive, only ever allowing a single member to be connected to and own the data. PLEASE DON'T DO WHAT YOU'RE DOING. – mfinni Jul 28 '14 at 20:59
  • 1
    I have only ever seen NLB in conjunction with an SQL Mirror and with software that does not support fallback servers in the connection string. This sounds like a recipe for disaster. – Mark Henderson Jul 28 '14 at 22:10
  • Sorry for the misunderstanding, but the SQL database in somewhere else and it has nothing to do with the cluster. I was just talking about the service applications. I just want to know which server is responding when i call the cluster. – Horaceman Jul 29 '14 at 18:57

1 Answers1

1

Without knowing how you are "calling the cluster", we can't answer this.

If you are using something that can get you a local shell, you can ask for the system variable COMPUTERNAME. And then however you do that, you can configure your monitoring solution to connect the same way and issue the same query.

There are protocols that return a name (often configurable, often the hostname by default) when they are connected-to, like SMTP. So if this is a custom connection you've made, perhaps you can put some diagnostics into the protocol itself.

My point still stands - if you're using NLB to cluster SQL, you're doing it the wrong way. If you used actual Windows Cluster Services, you can ensure that specific services are always running on the active node, not the passive one, so knowing which host shouldn't be a question that your clients need to ask.

mfinni
  • 36,144
  • 4
  • 53
  • 86