This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Problem - AppInsight for SQL and passive DB copies

Hey all,

I'm in the process of configuring AppInsight for SQL monitoring on our SQL 2014 AAG.  I've successfully applied the monitor, and it's polling correctly, but there's a problem.

Several of the databases hosted by this AAG have their replicated copies configured as passive and are not available to be queried.  This is resulting in the monitor showing an overall unknown state.

Here's the error for the specific databases in the unknown state.

No valid data was received. The target database, '<name>', is participating in an availability group and is currently not accessible for queries. Either data movement is suspended or the availability replica is not enabled for read access. To allow read-only access to this and other databases in the availability group, enable read access to one or more secondary availability replicas in the group. For more information, see the ALTER AVAILABILITY GROUP statement in SQL Server Books Online.

Has anyone else run into this?  I'd prefer to not modify those databases, if possible.  Theoretically, their active copies should be getting monitored on the node where they're active.

Every option I consider runs into the same problem, where the option becomes an issue if the copy of that DB ever becomes active.  Maybe just set the monitor not to report an unknown state somehow?

Ideas?

Thanks!

  • THe database can be unmanaged through the web interface.

    Unmanage Database.png

  • That's useful info, but I don't think it quite solves this specific problem.

    I assume the database doesn't automatically come out of the unmanaged state when it becomes the active, primary copy.  This presents a problem when maintenance is performed on the nodes and all the primary copies get juggled around.

    Bottom line, the db copy on the server could become the active copy, so we need a way to monitor it when it's active and ignore it when it's not.

    Thoughts?

  • I might have an idea about how to address this, but I'm concerned about the long-term viability.

    So here's the situation.  We have a three-node SQL 2014 AAG.  There are two SQL instances hosted on it (though that detail is a little less-relevant, I think).  Focusing on just one instance for now, the instance hosts numerous databases.  Almost all of the databases are associated with one of nice clustered SQL listeners. 

    To make the shorter, for simplicity:

    Server1, Server2, and Server3 are the AAG nodes.

    DB-A, DB-B, and DB-C are databases.

    SQL-A and SQL-B are the clustered, named listeners for connecting to DB-A and DB-B, respectively.  DB-C doesn't have a clustered listener.

    Now, if I only link AppInsight to Server1, 2, and 3, each AppInsight monitor will show all three databases on each node.  DB-A's secondary copies are passive and unreadable, so if it's currently active on Server1, the monitor on Server2 and 3 will show that DB in an unknown state.  If I unmanage DB-A on the Server2 and 3 monitors, and the copy on Server2 becomes the active copy, I won't be monitoring it and could miss detectable issues.

    So here's my idea for a solution. 

    I plan to create nodes in Solarwinds to represent the SQL-A and SQL-B listeners.  I'll link the AppInsight monitor to those nodes.  On the SQL-A monitor, I'll unmanage the DB-B and DB-C databases, and I'll set custom thresholds on all non-database-specific performance counters so that the monitor is only concerned with the DB-A database.  Rinse and repeat for the SQL-B listener.

    Next, I'll link the AppInsight monitor to Server1, Server2, and Server3, and in each of those monitors, I'll unmanage DB-A and DB-B.  That will leave those monitors only concerned with local SQL counters, services, and the DB-C database, which has active (readable) secondary copies.

    This config should prevent duplicate alerts and should scope each monitor to only the things its capable of seeing.

    My biggest concern is if those unmanaged databases automatically become remanaged.  Not sure if there is any circumstance where that would happen.  I'm researching a powershell script to bulk-unmanage databases, just in case.

    Anyone have any thoughts about this solution?

  • Bumping this thread.  Any input on the proposed solution?  I hope I'm not overlooking a method of making the monitor more cluster-aware.

  • This is roughly what I have done in the past as well, point Appinsight at the listener address and bury all the db's that don't apply.  It worked pretty well at the time but I haven't set one of these up for any clients in a while.

  • Haha I didn't notice until after I commented, you were in fact the last client I worked on this with.