Linked Server on AG Secondary Replica

  • Hi,

    I am using SQL 2016 SP1 and I have a question regarding linked servers with Always On AG's.  I currently have two SQL 2016 instances with Clustering configured on Windows (however SQL HA is provided by the AGs).  I have linked servers pointing to the AG listener on both Primary and Secondary Replicas.  When connecting to LS on primary this works with no issues.  When connecting from the *secondary* to listener it fails.  Would this be by design?

    TIA

    qh

    [font="Tahoma"]Who looks outside, dreams; who looks inside, awakes. – Carl Jung.[/font]
  • Are the secondaries read only?

  • No, I have not set that.

    qh

    [font="Tahoma"]Who looks outside, dreams; who looks inside, awakes. – Carl Jung.[/font]
  • quackhandle1975 - Wednesday, August 22, 2018 4:15 AM

    Hi,

    I am using SQL 2016 SP1 and I have a question regarding linked servers with Always On AG's.  I currently have two SQL 2016 instances with Clustering configured on Windows (however SQL HA is provided by the AGs).  I have linked servers pointing to the AG listener on both Primary and Secondary Replicas.  When connecting to LS on primary this works with no issues.  When connecting from the *secondary* to listener it fails.  Would this be by design?

    TIA

    qh

    I am not following this...

    Where are you setting up this linked server?  Is this on another instance pointing back to the AOAG?  If so - that linked server would be directed to the listener and the listener would redirect the calls to the node identified as the primary.

    If this is on the primary node - why are you creating a linked server back to itself?  And no - you cannot and should not be setting up a linked server on the secondary pointing to the listener address that is used to direct the connections to the primary.  That really doesn't make any sense...

    What exactly are you trying to accomplish?

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • quackhandle1975 - Wednesday, August 22, 2018 4:15 AM

    Hi,

    I am using SQL 2016 SP1 and I have a question regarding linked servers with Always On AG's.  I currently have two SQL 2016 instances with Clustering configured on Windows (however SQL HA is provided by the AGs).  I have linked servers pointing to the AG listener on both Primary and Secondary Replicas.  When connecting to LS on primary this works with no issues.  When connecting from the *secondary* to listener it fails.  Would this be by design?

    TIA

    qh

    Actual error message will help others to further assist you. Can you copy paste error message.  I am assuming you are running into some sort of distributed transactions. Is it giving an error or throwing stack dumps? So you are creating a linked server pointing to the listener which will always only refer to primary node. What do you mean by "When connecting from the *secondary* to listener it fails " ?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply