Search code examples
djangorethinkdbrethinkdb-python

ReqlDriverError while connecting to rethinkdb in Django


Django throws below error :

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

Am trying to connect to RethinkDB in Django via custom middleware.

Below is the code am using to connect to 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()

Could you help me to figure this out ? I couldn't find any solution in the Internet so far on this ReqlDriverError.

I am able to connect/access the RethinkDB server via http:/x.x.x.x:8080/

Using python2.7, and rethinkdb (2.1.0.post2) driver in django.


Solution

  • 29015 is the port for RethinkDB intracluster communication. You probably want to connect the driver to port 28015.