3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ROMAAdvent Calendar 2015

Day 7

Storageにgroongaを利用する方法

Last updated at Posted at 2015-12-07

前回はTokyoCabinetを利用する方法を載せましたが、今回はgroongaを利用する方法を載せます。
images.jpg

条件

server: 1台
storage type : groonga
ruby version : v2.1
ROMA version : v1.2.0
Installation type : rubygems

手順

1. install ROMA

$ gem install roma

2. make instance(Cluster)

$ mkroute localhost_10001 localhost_10002 --replication_in_host
ls -l
  -rw-r--r-- 1 root root 35693 Dec  2 05:35 localhost_10001.route
  -rw-r--r-- 1 root root 35693 Dec  2 05:35 localhost_10002.route
  • 前回作成したものを使い回しても構いません

3. groonga インストール

CentOS

# rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
# yum makecache
# yum install groonga
# yum list groonga
  groonga.x86_64    5.0.5-1.el6     @groonga

Ubuntu

# apt-get install software-properties-common
# add-apt-repository universe
# add-apt-repository ppa:groonga/ppa
# apt-get update
# apt-get install groonga
# dpkg -l groonga
||/ Name       Version         Architecture  Description
+++-=========-================-=============-=====================================================
ii  groonga    5.0.5-2~trusty1 amd64         Fulltext search engine (metapackage for library use)

4. Install rroonga(ruby bindings of groonga)

images.png

CentOS

# yum install groonga-libs groonga-devel
$ gem install rroonga
$ gem list | grep rroonga
rroonga (5.0.9)

Ubuntu

# apt-get install libgroonga-dev
$ gem install rroonga
$ gem list | grep rroonga
rroonga (5.0.9)

5. config設定

$ mkconfig

Which storage will you use?
[1] Ruby Hash
[2] Tokyo Cabinet
[3] Groonga
> ### => 3を選択します

残りの設定はサーバや環境に合わせて入力してください
http://qiita.com/hiroaki-iwase/items/84bdce36f2f482e6c2c3

6. booting ROMA

romad localhost -p 10001 -d --config ./config.rb --replication_in_host
romad localhost -p 10002 -d --config ./config.rb --replication_in_host
  • 作成したconfig.rbを指定してROMAを起動します

7. 確認

$ telnet localhost 10001

> stat st_class
  storages[roma].storage.st_class GroongaStorage
  END

StorageがGroongaStorageになっていることが確認できます

ベンチマーク

以下にTokyoCabinetとgroonga, memory modeと他NOSQLのベンチマークがあります。
http://roma-kvs.org/blogs/blog-entry-8.html
bench.png

参照URL

ROMA Use Groonga for ROMA : http://roma-kvs.org/learn/groonga_lib.html
Groonga ドキュメント : http://groonga.org/ja/docs/

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?