RethinkDB集群与外部服务器

时间:2015-07-06 15:48:29

标签: rethinkdb

我想用两台机器创建集群 - 在家里和VPS上(专用于OpenVZ)。

我在VPS上安装了RethinkDB,配置为自动启动并运行。一切都好。我可以通过网站访问(nginx代理通行证)。

我想用我的家用机器创建群集。所以我已经安装了RethinkDB并运行它。一切都很好(本地)。

运行此命令时:

rethinkdb --join DEDICATE_IP_SERVER:29015 --bind all

我有错误:

error: Received inconsistent routing information (wrong address) from DEDICATE_IP_SERVER:29015 (expected_address = peer_address [DEDICATE_IP_SERVER:29015], other_peer_addr = peer_address [127.0.0.1:29015, 127.0.0.2:29015, NAT_IP:29015, ::1:29015]), closing connection.  Consider using the '--canonical-address' launch option.

运行此命令时:

rethinkdb --canonical-address DEDICATE_IP_SERVER:29015 --bind all

Listening for intracluster connections on port 29015
Listening for client driver connections on port 28015
Listening for administrative HTTP connections on port 8080
Listening on addresses: 127.0.0.1, 127.0.1.1, 192.168.0.22, ::1, fe80::1e6f:65ff:feca:abd6%2
Server ready, "ubuntu_dom" a1ea003f-6497-482b-b826-ac815400818d

如何连接外部服务器?

在专用服务器上,我添加了iptables规则:

iptables -t nat -A PREROUTING -p tcp --dport 29015 -j DNAT --to-destination NAT_IP:29015

还测试了:

iptables -t nat -A PREROUTING -i vmbr0 -p tcp -d DEDICATE_IP_SERVER --dport 29015 -j DNAT --to-destination NAT_IP:29015

但它没有用。

端口没问题,因为我已经用nmap测试了。

nmap DEDICATE_SERVER_HOST -p 29015
Nmap scan report for DEDICATE_SERVER_HOST (DEDICATE_IP_SERVER)
Host is up (0.047s latency).
PORT      STATE SERVICE
29015/tcp open  unknown

1 个答案:

答案 0 :(得分:4)

好的,我发现了问题。

在外部服务器上,我必须使用param运行RethinkDB:​​ - canonical-address DEDICATE_IP_SERVER:29015

之后,我可以从家里连接加入参数。

相关问题