1
votes

I tried to create a 2-node cluster with CouchDB 2.1 multiple times (both on windows and ubuntu) and it never worked. I did exactly as described in the official documentation here.

When I finish the cluster-configuration of the two nodes, I expect to create a database on node1, which should show up on node2. Verification on both nodes via fauxton fails also "internal server error" - that happens both under Linux (ubuntu 14.04) and windows (10, Server 2012, Server 2016) with version 2.1

Configuring both CouchDB-Nodes via API:

node1: (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":["[email protected]","couchdb@localhost"]}

node2(10.0.0.2) same configuration as node1, but IP address for other node changes to 10.0.0.1

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

I never defined a zone - is this mandatory for the cluster to work? Is anybody here who already set up a working Couchdb-Cluster with 2 or more nodes ? Is anybody able to see a mistake I made whilst configuring the nodes? Please let me know if I can provide more information.

Help would be greatly appreciated.

best regards, Harald

1

1 Answers

1
votes

I've configured a 3 node cluster of CouchDB 2

In my opinion the main difficulty is to correctly setting the networking configuration between nodes for the erlang communication.

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

First, you should be sure that erlang is communicating between nodes. (http://docs.couchdb.org/en/2.1.1/cluster/setup.html#first-time-in-erlang-time-to-play)

You should set the erlang node name value in the vm.args file of your couchdb installation.

The name you use should be resolvable by a DNS or local hosts file in both nodes.

Finally, when you are sure that erlang is communicating you should register both nodes in the cluster.