设置CouchDB 2.0集群 [英] Setup CouchDB 2.0 Cluster
问题描述
我正在尝试为边缘计算项目使用一些Raspberry Pi设置一个CouchDB集群。但是直到现在我所做的一切都没有成功。我没有使群集正常工作。
I am trying to setup a CouchDB cluster with some Raspberry Pi for a edge computing project. But all I did until now wasn't successful. I don't get a cluster working correctly.
这就是我所做的:
我遵循了
http://docs.couchdb.org/en/2.0.0/install/unix。 html#
in combination with: https://medium.com/linagora-engineering/setting-up-a-couchdb-2-cluster-on-centos-7-8cbf32ae619f#.eopseqi4h
- 安装依赖项-正常运行
-
./ configure
-没有错误 -
发布版本
-正常工作
- Installing the dependencies - worked without error
./configure
- worked without errormake release
- worked without error
按照指南进行操作:添加长沙发用户:
Following the guide: Add couchdb user:
adduser --system --no-create-home --shell /bin/bash --group --gecos
"CouchDB Administrator" couchdb
正常工作
mv rel / couchdb / usr / local /
-正常工作
更改了/usr/local/couchdb/etc/vm.args中的节点名称:-名称n1.couch.local
添加了内核inet_dist_listen_min 9100
和
-不起作用-更改回beddb @ localhost
-内核inet_dist_listen_max 9200
changed node-name in /usr/local/couchdb/etc/vm.args: -name n1.couch.local
added -kernel inet_dist_listen_min 9100
and
-kernel inet_dist_listen_max 9200
- didn't work - changed back to couchdb@localhost
凝视db
su - couchdb
cd /usr/local/couchdb
./bin/couchdb
-首先对我不起作用,su pw-身份验证失败-由 sudo su
和 su-couchdb $切换用户c $ c>
-didn't work for me in first place, su pw - Authentication failed - switched user by sudo su
and su - couchdb
db启动-运行,但引发错误(由于db正在运行,因此忽略了当前错误):
db starts - runs, but throws error (ignored error for now, because db is running):
[error] 2017-02-17T12:34:26.672758Z couchdb@localhost emulator ------
-- Error in process <0.354.0> on node 'couchdb@localhost' with exit
value: {database_does_not_exist,
[{mem3_shards,load_shards_from_db,"_users",
[{file,"src/mem3_shards.erl"},{line,327}]},
{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},
{line,315}]},{mem3_shards,load_shards_from_disk...
[notice] 2017-02-17T12:34:26.672918Z couchdb@localhost <0.353.0> ----
---- chttpd_auth_cache changes listener died database_does_not_exist
at mem3_shards:load_shards_from_db/6(line:327) <=
mem3_shards:load_shards_from_disk/1(line:315) <=
mem3_shards:load_shards_from_disk/2(line:331) <=
mem3_shards:for_docid/3(line:87) <= fabric_doc_open:go/3(line:38) <=
chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:187) <=
chttpd_auth_cache:listen_for_changes/1(line:134)
为群集模式准备了两个Raspberry Pi(2个CouchDB节点):
prepared two Raspberry Pi (2 CouchDB nodes) for cluster mode:
curl -X PUT http://127.0.0.1:5984/_node/couchdb@localhost/
_config/admins/admin -d '"conmonmrp"'`
-
answer:
answer:
-pbkdf2-9ec43ace4195ee45a37773c9dfc2aba9380468cb,
cddfb98dd1b2416dea2b53dc9fe9a31b,10"-pbkdf2-9ec43ace4195ee45a37773c9dfc2aba9380468cb, cddfb98dd1b2416dea2b53dc9fe9a31b,10"
和
`curl -X PUT http://127.0.0.1:5984/_node/couchdb@localhost/ _config/chttpd/bind_address -d '"0.0.0.0"'`
- answer :
0.0.0.0
- answer:
"0.0.0.0"
似乎已接受命令
在localhost:5984 / _utils /上尝试并尝试设置群集-输入凭据(未更改IP和端口)并按IP添加了另一个节点(网络IP,例如10.228.101.210),创建了集群以完成设置-fauxton接受了该提示,没有错误。
Went on localhost:5984/_utils/ and tried to setup cluster - entered credentials (did not change IP and port) and added another node by IP (network IP, i.e. 10.228.101.210), created cluster to finish setup - fauxton accepted that without an error.
试图通过localhost:5984 /获取集群中的所有节点。 _membership /结果:
trying to get all nodes in the cluster by localhost:5984/_membership/ results in:
{"all_nodes":["couchdb@localhost"],"cluster_nodes": ["couchdb@10.228.101.210","couchdb@localhost"]}`
- answer :
-
正在尝试在一个节点上添加数据库并在另一个节点上查看数据库不起作用
trying to add a database on one node and see it on another one doesn't work
我真的很陌生CouchDB之类的东西,但是我需要使该集群运行。希望我的介绍可以帮助您找到问题所在。总的来说,我感到自己很想念或错过了一个重要的观点。
I'am really new to that CouchDB thing at all, but I need to get that cluster running. I hope, my discription helps to find the problem. Altogether I got the feeling, that I am missing or missunderstandig an important point on that.
来自德国汉堡的最诚挚问候
Best regards from Hamburg, DE
推荐答案
遇到麻烦后设置群集后,一个朋友发现了问题。必须在/couchdb/etc/vm.args文件中更改节点的名称。当我在另一篇文章中读到时,将其命名为@localhost是非法的。我将其更改为设备的IP地址。
After having some trouble with setting up the cluster, a friend found the problem. It is necessary to change the name of the node in the /couchdb/etc/vm.args file. As I read in another post it is illegal to name it @localhost. I changed that to the IP-address of the device.
在那之后,一切对我来说都很好。
After that, everything works fine for me now.
这篇关于设置CouchDB 2.0集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!