【问题标题】:How to remove a node from BigCouch cluster?如何从 BigCouch 集群中删除节点?
【发布时间】:2012-07-02 17:03:11
【问题描述】:

我创建了具有 4 个节点的 BigCouch 集群,只需将 PUT 发送到节点数据库:

curl -X PUT http://bigcouch-a.example.com:5986/nodes/bigcouch@bigcouch-a.example.com -d {}
curl -X PUT http://bigcouch-a.example.com:5986/nodes/bigcouch@bigcouch-b.example.com -d {}
curl -X PUT http://bigcouch-a.example.com:5986/nodes/bigcouch@bigcouch-c.example.com -d {}
curl -X PUT http://bigcouch-a.example.com:5986/nodes/bigcouch@bigcouch-d.example.com -d {}

所有节点都已正确注册,向会员发送 GET 会返回所有 4 个节点:

{"all_nodes":[
    "bigcouch@bigcouch-a.example.com",
    "bigcouch@bigcouch-b.example.com",
    "bigcouch@bigcouch-c.example.com",
    "bigcouch@bigcouch-d.example.com"]
 "cluster_nodes":[
    "bigcouch@bigcouch-a.example.com",
    "bigcouch@bigcouch-b.example.com",
    "bigcouch@bigcouch-c.example.com",
    "bigcouch@bigcouch-d.example.com"]
}

问题是:如何移除节点?

我尝试将 DELETE 发送到节点数据库

curl -X DELETE http://bigcouch-a.example.com:5986/nodes/bigcouch@bigcouch-d.example.com

但我得到了一个错误:

{"error":"conflict", "reason":"Document update conflict."}

一旦我停止了节点 d,我的会员资格就会返回:

{"all_nodes":[
    "bigcouch@bigcouch-a.example.com",
    "bigcouch@bigcouch-b.example.com",
    "bigcouch@bigcouch-c.example.com"]
 "cluster_nodes":[
    "bigcouch@bigcouch-a.example.com",
    "bigcouch@bigcouch-b.example.com",
    "bigcouch@bigcouch-c.example.com",
    "bigcouch@bigcouch-d.example.com"]
}

所以节点d"all_nodes" 中消失了,但仍然作为"cluster_nodes 成员存在。

在这种状态下,我无法创建任何新数据库。每次收到消息:

could not load validation funs {function_clause,
    [{lists, flatmap,
    [#Fun<couch_db.36.90395586>,
    {nodedown, <<"progress not possible">>}]},
    {couch_db, '-load_validation_funs/1-fun-1-', 1}]}

有什么解决办法吗?

【问题讨论】:

    标签: couchdb cluster-computing bigcouch


    【解决方案1】:

    nodes db 是一个 couchdb 数据库,因此您需要传递当前版本来更新或删除文档。

    查看我之前关于如何移动分片的回答:moving a shard from one bigcouch server to another (for balancing)

    【讨论】:

      猜你喜欢
      • 2018-07-19
      • 2019-03-05
      • 1970-01-01
      • 2021-01-22
      • 2016-09-20
      • 2015-12-03
      • 1970-01-01
      • 2019-10-13
      相关资源
      最近更新 更多