dynomite icon indicating copy to clipboard operation
dynomite copied to clipboard

Dynomite Node Architecture

Open mfouilleul opened this issue 11 years ago • 7 comments

dynomite node

mfouilleul avatar Mar 03 '15 11:03 mfouilleul

@mfouilleul looks good :). Do you mind to add this diagram somewhere here for Redis' installation/setup: https://github.com/Netflix/dynomite/wiki/Getting+Started#setup-and-installation ? Thanks.

timiblossom avatar Mar 15 '15 06:03 timiblossom

This page could be improve yes. There are some 404 on configuration file examples. Do you think can I add my scripts to?

Florida - Get Seeds, HTTP service (Node.js):

var http = require('http');
var url = require('url');

var seeds_file_path_arg = process.argv.slice(2);

var seeds_file = require('fs');
var seeds_file_path = '/etc/dynomite/seeds.list';

if(typeof seeds_file_path_arg == 'undefined' || seeds_file_path_arg == null || seeds_file_path_arg  == ''){
  seeds_file_path = '/etc/dynomite/seeds.list';
} else{
  seeds_file_path = seeds_file_path_arg;
}

var server = http.createServer(function(req, res) {
  var path = url.parse(req.url).pathname;
  res.writeHead(200, {"Content-Type": "application/json"});
  if (path == '/REST/v1/admin/get_seeds') {
    data = seeds_file.readFileSync(seeds_file_path).toString();
    data_oneline = data.trim().replace(/\n/g, '|');
    var now = new Date();
    var jsonDate = now.toJSON();
    console.log(jsonDate + " - get_seeds [" + data_oneline + "]");
    res.write(data_oneline);
  }
  res.end();
});
server.listen(8080);

Test:

root@redis1:~# cat /etc/dynomite/seeds.list
192.168.33.41:8101:rc1:dc1:2147483647
192.168.33.42:8101:rc2:dc1:0
192.168.33.43:8101:rc2:dc1:2147483647

root@redis1:~# curl http://127.0.0.1:8080/REST/v1/admin/get_seeds
192.168.33.41:8101:rc1:dc1:2147483647|192.168.33.42:8101:rc2:dc1:0|192.168.33.43:8101:rc2:dc1:2147483

Choose tokens (Python):

#!/usr/bin/python
import os, sys

def usage():
  print "usage: python token.py <number of nodes>"
  sys.exit(1)

if len(sys.argv) != 2:
  print "error: Bad number of argument"
  usage()

try:
  nodes = int(sys.argv[1]);
except Exception:
  print "error: Bad type of argument"
  usage()

for i in range(0, nodes):
  t = i*(4294967295)/nodes
  print "Node " + str(i + 1) + ": " + str(t)

Test:

root@local:/opt/dynomite# python token.py 3
Node 1: 0
Node 2: 1431655765
Node 3: 2863311530

mfouilleul avatar Mar 15 '15 11:03 mfouilleul

yes, you can add these 2 scripts in the scripts directory and send us a pull request. Thanks

timiblossom avatar Mar 19 '15 14:03 timiblossom

This is a wonderful image. It helped me understand a lot. It clarified what the difference between which port was gossip and redis client. It should be added as this is useful.

redboy1972 avatar Apr 23 '15 17:04 redboy1972

Thanks @redboy1972

mfouilleul avatar Apr 24 '15 13:04 mfouilleul

@mfouilleul any plan to work on this, or our recent presentations and related images cover it. Shall we close this issue?

ipapapa avatar Jul 13 '16 20:07 ipapapa

@mfouilleul we have done some effort to create this diagram in some of our recent presentations (I have added the Youtube links on the Wiki). Hence, we're marking this question as Resolved. If you want to follow up with further questions let us know and we can either reopen the issue, or please create a new issue.

ipapapa avatar Aug 29 '16 17:08 ipapapa