8000 Configuration · grantr/dcell Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
alindeman edited this page May 14, 2012 · 4 revisions

The simplest way to configure and start DCell is with the following:

require 'dcell'

DCell.start

This configures DCell with all the default options, however there are many options you can override, e.g.:

DCell.start :id => "node42", :addr => "tcp://127.0.0.1:2042"

DCell identifies each node with a unique node ID, that defaults to your hostname. Each node needs to be reachable over 0MQ, and the addr option specifies the 0MQ address where the host can be reached. When giving a tcp:// URL, you must specify an IP address and not a hostname.

To join a cluster you'll need to provide the location of the unique node id of the directory server. This can be done through the "directory" configuration key:

DCell.start :id => "node66", :addr => "tcp://127.0.0.1:2066",
  :directory => {
    :id   => 'node42',
    :addr => 'tcp://127.0.0.1:2042'
  }

To use the registry for global data distribution, you'll need to provide the location of the registry server. This can be done through the "registry" configuration key:

DCell.start :id => "node42", :addr => "tcp://127.0.0.1:2042",
  :registry => {
    :adapter => 'redis',
    :host    => 'mycluster.example.org',
    :port    => 6379
  }

When configuring DCell to use Redis, use the following options:

  • adapter: "gossip" (optional, alternatively "redis", "zk", "moneta", or "cassandra")
  • host: hostname or IP address of the Redis server (optional, default localhost)
  • port: port of the Redis server (optional, default 6379)
  • password: password to the Redis server (optional)
Clone this wiki locally
0