Dynomite, inspired by Dynamo whitepaper, is a thin, distributed dynamo layer for different storage engines and protocols. Currently these include Redis and Memcached. Dynomite supports multi-datacenter replication and is designed for high availability.
The ultimate goal with Dynomite is to be able to implement high availability and cross-datacenter replication on storage engines that do not inherently provide that functionality. The implementation is efficient, not complex (few moving parts), and highly performant.
Every branch numbered like v0.5.9, v0.5.8 etc is stable and safe to use in production unless marked as pre-release. The dev branch is the development unstable branch. Over time master branch has fallen behind and is not maintained. We will eventually delete it and may or may not recreate it.
For questions or contributions, please consider reading CONTRIBUTING.md.
To build Dynomite from source with debug logs enabled and assertions disabled:
$ git clone git@github.com:Netflix/dynomite.git
$ cd dynomite
$ autoreconf -fvi
$ ./configure --enable-debug=yes
$ make
$ src/dynomite -h
To build Dynomite in debug mode:
$ git clone git@github.com:Netflix/dynomite.git
$ cd dynomite
$ autoreconf -fvi
$ CFLAGS="-ggdb3 -O0" ./configure --enable-debug=full
$ make
$ sudo make install
Usage: dynomite [-?hVdDt] [-v verbosity level] [-o output file]
[-c conf file] [-p pid file]
Options:
-h, --help : this help
-V, --version : show version and exit
-t, --test-conf : test configuration for syntax errors and exit
-g, --gossip : enable gossip (default: disabled)
-d, --daemonize : run as a daemon
-D, --describe-stats : print stats description and exit
-v, --verbosity=N : set logging level (default: 5, min: 0, max: 11)
-o, --output=S : set logging file (default: stderr)
-c, --conf-file=S : set configuration file (default: conf/dynomite.yml)
-p, --pid-file=S : set pid file (default: off)
-x, --admin-operation=N : set size of admin operation (default: 0)
Dynomite can be configured through a YAML file specified by the -c or --conf-file command-line argument on process start. The configuration files parses and understands the following keys:
- env: Specify environment of a node. Currently supports aws and network (for physical datacenter).
- datacenter: The name of the datacenter. Please refer to architecture document.
- rack: The name of the rack. Please refer to architecture document.
- dyn_listen: The port that dynomite nodes use to inter-communicate and gossip.
- enable_gossip: enable gossip instead of static tokens (default: false). Gossip is experimental.
- gos_interval: The sleeping time in milliseconds at the end of a gossip round.
- tokens: The token(s) owned by a node. Currently, we don't support vnode yet so this only works with one token for the time being.
- dyn_seed_provider: A seed provider implementation to provide a list of seed nodes.
- dyn_seeds: A list of seed nodes in the format: address:port:rack:dc:tokens (node that vnode is not supported yet)
- listen: The listening address and port (name:port or ip:port) for this server pool.
- timeout: The timeout value in msec that we wait for to establish a connection to the server or receive a response from a server. By default, we wait indefinitely.
- preconnect: A boolean value that controls if dynomite should preconnect to all the servers in this pool on process start. Defaults to false.
- data_store: An integer value that controls if a server pool speaks redis (0) or memcached (1) or other protocol. Defaults to redis (0).
- auto_eject_hosts: A boolean value that controls if server should be ejected temporarily when it fails consecutively server_failure_limit times. See liveness recommendations for information. Defaults to false.
- server_retry_timeout: The timeout value in msec to wait for before retrying on a temporarily ejected server, when auto_eject_host is set to true. Defaults to 30000 msec.
- server_failure_limit: The number of consecutive failures on a server that would lead to it being temporarily ejected when auto_eject_host is set to true. Defaults to 2.
- servers: A list of local server address, port and weight (name:port:weight or ip:port:weight) for this server pool. Currently, there is just one.
- secure_server_option: Encrypted communication. Must be one of 'none', 'rack', 'datacenter', or 'all'.
datacentermeans all communication between datacenters is encrypted but within a datacenter it is not.rackmeans all communication between racks and regions is encrypted however communication between nodes within the same rack is not encrypted.allmeans all communication between all nodes is encrypted. Andnonemeans none of the communication is encrypted. - stats_listen: The address and port number for the REST endpoint and for accessing statistics.
- stats_interval: set stats aggregation interval in msec (default: 30000 msec).
- mbuf_size: size of mbuf chunk in bytes (default: 16384 bytes).
- max_msgs: max number of messages to allocate (default: 200000).
For example, the configuration file in conf/dynomite.yml
Finally, to make writing syntactically correct configuration files easier, dynomite provides a command-line argument -t or --test-conf that can be used to test the YAML configuration file for any syntax error.
The utility generate_yams.py automates .yaml configuration files creation, needed for every node.
The following usage examples show how to create different cluster configuration with the command line.
Usage example 1:
- 2 Datacenters (usa / europe)
- Each having 1 Rack (usa_rack1 / europe_rack1)
- One node per Rack, external ip's should be used (1.1.1.2 / 1.1.1.3)
python generate_yamls.py 1.1.1.2:europe_rack1:europe 1.1.1.3:usa_rack1:usa -o mycluster
Will generate two yml files outputing the files to 'mycluster' folder
More commands:
python generate_yamls.py --help
usage:
Dynomite Configuration YAML Generator
Script for generating Dynomite yaml configuration files for distribution with every node.
generated yaml files will be outputted for each node, named as {ipaddress}.yml
so cluster wide can be easily configured
[-h] [-cp CLIENT_PORT] [-o OUTPUT_DIR] [-sp SERVER_PORT]
[-pp PEER_PORT] [-rc {DC_QUORUM,DC_ONE,DC_SAFE_QUORUM}]
[-sso {datacenter,none,rack}] [--redis] [--mem]
nodes [nodes ...]
positional arguments:
nodes Usage: <script> publicIp:rack_name:datacenter
publicIp:rack_name:datacenter ... outputs one yaml
file per input node(for a single rack) restrict
generation of the confs for all hosts per rack and not
across rack.
optional arguments:
-h, --help show this help message and exit
-cp CLIENT_PORT Client port to use (The client port Dynomite provides
instead of directly accessing redis or memcache)
Default is: 8102 Your redis or memcache clients should
connect to this port
-o OUTPUT_DIR Output directory for the YAML files, if does not exist
will be created, Default is current directory (.)
-sp SERVER_PORT The port your redis or memcache will run locally on
each node, assuming it's uniform, (default is: 6379)
-pp PEER_PORT The port Dynamo clients will use to communicate with
each other, (default is: 8101)
-rc {DC_QUORUM,DC_ONE,DC_SAFE_QUORUM}
Sets the read_consistency of the cluster operation
mode (default is: DC_ONE)
-sso {datacenter,none,rack}
Type of communication between Dynomite nodes, Must be
one of 'none', 'rack', 'datacenter', or 'all' (default
is: datacenter)
--redis Sets the data_store property to use redis (0), Default
is 0.
--mem Sets the data_store property to use memcache (1),
Default is 0.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

