Code Monkey home page Code Monkey logo

node-cluster's Introduction

Node Cluster

Note the TTL for multicast network is set to '1'.

How it works

  1. Node start and send multicast hello sync message
  2. The receiving nodes adds the new node to it's view
  3. Hello ACK is received by the node and adds the responding node to it's view

Build App

Use maven to build the application

mvn package

Usage

usage: Main
 -c,--cluster-addr <arg>      Cluster addres used for cluster commuication
                              - default 192.168.81.1
 -cp,--cluster-port <arg>     Cluster port used for cluster communication
                              - default 5050
 -h,--help <arg>              Help
 -m,--multicast-addr <arg>    Multicast address used for auto discovery -
                              default 225.254.254.5
 -mp,--multicast-port <arg>   Multicast port used for auto discovery -
                              default 5000
 -n,--numNodes <arg>          Number of nodes in the cluster

Example to run the application

Execute the JAR file created from the maven build.

java -jar target/node-1.0.jar -n 6 -cp 5052

When the application is started you will see the following output message:

java -jar target/node-1.0.jar -n 6 -cp 5050
Node Server listening on 192.168.81.1:5050
Waiting for connections ...
[NODE READY]Local Node UUID:18a0a894-fa43-422c-8ab1-1b818bc2b9ef

node-cluster's People

Contributors

aaronj314 avatar

Stargazers

Hazelcast Community Projects Collection avatar

Watchers

James Cloos avatar  avatar

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.