【问题标题】:Creating a 2-node CouchDB 2.1 cluster创建 2 节点 CouchDB 2.1 集群
【发布时间】:2018-04-23 12:47:22
【问题描述】:

我多次尝试使用 CouchDB 2.1(在 Windows 和 ubuntu 上)创建一个 2 节点集群,但它从未成功。我完全按照官方文档here中的描述做了。

当我完成两个节点的集群配置后,我希望在 node1 上创建一个数据库,该数据库应该会显示在 node2 上。通过 fauxton 在两个节点上的验证也失败了“内部服务器错误”——这在 Linux (ubuntu 14.04) 和 windows (10, Server 2012, Server 2016) 版本 2.1 下都会发生

通过 API 配置两个 CouchDB 节点:

节点1:(10.0.0.1) 1. POST {"action": "enable_cluster", "bind_address":"0.0.0.0", "username": "admin", "password":"mypassword", "node_count":"2"}

  1. POST {“action”:“enable_cluster”、“bind_address”:“0.0.0.0”、“username”:“admin”、“password”:“mypassword”、“port”:5984、“node_count” ": "2", "remote_node": "10.0.0.2", "remote_current_user": "admin", "remote_current_password": "mypassword" }

  2. POST {“action”:“add_node”,“host”:“10.0.0.2”,“port”:“5984”,“username”:“admin”,“password”:“mypassword”}

  3. POST {"action": "finish_cluster"}

http://10.0.0.1:5984/_membership {"all_nodes":["couchdb@localhost"],"cluster_nodes":["couchdb@10.0.0.2","couchdb@localhost"]}

node2(10.0.0.2) 与node1相同的配置,但其他节点的IP地址更改为10.0.0.1

http://10.0.0.2:5984/_membership {"all_nodes":["couchdb@localhost"],"cluster_nodes":["couchdb@10.0.0.1","couchdb@localhost"]}

我从未定义过区域 - 这是集群工作所必需的吗? 这里有人已经建立了一个具有 2 个或更多节点的工作 Couchdb-Cluster 吗? 有人能看到我在配置节点时犯的错误吗?如果我能提供更多信息,请告诉我。

我们将不胜感激。

最好的问候, 哈拉尔

【问题讨论】:

    标签: nosql couchdb cluster-computing


    【解决方案1】:

    我已经配置了一个 CouchDB 2 的 3 节点集群

    在我看来,主要困难是正确设置节点之间的网络配置以进行 erlang 通信。

    http://docs.couchdb.org/en/2.1.1/cluster/setup.html#cluster-setup

    首先,您应该确保 erlang 正在节点之间进行通信。 (http://docs.couchdb.org/en/2.1.1/cluster/setup.html#first-time-in-erlang-time-to-play)

    您应该在您的 couchdb 安装的 vm.args 文件中设置 erlang 节点名称值。

    您使用的名称应该可以由两个节点中的 DNS 或本地主机文件解析。

    最后,当您确定 erlang 正在通信时,您应该在集群中注册两个节点。

    【讨论】:

    • 您好胡安,感谢您的回复!我已经得到了 couchdb 开发人员的提示 - 主要的困难是(就像你推荐的那样)erlang-communication 的节点名未编辑(couchdb@localhost),这会阻止集群正常工作。一旦我用 couchdb@ 替换它,它就会像预期的那样工作。
    猜你喜欢
    • 2019-02-05
    • 2020-03-19
    • 1970-01-01
    • 1970-01-01
    • 2017-06-03
    • 2017-10-27
    • 2018-08-09
    • 1970-01-01
    • 2014-11-15
    相关资源
    最近更新 更多