Skip to content

Leader election tool based on etcd with local network check.

Notifications You must be signed in to change notification settings

osiriswd/election

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

GOLANG leader election tool based on etcd

Leader election tool with local network check.

Usage

go build -o election election.go

./election --help

Usage of ./election:

-e string

    etcd host:port (default "https://127.0.0.1:2379")

-h string

    hostname (default "host1")

-l string

    listen port (default "8000")

-s string

    service name (default "service")

./election -s "service name" -h "hostname" -e "192.168.1.10:2379,192.168.1.11:2379,192.168.1.12:2379," -l "8000"

#curl https://localhost:8000

#{"service":"service name","host":"hostname","status":1}

status = 1: leader

status = 0: follower

status = -1: disconnected from etcd cluster (or local network failure)

About

Leader election tool based on etcd with local network check.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages