在 Django 中连接到 rethinkdb 时出现 ReqlDriverError

ReqlDriverError while connecting to rethinkdb in Django

Django 抛出以下错误:

ReqlDriverError: Server dropped connection with message: "RethinkDB cluster"

我正在尝试通过自定义中间件连接到 Django 中的 RethinkDB。

下面是我用来连接 RethinkDB 的代码

@singleton
class rDBMiddleware(object):
    connection = None
   def __init__(self):
      if self.connection == None:
     self.connection = r.connect(host=' 192.x.x.x ', port=29015, db=' re_test ').repl()

你能帮我解决这个问题吗?到目前为止,我在 Internet 上找不到关于此 ReqlDriverError 的任何解决方案。

我可以 connect/access 通过 http://x.x.x.x:8080/

RethinkDB 服务器

在 django 中使用 python2.7 和 rethinkdb (2.1.0.post2) 驱动程序。

29015是RethinkDB集群内通信的端口。您可能希望将驱动程序连接到端口 28015.

已解决。

用以下行替换了连接:

self.connection = r.connect('192.x.x.x',28015).repl()