How to verify a CouchDB 2.0 cluster setup

2019-07-17 18:29发布

问题:

I just set my three CouchDB instances as a cluster, this is how I did when I set it up:

  1. Add "-kernel inet-dist-listen-minimum/maxinum" from 9100 to 9200 to the vm.args file. and shut down the firewall

  2. Set three couchdb instanes' using the same admin and passwords.

  3. Change binding address to 0.0.0.0 for both chttpd and httpd section in Fauxton

  4. Choos one of the couchdb instance to set up as cluster then add two nodes (by entering their ip address)

  5. All done

After these steps, I believe the cluster should be set up properly, however, when I ran the command

curl http://username:login@localhost/_membership

on three VMs, only the main one of the three nodes showed it had three members in the cluster( nodes).

This is what it looks like when in http://localhost:9000/_membership (It's a ssh tunnel to connect to the port 5984 from my computer) :

{"all_nodes":["couchdb@localhost"],"cluster_nodes":["couchdb@130.56.252.xxx","couchdb@130.56.252.xxx","couchdb@localhost"]}

And this is what the other instances show:

{"all_nodes":["couchdb@localhost"],"cluster_nodes":["couchdb@localhost"]}

So now I have got two questions:

  1. Did I set the cluster it correctly?

  2. How can I tell if I set it properly?