simple

command
v0.0.0-...-9128579 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 12 Imported by: 0

README

Simple

This example creates a member per process, where each member joins the cluster, periodically updates its local state with random entries, and logs the received updates.

Running

Create a member per process with flags:

  • -addr: Address to listen on
  • -join: Addresses of existing members to join

Such as to create a three node cluster:

go run examples/simple/main.go -addr :7000
go run examples/simple/main.go -addr :7001 -join localhost:7000
go run examples/simple/main.go -addr :7002 -join localhost:7000

Each member will gracefully leave the cluster on SIGINT or SIGTERM signals. You can also forcefully terminate a node with SIGKILL which won't leave gracefully but exits immediately so the other nodes will detect it as failed.

To expose Prometheus metrics, configure the metrics server address with -metrics-addr. This will expose the Prometheus metrics at http://{addr}/metrics.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL