Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Configuration

Dmytro Milinevskyy edited this page Jul 7, 2015 · 9 revisions

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

require 'dcell'
require 'dcell/registries/redis_adapter'

registry = DCell::Registry::RedisAdapter.new :server => 'localhost'

DCell.start :registry => registry

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",
  registry: registry
})

DCell identifies each node with a unique node ID. If not given then its auto-generated. 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 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 officially supports cassandra, zookeeper and redis as storage backends.

Redis adapter configuration options:

  • host: hostname or IP address of the Redis server (optional, default localhost)
  • port: port of the Redis server (optional)
  • password: password to the Redis server (optional)
  • env: suffix of Redis namespace (optional, default "production")
  • namespace: Redis namespace (optional, default dcell_%{env})

Cassandra adapter configuration options:

  • servers: array of %{host}:%{port} locations of the cassandra servers (optional, default localhost)
  • keyspace: cassandra keyspace (optional, default "dcell")
  • columnfamily: cassandra columnfamily (optional, default "dcell")

Zookeeper adapter configuration options:

  • env: suffix of the base path (optional, default "production")
  • servers: array of %{host}:%{port} locations of the cassandra servers (optional, default localhost)
Clone this wiki locally