Go to http://server1:45984/_membership to see the name of the node and all the nodes it knows about and are connected too.
curl -X GET "http://xxx.xxx.xxx.xxx:5984/_membership" --user admin-user
{
"all_nodes":[
"node1@xxx.xxx.xxx.xxx"],
"cluster_nodes":[
"node1@xxx.xxx.xxx.xxx"]
}
To add a node simply do:
curl -X PUT "http://xxx.xxx.xxx.xxx:5986/_nodes/node2@yyy.yyy.yyy.yyy" -d {}
Now look at http://server1:5984/_membership again.
{
"all_nodes":[
"node1@xxx.xxx.xxx.xxx",
"node2@yyy.yyy.yyy.yyy"
],
"cluster_nodes":[
"node1@xxx.xxx.xxx.xxx",
"node2@yyy.yyy.yyy.yyy"
]
}
And you have a 2 node cluster :)
http://yyy.yyy.yyy.yyy:5984/_membership will show the same thing, so you only have to add a node once.