Connecting to RethinkDB
How to connect and troubleshoot your connection to RethinkDB
Connecting with SSL - Admin Console
With SSL enabled, as it is by default, simply direct your web browser to the URL shown in the Compose console's Overview. The URL can be found under Connection Info for the Admin UI. For versions prior to Rethink 2.3 ensure that you have already created a user and use that user's credentials to log in. For 2.3 onward log in as user "admin" using the authentication credential available in the deployment overview page.
Connecting with SSL - Applications
Currently and to our knowledge, all four of the officially supported RethinkDB drivers (JavaScript, Python, Ruby and Java) as well as the Go driver (gorethink) support connecting via SSL. If you're using a different driver and having trouble with SSL connections, you'll probably want to contact the driver maintainers and let them know how much you want SSL support for RethinkDB. Got SSL to work in a driver we don't list here? Please, send us a note at [email protected].
In order to ensure the connection is both secure and prevents man-in-the-middle attacks, you'll need to grab the Public Key for your deployment from our UI. Once you have that plus the connection info (host, port, auth key), take a look at the specific driver docs for proper connection setup or take a look at this Compose article for Python, Ruby, Node/Javascript and Go connection examples; If you are using Rethink 2.3 and want to connect as a different user refer to this Compose article on Using RethinkDB 2.3's user authentication.
We're happy to provide assistance with your RethinkDB installation, however for in-depth application and driver support, check out the appropriate documentation and communities for your specific language and the driver that your application is using.
- http://rethinkdb.com/api/javascript/connect/
- http://rethinkdb.com/api/python/connect/
- http://rethinkdb.com/api/ruby/connect/
- http://rethinkdb.com/api/java/connect/
- https://github.com/dancannon/gorethink#gorethink---rethinkdb-driver-for-go
Connecting with SSH - Admin Console and Applications
We maintain an SSH portal for users who wish to create an SSH tunnel between their site and their RethinkDB deployment. This was initially our only supported option but SSL has superseded it in usability. We document it here for completeness.
RethinkDB uses multiple ports to expose access to the system. There's an admin UI port (8080
) and the port needed for drivers (28015
). Because the administrative console is protected from the general Internet, you must establish an ssh tunnel with port forwarding using your connection strings, similar to this example which creates tunnels for port 28015 and 8080 at the same time:
ssh -N [email protected] -p 10000 \
-L 127.0.0.2:8080:10.0.0.98:8080 \
-L 127.0.0.3:8080:10.0.0.99:8080 \
-L 127.0.0.2:28015:10.0.0.98:28015 \
-L 127.0.0.3:28015:10.0.0.99:28015
Note for Mac OS X users
On most Unix-like systems, all the addresses 127.0.0.1
to 255
are available as network loopback addresses (only connecting locally), but Apple decided to keep things simple and only set up 127.0.0.1
. To make the example work, you need to configure the addresses shown (127.0.0.2
and 127.0.0.3
) as aliases of 127.0.0.1
. If you don't do that, you'll be told that SSH can't bind to the port. For each loopback you want to configure you need to do the following:
sudo ifconfig lo0 alias 127.0.0.2 up
This command needs admin privilege, so is preceded by the sudo
command and you will be prompted for an admin password. Repeat as needed, usually for 127.0.0.3
and 127.0.0.4
.
Because this change doesn't survive a reboot, you'll need to add it to a script that you use to configure the tunnel or create a launchd service.
Still Need Help?
If this article didn't solve things, summon a human and get some help!
Updated over 3 years ago