couchdb 2.0 安装和单节点设置
couchdb 2.0 installation and singel node setup
安装 couchdb 2.0 后,文档要求您这样做:
After installation and initial startup, visit Fauxton at
http://127.0.0.01:5984/_utils#setup. You will be asked to set up
CouchDB as a single-node instance or set up a cluster.
这会妨碍自动安装过程。
当您决定选择一个选项时,实际发生了什么?
通过 API 调用可以达到相同的结果吗?
感谢您的任何见解
沃尔克
当然:)
来自 couchdb-documentation 存储库的文档。
集群设置Api
如果您希望手动配置 CouchDB 集群,CouchDB 公开了
_cluster_setup
端点。安装和初始设置后。
我们可以设置集群。在每个节点上,我们需要 运行 以下命令来
设置节点:
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"}'
之后我们可以将所有节点连接在一起。选择一个节点
作为 "setup coordination node" 到 运行 所有这些命令。
这是一个 "setup coordination node" 管理设置和
要求所有其他节点能够看到它,反之亦然。
安装程序不适用于不可用的节点。
一旦设置完成,"setup coordination node" 的概念将消失。
从那时起,集群将不再有 "setup coordination node"。
添加节点 运行 这两个命令:
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, "remote_node": "<remote-node-ip>", "remote_current_user": "<remote-node-username>", "remote_current_password": "<remote-node-password>" }'
curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "add_node", "host":"<remote-node-ip>", "port": "<remote-node-port>", "username": "garren", "password":"password"}' -H "Content-Type: application/json"
这会将两个节点连接在一起。
为每个保留 运行ning 以上命令
要添加到集群的节点。一旦完成 运行
以下命令完成设置并添加缺少的数据库:
curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "finish_cluster"}'
您的 CouchDB 集群现已设置。
来源:https://github.com/apache/couchdb-documentation/blob/master/src/cluster/setup.rst
安装 couchdb 2.0 后,文档要求您这样做:
After installation and initial startup, visit Fauxton at http://127.0.0.01:5984/_utils#setup. You will be asked to set up CouchDB as a single-node instance or set up a cluster.
这会妨碍自动安装过程。 当您决定选择一个选项时,实际发生了什么? 通过 API 调用可以达到相同的结果吗?
感谢您的任何见解 沃尔克
当然:)
来自 couchdb-documentation 存储库的文档。
集群设置Api
如果您希望手动配置 CouchDB 集群,CouchDB 公开了
_cluster_setup
端点。安装和初始设置后。
我们可以设置集群。在每个节点上,我们需要 运行 以下命令来
设置节点:
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"}'
之后我们可以将所有节点连接在一起。选择一个节点 作为 "setup coordination node" 到 运行 所有这些命令。 这是一个 "setup coordination node" 管理设置和 要求所有其他节点能够看到它,反之亦然。 安装程序不适用于不可用的节点。 一旦设置完成,"setup coordination node" 的概念将消失。 从那时起,集群将不再有 "setup coordination node"。 添加节点 运行 这两个命令:
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, "remote_node": "<remote-node-ip>", "remote_current_user": "<remote-node-username>", "remote_current_password": "<remote-node-password>" }'
curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "add_node", "host":"<remote-node-ip>", "port": "<remote-node-port>", "username": "garren", "password":"password"}' -H "Content-Type: application/json"
这会将两个节点连接在一起。 为每个保留 运行ning 以上命令 要添加到集群的节点。一旦完成 运行 以下命令完成设置并添加缺少的数据库:
curl -X POST -H "Content-Type: application/json" http://admin:password@127.0.0.1:5984/_cluster_setup -d '{"action": "finish_cluster"}'
您的 CouchDB 集群现已设置。
来源:https://github.com/apache/couchdb-documentation/blob/master/src/cluster/setup.rst