Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

A simple distributed system java based application

NotificationsYou must be signed in to change notification settings

stevenheroo/leaderelection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple distributed systems logic JAVA

Tools

1. Maven2. Zookeeper3. Java

Setup Apache Zookeeper

#you need JDK 1.8 or later installed on machine first ..

Step

  1. follow linkhttps://zookeeper.apache.org/releases.html to download
  2. unzip or unrar, paste in a preferred location
  3. locate conf folder & change zoo_sample.cfg file to -> zoo.cfg
  4. open terminal >>> in bin location and run ./zkService start(logs folder will be created automatically in zookeeper folder)
  5. update dataDir in zoo.cfg file ->>>> eg.(mine) dataDir=home/***/zookeeper/logs

--bin dir <> contains CL tools for zookeeper

Demo includes

  1. create a child nodes to join cluster
  2. using Zookeeper to simplify selection a leader in a cluster( zookeeper algorithm makes it simple to elect a node)
  3. using watchers to trigger alerts on failure of a node , i.e= stopped, deleted, noResponse, etc1. Fault-tolerant implementation
  4. re-election a node to become a leader,1. adding nodes dynamically2. prevent hard effect elimination of node with no bottlenecks
  5. Implementation of Service Registry & service discovery
  6. Add callback to leader election in cluster
  7. Build & Implement multithreaded http server with standard java libraries1. the server will have two endpoints2. /status - handles GET requests(Reports the health of the application)3. /task - handles POST requests(sends results)
  8. creating custom headers
  9. Testing Http server created(Use cURL to test the endpoints)1. eg. curl --request GET -v localhost:8080/status - to get status of server2. eg. curl --request POST -v --data "xxx" localhost:8080/task - to post data to server

About

A simple distributed system java based application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp