Rethinkdb is a powerful new NoSQL database that comes with its one web-based admin console. However, its a bit awkward to set up. The installation is not hard when you have a one line homebrew installation or if you prefer to install it as an application, then you can simply use the use their disk image provided as a url download on their OSX installation page. However, the Rethinkdb command line tool is a bit awkward in the sense that it just creates a directory to store your data in the same directory that you launch it. This is a simple tutorial on how to set rethinkdb as a service so that it stores your data in the same place with a proper set of default configurations.
I would highly recommend using homebrew to install rethinkdb. Its a painless process and gives you full control as to how you use the
brew install rethinkdb
gem install lunchy
The first thing that we need to do is install the
rethinkdb plist file in our LaunchAgents directory. We can do this by firstly creating a file called
com.rethinkdb.server.plist and then running
lunchy install on that file. My own configuration is shown below.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.rethinkdb.server</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/rethinkdb</string> <string>-d</string> <string>/Users/quazinafiulislam/Library/RethinkDB/data</string> </array> <key>StandardOutPath</key> <string>/Users/quazinafiulislam/Library/Rethinkdb/out.log</string> <key>StandardErrorPath</key> <string>/Users/quazinafiulislam/Library/Rethinkdb/error.log</string> <key>RunAtLoad</key> <false/> <key>KeepAlive</key> <true/> <key>LowPriorityIO</key> <false/> </dict> </plist>
- Create a file using the
touch com.rethinkdb.server.plist, and just paste in the contents.
quazinafiulislamwith your username in the file.
- Create a new directory,
~/Library/Rethinkdb. This place will house all your rethinkdb stuff i.e. data, logs etc.
- Create a new data directory using
rethinkdb create -d ~/Library/Rethinkdb/data.
- The install the file into your LaunchAgents directory using
lunchy install com.rethinkdb.server.plist.
- Once this is done, create two log files using the
touchcommand to create the output log and the error log inside
This is the express installation, you can of course customize the installation to your needs. For example you can add your own
.conf file for rethinkdb. You can then add it as a parameter to your program arguments by adding the following to your
ProgramArguments inside of
Feel free to change the
plist file to your liking. One other thing that you might want to change is the
RunAtLoad key. I've set this to
false, but you might want
rethinkdb to start up when you log into your system.
Launching this is quite easy, all you need to do is tell
lunchy that you want to start the
lunchy start rethinkdb
We can see that the standard output is printed to the
out.log file inside of
rethinkdb is also a breeze.
lunchy stop rethinkdb
|||The Wikipedia Page will give you a good idea of what both |
|||If you want to know the difference between a launch agent and a demon, take a look at this article.|
|||Make sure that when you enter the path of a file or folder in a |
|||Learn to configure rethinkdb from their configuration documentation page. I would strongly encourage you to create your own |
|||You can specify your port as another |