I'm following this documentation :
http://docs.couchdb.org/en/latest/cluster/setup.html#the-cluster-setup-api
The 11.1 part: The Cluster Setup API
I have 3 ubuntu machines with CouchDB and Curl installed, with the following ips :
- 192.168.219.138
- 192.168.219.139
- 192.168.219.140
First step, as the doc says, i'm entering the following commands on each of the 3 machines (admin password have been set.) :
> curl -X POST -H "Content-Type: application/json"
> http://admin:[email protected]:5984/_cluster_setup -d '{"action":
> "enable_cluster", "bind_address":"0.0.0.0", "username": "admin",
> "password":"password", "node_count":"3"}'
it says this on each machines :
{"ok":true}
Second step, i go on the 192.168.219.139 (setup coordination node) and try adding the nodes, so I'm entering theses commands, just like the doc is mentionning :
curl -X POST -H "Content-Type: application/json" http://admin:[email protected]:5984/_cluster_setup -d '{"action": "enable_cluster", "bind_address":"0.0.0.0", "username": "admin", "password":"password", "port": 15984, "node_count": "3", "remote_node": "192.168.219.138", "remote_current_user": "admin", "remote_current_password": "password" }'
curl -X POST -H "Content-Type: application/json" http://admin:[email protected]:5984/_cluster_setup -d '{"action": "add_node", "host":"192.168.219.138", "port": 5684, "username": "admin", "password":"password"}'
curl -X POST -H "Content-Type: application/json" http://admin:[email protected]:5984/_cluster_setup -d '{"action": "enable_cluster", "bind_address":"0.0.0.0", "username": "admin", "password":"password", "port": 15984, "node_count": "3", "remote_node": "192.168.219.140", "remote_current_user": "admin", "remote_current_password": "password" }'
curl -X POST -H "Content-Type: application/json" http://admin:[email protected]:5984/_cluster_setup -d '{"action": "add_node", "host":"192.168.219.140", "port": 5684, "username": "admin", "password":"password"}'
Then, i do this command to check if my cluster is ok :
curl http://admin:[email protected]:5984/_membership
And this is the answer, all the nodes are missing :
{
"all_nodes": [
"couchdb@localhost"
],
"cluster_nodes": [
"[email protected]",
"[email protected]",
"couchdb@locahost"
]
}
Please notice, the doc says I'm supposed to get this :
{
"all_nodes": [
"couchdb@couch1",
"couchdb@couch2",
"couchdb@couch3"
],
"cluster_nodes": [
"couchdb@couch1",
"couchdb@couch2",
"couchdb@couch3"
]
}
I guess my cluster is not functional, could you please tell me what am I doing wrong?
Thank you .
For example, then I go to the 192.168.219.139, add a new database called 'establishments' and nothing happens on both 2 others nodes !!