LoginSignup
3
3

More than 5 years have passed since last update.

single serverでのインストール方法(rubygems)

Last updated at Posted at 2015-12-02

とりあえずまずは使ってみたいという方用の、single serverにinstallする手順です。
(実際の本番環境では複数台でクラスターを組むことを推奨します)

条件

server: 1台
storage type : memory
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
  • mkrouteコマンドはROMAのクラスター構成ファイル(routing file)を作成します。
  • --replication_in_hostオプションは同一サーバ内でのデータ複製を許可するオプションです。通常はdebug用にsingle serverで構成するときのみ使用します。

3. booting ROMA

romad localhost -p 10001 -d --replication_in_host
romad localhost -p 10002 -d --replication_in_host
  • romadコマンドのusage
    romad <address> [options]
  • -pオプションはROMAのport No.を指定します
  • -dオプションはROMAをdaemonモードで起動します
    他のオプションに関してはROMA Commands をご参照ください

挙動確認

telnet localhost 10001
> version
  VERSION ROMA-1.2.0

> stat node
  stats.run_receive_a_vnode {}
  routing.nodes.length 2
  routing.nodes ["localhost_10001", "localhost_10002"]
  routing.vnodes.length 512
  routing.short_vnodes 0
  routing.lost_vnodes 0
  routing.version_of_nodes {"localhost_10001"=>66048, "localhost_10002"=>66048}
  END

> set foo 0 0 3
  bar
  STORED

> get foo
  VALUE foo 0 3
  bar
  END

> balse
  Are you sure?(yes/no)
> yes
  {"localhost_10002"=>"BYE", "localhost_10001"=>"BYE"}
  Connection closed by foreign host.

  • stat node コマンドはROMAの基本的なstatus情報を表示します
  • setコマンドのusage
set <key> 0 <expt> <value length>\r\n
<value>\r\n
  • balse コマンドはROMA Clusterを終了させるコマンドです
    (shutdownコマンドも同様の動きをします)

参照URL

ROMA Getting Started : http://roma-kvs.org/getting_started.html
ROMA commands page : http://roma-kvs.org/commands.html
ROMA FAQ page : http://roma-kvs.org/learn/faq.html

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