Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knz/gossiper
Simple distributed server with liveness gossip
https://github.com/knz/gossiper
Last synced: 26 days ago
JSON representation
Simple distributed server with liveness gossip
- Host: GitHub
- URL: https://github.com/knz/gossiper
- Owner: knz
- License: apache-2.0
- Created: 2020-02-02T22:52:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-03T00:24:41.000Z (almost 5 years ago)
- Last Synced: 2024-06-20T10:21:34.443Z (5 months ago)
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gossiper - a simple distributed server with gossip liveness
`gossiper` runs one node for a distributed liveness store.
The liveness store maintains (using a gossip protocol) its list of
participants and for each participant a last heartbeat timestamp.## Starting a node
The following command-line parameters are recognized:
- `-id`: node ID. If not specified, a random ID is used. This is useful
to simulate the same node going off and on again.
- `-port`: port number to listen on for HTTP. Default 8080.
- `-advertise`: public hostname to advertise to peers. Defaults to
`os.Hostname()`. Should be customized when running on multiple IP
nodes.
- `-join`: one or more comma-separate addr:port pairs of other nodes
to join. May be empty to indicate to simply wait for other peers to
join this node.## API Server
Each node offers the following API over HTTP:
- `/` (browser index page): a HTML page reporting the current
database.- `/bye?id=NNN` mark node NNN as decommissioned. If the node
is still running, it will terminate when it learns of its status.- `/hello`: The liveness endpoint. This is
used in the peer-to-peer gossip protocol but can also serve
interactive demos using `curl` in the terminal.Example output:
```
hello 4399d1f6
abc 4399d1f6
cde xxqqqw
host1:8080
host2:8081
```The first line in the response is always `hello ` followed by the
peer's node ID.The second line is the list of known non-decommissioned peer IDs
throughout the cluster.The third line is the list of decommissioned peer IDs throughout the
cluster.All the lines after that are the other peer addresses known to this
peer.