Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

Handling Node Failover from REST API

3 replies [Last post]
  • Login or register to post comments
Fri, 12/09/2011 - 12:51
kylefox
Offline
Joined: 06/08/2011
Groups: None

I'm writing a script to automatically failover when a node is down, but I can't figure out the correct HTTP call. I've read through the REST API documentation, but couldn't find anything specific to failover.

The closest method I could find is Ejecting a Node from a Cluster:

curl -i -u Administrator:password -d otpNode=10.0.1.11:8091 http://localhost:8091/controller/ejectNode

The value for otpNode is the node's "hostname" attribute, as returned by Getting a Bucket. But I keep getting" 400: Server does not exist."

So my questions are:

  • Am I calling the correct endpoint?
  • If so, how I find out the correct node name to pass as optNode?
  • The docs allude to a /controller/failOver endpoint, but there are no details given. If this is what I need, how do I use it?
  • Many thanks!

    (Note: we currently can't use the automatic failover in 1.7.1 because we only have 2 nodes. Automatic failover requires at least 3 nodes).

    Top
    • Login or register to post comments
    Sun, 12/18/2011 - 01:10
    ingenthr
    Offline
    Joined: 03/16/2010
    Groups:

    You're on the right path with ejectNode, yes.

    The otpNode should be similar to one in the list from the /pools/default URI. The format you have there is wrong. Note in the docs there is an example with similar format.

    The code that handles this seems to agree that it's not in the list you're trying to eject it from:
    https://github.com/membase/ns_server/blob/master/src/menelaus_web.erl#L795

    Top
    • Login or register to post comments
    Mon, 12/19/2011 - 11:07
    kylefox
    Offline
    Joined: 06/08/2011
    Groups: None

    Aha, thanks! I somehow missed that /pools/default returns the 'optNode' I want (I was using the 'hostname').

    I'm wondering now what the difference is between the `ejectNode` and `failover` operations. Would it be appropriate to first failover the node, rebalance, and then eject the node?

    Top
    • Login or register to post comments
    Mon, 12/19/2011 - 22:30
    ingenthr
    Offline
    Joined: 03/16/2010
    Groups:

    You may wish to 'failover' without ejecting the node. For instance, you may want to failover to replicas within the cluster, fix the machine, then rebalance to bring it back in. You may also want to eject it, rather than bother with fixing it.

    Top
    • Login or register to post comments
    • Login or register to post comments
    • Login
    • Register

    Company

    • About Us
    • Leadership
    • Customers
    • Partners
    • Contact Us

    Product

    • Couchbase Server
    • Couchbase SDKs
    • Use Cases
    • Documentation
    • Forums

    Open Source

    • Couchbase Project
    • Couchbase vs. CouchDB

    Commercial

    • Subscriptions & Support
    • Training & Services

    News

    • Blog
    • Newsletter
    • Press Releases
    • Buzz

    Follow Us

        
    • Customer Login
    • Terms of Service
    • Privacy Policy
    • Trademark Policy
    • Site Map

    © 2013 COUCHBASE All rights reserved.

    Sign in to Couchbase Community

    close
    • Create new account
    • Request new password
    You are logging into the Forums, Wiki and Issue Tracker