RethinkDB を ubuntu12.10 にインストールした。(2014/02)
RethinkDB は開発者にとって使い易いJsonベースのドキュメント指向データベースです。
MongoDBやCouchDBとどう違うのかは公式ドキュメントにあります。
lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.10
Release: 12.10
Codename: quantal
sudo apt-get update
sudo apt-get upgrade
- /etc/environment に HTTPプロキシの設定を追加。
http_proxy=http://proxy.example.co.jp:8000
https_proxy=http://proxy.example..co.jp:8000
- 専用ユーザの追加
sudo adduser rethinkdb
sudo usermod -aG sudo rethinkdb
su - rethinkdb
- add-apt-repository をインストール
sudo apt-get install software-properties-common
基本的には、Install RethinkDB on Ubuntu 通りにすすめる。
sudo add-apt-repository ppa:rethinkdb/ppa
sudo apt-get update
sudo apt-get install rethinkdb
sudo cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/first.conf
sudo vi /etc/rethinkdb/instances.d/first.conf
デフォルトだとローカルアドレスにのみバインドされるので見易くする為に全部にバインドする。 当然、セキュアでは無い。
bind=all
- 起動
sudo /etc/init.d/rethinkdb start
- 停止
sudo /etc/init.d/rethinkdb start
メジャーなプログラミング言語なら大体何でもクライアントライブラリはある感じ。
-
pipのインストール
sudo apt-get install python-pip
- クライアントのインストール
sudo pip install rethinkdb
- python インタープリタで実行
import rethinkdb as r
r.connect('localhost', 28015).repl()
r.db('test').table_create('tv_shows').run()
r.table('tv_shows').insert({ 'name': 'Star Trek TNG' }).run()
r.table('tv_shows').order_by('name').run()