seed

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

README

Seed node

If you're running in environments without ZeroConf/mDNS support (like docker, AWS, CGP or Azure) you can't rely on auto-discovery of the Serf nodes. The simplest solution is to create one or more seed nodes that exists solely to seed new members of the Serf cluster. From there on you can do discovery on Raft (aka "real cluster nodes"), associated services and so on. To make your configuration simpler you can use DNS for the seed nodes.

Since availability isn't a big issue - if a restart takes a few seconds it just means that new nodes won't be able to join the Serf cluster through the usual means; you can - in a pinch - use one of the other nodes to join the cluster.

This is a simple seed node that dumps the nodes and endpoints in the Serf cluster so it can be used as a diagnostic tool as well.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(config Parameters)

Run is a ready-to run (just call it from main()) implementation of a simple seed node.

Types

type Parameters added in v0.0.32

type Parameters struct {
	ClusterName      string   `kong:"help='Cluster name',default='clusterfunk'"`
	ZeroConf         bool     `kong:"help='ZeroConf lookups for cluster',default='true'"`
	NodeID           string   `kong:"help='Node ID for seed node',default=''"`
	SerfPort         int      `kong:"help='Port to use for Serf',default='0'"`
	SerfJoinAddress  []string `kong:"help='Join address for Serf', default=''"`
	LiveView         bool     `kong:"help='Display live view of nodes',default='false'"`
	ShowAllNodes     bool     `kong:"help='Show all nodes, not just nodes alive',default='false'"`
	SerfSnapshotPath string   `kong:"help='Serf snapshot path (for persistence)'"`
	HTTP             int      `kong:"help='Port for embedded web status page. 0 is disabled.',default='0'"`
	OpenHTTP         bool     `kong:"help='Open web browser on web page',default='false'"`
	DNS              int      `kong:"help='Port for embedded DNS server 0 is disabled',default='0'"`
}

Parameters holds the configuration for a seed node

Jump to

Keyboard shortcuts

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