Giter Club home page Giter Club logo

cluster's Introduction

Create Clusters


  1. What is this?

    This project contains a library called "cluster.go" which is used to create n-number of servers and send message between them.

  2. Working

    This is a library is used - To create n-number of servers - To queue outgoing message in the outbox of each server - To queue incoming message in the inbox of each server - Send and receive messages between servers

  3. How to run?

     - go get github.com/onkarkore/cluster/
     - create config files for each server
     	python configcreator.py
     - go test github.com/onkarkore/cluster/
    
  4. Testing

     Set following variables in cluster_test.go 
     	MSG_TO_EACH_SERVER - Number of message send by each server to other peers 
     	env.RPid - If Broadcast set to -1 else set port number of receiver so that each server to to this server only
    
    
    
     Test file is used to check working of cluster library.In which, we call methods implemented 
     in cluster library.
     Following things are to be done for testing 
      - Create new socket for each server
      - Set all properties related to each server
      - Create a envelope(sending message) for each server
      - Send message between servers, count number of message sent
      - Receive message sent by other servers , count number of received message
      - Display number of sent and received message and verify that this count is same
    
  5. Configuration file (cluster.conf)

     This file contains list of all sever addresses.
     e.g. tcp://127.0.0.1:2001
          tcp://127.0.0.1:2002
    
  6. References

cluster's People

Contributors

onkarkore avatar

Watchers

 avatar

cluster's Issues

Review for assignment 2.

  1. Very nice job on the README. You seem to have formatted it as a text file, which is totally ok, but then call it
    README.txt. That way, Github doesn't get confused about reformatting it. A ".md" is a markdown file.

  2. Configuration: Short and sweet.

  3. The following code is much smaller in typical Go.

      for peers_count:=0;peers_count<len(peers);peers_count++{

    Instead:

      for i, peer := range peers {
  4. I have no doubt that you like cake and strawberry, but it'd better to make a variable name more informative :)

  5. You are not supposed to generate the MsgId. It is meant for the user of your library (raft or kvstore), to help it detect duplicates. The cluster is a postoffice, and is given an envelope to pass along to the destination server. Don't use the message id field as a unique stamp. (If you need that, have a different field).

  6. SendMsgToServers is creating and connecting to a new socket every single time it needs to send out a message. That's extremely wasteful. You should create the sockets just once.

  7. I don't understand why SendMessage is opening a socket to tcp://127.0.0.1. That is what the configuration file is for,no?

  8. Please format the code using "gofmt -w" and recheck it in .

  9. No automatic testing. You have merely imported the testing package, but not used the full facilities. It should verify that the number of expected messages tallies with the actual number. Currently you are printing out the numbers, and expect the tester to visually verify it. That's not good. Refer to the note on testing I have posted on Piazza.

  10. The test takes 10 seconds to send 90 messages on localhost when the network is not even involved. Don't you think it is a bit slow? :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.