MSSQLWIKI

Karthick P.K on SQL Server

The connection to the primary replica is not active. The command cannot be processed

Posted by Karthick P.K on June 20, 2013

When you configure SQL Server always on available group from management studio it may fail with below error while joining secondary replica to the availability group.

 

Error 1

 

{

Joining database on secondary replica resulted in an error.  (Microsoft.SqlServer.Management.HadrTasks)

——————————

ADDITIONAL INFORMATION:

Failed to join the database ‘AG’ to the availability group ‘AG1’ on the availability replica ‘NODE2’. (Microsoft.SqlServer.Smo)

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

——————————

The connection to the primary replica is not active.  The command cannot be processed. (Microsoft SQL Server, Error: 35250)

}

 

Error 2

 

{

TITLE: Microsoft SQL Server Management Studio

——————————

Failed to join the instance ‘NODE2’ to the availability group ‘AG1’. (Microsoft.SqlServer.Management.SDK.TaskForms)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.2100.60+((SQL11_RTM).120210-1917+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&LinkId=20476

——————————

ADDITIONAL INFORMATION:

Failed to join local availability replica to availability group ‘AG1’.  The operation encountered SQL Server error 41106 and has been rolled back.  Check the SQL Server error log for more details.  When the cause of the error has been resolved, retry the ALTER AVAILABILITY GROUP JOIN command. (Microsoft SQL Server, Error: 41158)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.2100&EvtSrc=MSSQLServer&EvtID=41158&LinkId=20476

}

 

 

You may get below error when you configure AG availability group using  alter database command mentioned below or synchronization might fail with 35250 error mentioned below.

 

ALTER DATABASE [AG] SET HADR AVAILABILITY GROUP = [Group name];

 

Error 1

 

Msg 35250, Level 16, State 7, Line 1

The connection to the primary replica is not active.  The command cannot be processed.

 

 

To resolve  above errors

 

1. Ensure always on endpoint ([Hadr_endpoint]) are not blocked by firewall (Default port 5022).

 

2. Make sure startup account of primary server is added to all secondary server’s and Startup accounts of all secondary servers are added to primary servers.(Startup account of each replica to be added to other replica’s)

 

3. If log on account of SQL Server is “Nt service\” or local system account then ensure system account (Domainname\systemname$) of each replica is added to other replicas.

{

CREATE LOGIN [MSSQLWIKI\node2$] FROM WINDOWS

}

 

4. Grant connect on always on endpoints created on each replicas for startup account of other replica servers (Grant connect on endpoints even if startup account of other replicas are added as sysadmins).

{

GRANT CONNECT ON ENDPOINT::[Hadr_endpoint] TO [MSSQLWIKI\node1$]

}

 

5.  Make sure SQL Server name (select @@servername) matches with hostname.

6. Make sure cluster service startup account is part of SQL Server logins (More details in This link).

 

 

Thank you,

Karthick P.K |My Facebook Page |My Site| Blog space| Twitter

Disclaimer:

The views expressed on this website/blog are mine alone and do not reflect the views of my company or anyone else. All postings on this blog are provided “AS IS” with no warranties, and confers no rights

 

28 Responses to “The connection to the primary replica is not active. The command cannot be processed”

  1. RaviTeja said

    Pretty simple steps.. Thanks Karthick..

  2. Reblogged this on DATABASE ADMINISTRATION and commented:
    The connection to the primary replica is not active. The command cannot be processed

  3. Tosin said

    For me,
    I forgot to add the domain user I was using on the DAG to the Secondary node.
    I added it and everything went on smoothly

  4. prathap said

    Grant connect permission did the trick for me, thank you….

  5. […] The connection to the primary replica is not active. The command cannot be processed […]

  6. Neeti said

    Thanks.. this article helped. I forgot one step and that caused me issues.

  7. Hello just wanted to give you a quick heads up.

    The words in your article seem to be running off the screen in Firefox.
    I’m not sure if this is a format issue or something to
    do with browser compatibility but I figured I’d
    post to let you know. The design look great though!
    Hope you get the issue solved soon. Cheers

  8. Students choose a gourd and try to etch a design on its outer skin.
    No one knows exactly when knitting first began since there is no actual record of any knitted fabric before
    200 A. In these areas you can learn to be a Grand
    Master jewel crafting designer.

  9. Hi there!! Very good advice! Many thanks for sharing!

  10. Je peux voսs diree que c’еst infiniment ddu bonheur de νous
    lire

  11. ‘Temple Operate 2’ has a opportunity to
    be additional profitable because than the first simply because not only sticks to the exact formulation as ‘Temple Run’,
    but there are some considerable modifications that keeps gamers entertained for hours.
    It truly is practically nothing irritating still you will come
    across you pondering initially right before accomplishing everything else.
    Numerous game web-sites are identified, every single working day,
    highlighting the games that are reviewed each thirty day period.

  12. Felica said

    Simply wish to say your article is as surprising.
    The clearness for your post is simply nice and that i could suppose you are knowledgeable on this subject.
    Fine with your permission allow me to seize your
    feed to stay updated with approaching post. Thank you a million and please continue the rewarding work.

  13. In other words, if they have to create their own PHRs
    by inputting data themselves, it. First, use the dropper to coat your tonsils with salt water.

    Once a week, add baking soda to your toothpaste to scrape the thin coat of slime that coats your teeth.

  14. I have read so many articles or reviews about the blogger
    lovers except this paragraph is genuinely a pleasant
    piece of writing, keep it up.

  15. I seldom discuss these posts, but I thought this on deserved a well
    done

  16. Exceptionally interesting piece of writing

  17. Your style is so unique in comparison to other people I have read
    stuff from. Thank you for posting when you have the
    opportunity, Guess I’ll just bookmark this page.

  18. Hello, its fastidious piece of writing concerning media print, we
    all be familiar with media is a wonderful source of facts.

  19. Write more, thats all I have to say. Literally, it seems as though you relied on the video to
    make your point. You clearly know what youre talking about, why waste your
    intelligence on just posting videos to your site when you could be giving us something enlightening
    to read?

  20. Hello, great recommendation and an interesting article, it will be interesting if this is still
    the case in a few years time

  21. Latashia said

    A motivating discussion is definitely worth comment.
    I believe that you need to write more about this subject, it may not be a
    taboo matter but generally people don’t speak about such subjects.

    To the next! Best wishes!!

  22. Charline said

    But there are other types of trendy surfaces such as quartz, Corian, slate and marble
    that is re-emerging into kitchen designs. If that
    is the case, why is it that kitchen furniture is often last on the list of
    acquisitions for a new apartment or home. Great and well positioned lighting is an absolute important for a kitchen to safely
    fulfill its purpose.

  23. Hi there colleagues, nice paragraph and good urging commented here, I am
    genuinely enjoying by these.

  24. Janessa said

    Fantastic blog! Do you have any recommendations for aspiring writers?

    I’m planning to start my own website soon but I’m a little lost on everything.
    Would you recommend starting with a free platform like WordPress or go for a paid option?
    There are so many choices out there that I’m
    completely overwhelmed .. Any suggestions? Thank you!

  25. If some one desires to be updated with newest technologies then he must
    be visit this web page and be up to date everyday.

  26. […] The connection to the primary replica is not active.  https://mssqlwiki.com/2013/06/20/the-connection-to-the-primary-replica-is-not-active-the-command-cann… […]

  27. […] The connection to the primary replica is not active. The … – When you configure SQL Server always on available group from management studio it may fail with below error while joining secondary replica to the availability group. […]

  28. […] Blog: The connection to the primary replica is not active. The command cannot be processed […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: