Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A primitive loadbalancer written in Java. I supports docker containers for scalability.

License

NotificationsYou must be signed in to change notification settings

jadia/loadBalancer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A mini project made to implement concepts of client server architecture.The distribution of load takes place based on the CPU usage of each worker nodes.The client sends a number to the server and it receives the prime number which are smaller that the provided number.Ex:Input: 100Output: 97

Input: 6Output: 5

Client

Client will request use for server's IP and connect to the server on port 7777.After that the server can proceed to provide inputs. Typedone when user is willing to quit the application.

Server

Server listens at port 2222 for the worker nodes to connect. Large number of worker nodes are supported at anytime, which makes this project highly scalable.Server also listens on port 7777 for client requests. docker-compose will bind the localhost:7777 to server's 7777 port. Server needs no input from the user.

Worker

The worker node requests a connection from server at port 2222 and it's always listening on port 5555.Following which server establishes a TCP connection to the workers on port 5555. Worker nodes need no input from the user.

Installation

It requiresjava,docker anddocker-compose to work.Please follow the installation process from the official documentation of all the dependencies.

UseDockerfile in server and farm to build an image.

cd loadBalancerdocker build -t"loadbalancer/server" Server

Build Worker image:

docker build -t"loadbalancer/worker" Worker

How to use

Once images are created we will use docker-compose to turn up the server and the worker nodes

docker-compose up

Now we can use client to connect to the server

cd loadBalancer/Client/javac ClientMain.javajava ClientMain

Provide localhost as the server IP if containers are also running on the same machine.If you are remotely connecting to the server then provide the IP of host which is running the server-worker containers.

Inputdone when you want to quit.

ToDo:

  1. Fix the server crash when clients exit.
  2. Support to very large number inputs.

About

A primitive loadbalancer written in Java. I supports docker containers for scalability.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp