diff --git a/src/api/server/common.rst b/src/api/server/common.rst index ee0f3521..04dfb962 100644 --- a/src/api/server/common.rst +++ b/src/api/server/common.rst @@ -208,6 +208,126 @@ "locations" ] +.. _api/server/cluster_setup: + +=================== +``/_cluster_setup`` +=================== + +.. versionadded: 2.0 +.. http:get:: /_cluster_setup + :synopsis: Return the status of the cluster setup wizard + + Returns the status of the node or cluster, per the cluster setup wizard. + + :
header Content-Type: - :mimetype:`application/json` + - :mimetype:`text/plain; charset=utf-8` + :>json string state: Current ``state`` of the node and/or cluster (see + below) + :code 200: Request completed successfully + + The ``state`` returned indicates the current node or cluster state, and + is one of the following: + + - ``cluster_disabled``: The current node is completely unconfigured. + - ``single_node_disabled``: The current node is configured as a single + (standalone) node (``[cluster] n=1``), but either does not have a + server-level admin user defined, or does not have the standard system + databases created. If the ``ensure_dbs_exist`` query parameter is + specified, the list of databases provided overrides the default list + of standard system databases. + - ``single_node_enabled``: The current node is configured as a single + (standalone) node, has a server-level admin user defined, and has + the ``ensure_dbs_exist`` list (explicit or default) of databases + created. + - ``cluster_enabled``: The current node has ``[cluster] n`` > 1, is not + bound to ``127.0.0.1`` and has a server-level admin user defined. + However, the full set of standard system databases have not been + created yet. If the ``ensure_dbs_exist`` query parameter is + specified, the list of databases provided overrides the default list + of standard system databases. + - ``cluster_finished``: The current node has ``[cluster] n`` > 1, is not + bound to ``127.0.0.1``, has a server-level admin user defined *and* + has the ``ensure_dbs_exist`` list (explicit or default) of databases + created. + + **Request**: + + .. code-block:: http + + GET /_cluster_setup HTTP/1.1 + Accept: application/json + Host: localhost:5984 + + **Response**: + + .. code-block:: http + + HTTP/1.1 200 OK + X-CouchDB-Body-Time: 0 + X-Couch-Request-ID: 5c058bdd37 + Server: CouchDB/2.1.0-7f17678 (Erlang OTP/17) + Date: Sun, 30 Jul 2017 06:33:18 GMT + Content-Type: application/json + Content-Length: 29 + Cache-Control: must-revalidate + + {"state":"cluster_enabled"} + +.. http:post:: /_cluster_setup + :synopsis: Sets up a node as a single node or as part of a cluster. + + Configure a node as a single (standalone) node, as part of a cluster, + or finalise a cluster. + + :
", "remote_current_user": "", "remote_current_password": "" }' + curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "enable_cluster", "bind_address":"0.0.0.0", "username": "admin", "password":"password", "port": 15984, "node_count": "3", "remote_node": "", "remote_current_user": "", "remote_current_password": "" }' curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "add_node", "host":"", "port": "", "username": "admin", "password":"password"}' This will join the two nodes together. diff --git a/src/install/setup.rst b/src/install/setup.rst index 8bcc8d36..6cd38612 100644 --- a/src/install/setup.rst +++ b/src/install/setup.rst @@ -35,8 +35,9 @@ After installation and initial startup, visit Fauxton at CouchDB as a single-node instance or set up a cluster. When you click “Single-Node-Setup”, you will get asked for an admin username and password. Choose them well and remember them. You can also bind CouchDB -to a public port, so it is accessible within your LAN or the public, if -you are doing this on a public VM. The wizard then configures your admin +to a public address, so it is accessible within your LAN or the public, if +you are doing this on a public VM. Or, you can keep the installation private +by binding only to 127.0.0.1 (localhost). The wizard then configures your admin username and password and creates the three system databases ``_users``, ``_replicator`` and ``_global_changes`` for you. diff --git a/src/whatsnew/2.1.rst b/src/whatsnew/2.1.rst index 0af53f0d..71e850f4 100644 --- a/src/whatsnew/2.1.rst +++ b/src/whatsnew/2.1.rst @@ -135,6 +135,8 @@ The 2.1.0 release also includes the following minor improvements: * :ghissue:`483`: couchup database migration tool * :ghissue:`582`: Add X-Frame-Options support to help protect against clickjacking + * :ghissue:`593`: Allow bind address of 127.0.0.1 in ``_cluster_setup`` for + single nodes * :ghissue:`624`: Enable compaction daemon by default * :ghissue:`626`: Allow enable node decom using string "true" * (mango) Configurable default limit, defaults to 25.