You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2017/06/03 09:46:40 UTC
[2/2] couchdb-setup git commit: Merge remote-tracking branch
'adrienverge/COUCHDB-3119'
Merge remote-tracking branch 'adrienverge/COUCHDB-3119'
* adrienverge/COUCHDB-3119:
add_node: Don't fail if node name != "couchdb" or "node1"
Project: http://git-wip-us.apache.org/repos/asf/couchdb-setup/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-setup/commit/b2b93c17
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-setup/tree/b2b93c17
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-setup/diff/b2b93c17
Branch: refs/heads/master
Commit: b2b93c17754cb4169bf9e922d9be702eb6d0f0d5
Parents: 2590fbc d75693e
Author: Jan Lehnardt <ja...@apache.org>
Authored: Sat Jun 3 11:46:34 2017 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Sat Jun 3 11:46:34 2017 +0200
----------------------------------------------------------------------
README.md | 3 ++-
src/setup.erl | 8 ++++----
src/setup_httpd.erl | 3 ++-
test/t-frontend-setup.sh | 2 +-
test/t.sh | 2 +-
5 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/b2b93c17/README.md
----------------------------------------------------------------------
diff --cc README.md
index cde7aae,7316b25..a6c6d18
--- a/README.md
+++ b/README.md
@@@ -81,20 -75,24 +81,21 @@@ Repeat on all nodes
a. Go to Fauxton / Cluster Setup, once we have enabled the cluster, the
UI shows an “Add Node” interface with the fields admin, and node:
-- POST to /_setup with
+- POST a JSON entity to /_cluster_setup, the entity looks like:
```
- {
- "action": "add_node",
- "admin": { // should be auto-filled from Fauxton, store plaintext PW in
- // localStorage until we finish_cluster or timeout.
- "user": "username",
- "pass": "password"
- },
- "node": {
- "host": "hostname",
- ["port": 5984],
- "name": "node1" // as in “node1@hostname”, same as in vm.args
- }
- }
+{
+ "action":"add_node",
+ "username":"username",
+ "password":"password",
+ "host":"192.168.1.100",
- "port": 5984
++ ["port": 5984],
++ "name": "node1" // as in “node1@hostname”, same as in vm.args
+}
```
-b. as in a, but without the Fauxton bits, just POST to /_setup
+In the example above, this adds the node with IP address 192.168.1.100 to the cluster.
+
+b. as in a, but without the Fauxton bits, just POST to /_cluster_setup
- this request will do this:
- on the “setup coordination node”:
- check if we have an Erlang Cookie Secret. If not, generate
http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/b2b93c17/src/setup.erl
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/b2b93c17/src/setup_httpd.erl
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/b2b93c17/test/t-frontend-setup.sh
----------------------------------------------------------------------
diff --cc test/t-frontend-setup.sh
index 74743bb,7888925..52056a3
--- a/test/t-frontend-setup.sh
+++ b/test/t-frontend-setup.sh
@@@ -16,13 -16,13 +16,13 @@@ HEADERS="-HContent-Type:application/jso
curl a:b@127.0.0.1:15986/_nodes/_all_docs
# Enable Cluster on node A
-curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0","node_count":2}' $HEADERS
# Enable Cluster on node B
-curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","remote_node":"127.0.0.1","port":"25984","remote_current_user":"a","remote_current_password":"b","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","remote_node":"127.0.0.1","port":"25984","remote_current_user":"a","remote_current_password":"b","username":"foo","password":"baz","bind_address":"0.0.0.0","node_count":2}' $HEADERS
# Add node B on node A
- curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"add_node","username":"foo","password":"baz","host":"127.0.0.1","port":25984}' $HEADERS
+ curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"add_node","username":"foo","password":"baz","host":"127.0.0.1","port":25984,"name":"node2"}' $HEADERS
# Show cluster state:
curl a:b@127.0.0.1:15986/_nodes/_all_docs
http://git-wip-us.apache.org/repos/asf/couchdb-setup/blob/b2b93c17/test/t.sh
----------------------------------------------------------------------
diff --cc test/t.sh
index c569caa,4fbe7ea..6bd74cd
--- a/test/t.sh
+++ b/test/t.sh
@@@ -16,13 -16,13 +16,13 @@@ HEADERS="-HContent-Type:application/jso
curl a:b@127.0.0.1:15986/_nodes/_all_docs
# Enable Cluster on node A
-curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0","node_count":2}' $HEADERS
# Enable Cluster on node B
-curl a:b@127.0.0.1:25984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0"}' $HEADERS
+curl a:b@127.0.0.1:25984/_cluster_setup -d '{"action":"enable_cluster","username":"foo","password":"baz","bind_address":"0.0.0.0","node_count":2}' $HEADERS
# Add node B on node A
- curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"add_node","username":"foo","password":"baz","host":"127.0.0.1","port":25984}' $HEADERS
+ curl a:b@127.0.0.1:15984/_cluster_setup -d '{"action":"add_node","username":"foo","password":"baz","host":"127.0.0.1","port":25984,"name":"node2"}' $HEADERS
# Show cluster state:
curl a:b@127.0.0.1:15986/_nodes/_all_docs