Sign inSign up

xinix00/easyraft

By xinix00

•Updated 8 months ago

Image
0

323

xinix00/easyraft repository overview

⁠easyraft

Simple Raft-like leader election via HTTP.

⁠Features

  • Deterministic leader election (lowest URL wins)
  • Lease-based leader claims for multiple clusters
  • HTTP API for vote requests and heartbeats

⁠Usage

./election -config config.yaml

⁠Configuration

self: "http://node1:8080"
peers:
  - "http://node1:8080"
  - "http://node2:8080"
  - "http://node3:8080"
api_key: "secret"
port: 8080
heartbeat_interval_ms: 3000
election_timeout_ms: 10000

⁠How it works

  1. Node with lowest URL becomes leader candidate
  2. Candidate requests votes from peers
  3. Majority vote required to become leader
  4. Leader sends heartbeats to maintain leadership
  5. If heartbeat times out, new election starts

Tag summary

Content type

Image

Digest

sha256:2be7c9d2c…

Size

8.1 MB

Last updated

8 months ago

docker pull xinix00/easyraft