Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveRemoteNodes ¶ added in v1.25.15
func ResolveRemoteNodes(addrResolver resolver.ClusterStateReader, serverPortMap map[string]int) map[string]string
ResolveRemoteNodes returns a list of remoteNodes addresses resolved using addrResolver. The nodes id used are taken from serverPortMap keys and ports from the values. Additionally, it includes nodes discovered via memberlist to handle cases where the join config is incomplete.
Types ¶
type Bootstrapper ¶
type Bootstrapper struct {
// contains filtered or unexported fields
}
Bootstrapper is used to bootstrap this node by attempting to join it to a RAFT cluster.
func NewBootstrapper ¶
func NewBootstrapper(peerJoiner PeerJoiner, raftID string, raftAddr string, voter bool, r resolver.ClusterStateReader, isStoreReady func() bool) *Bootstrapper
NewBootstrapper constructs a new bootsrapper
type Joiner ¶ added in v1.25.15
type Joiner struct {
// contains filtered or unexported fields
}
func NewJoiner ¶ added in v1.25.15
func NewJoiner(peerJoiner PeerJoiner, localNodeID string, localRaftAddr string, voter bool) *Joiner
NewJoiner returns a *Joiner configured with localNodeID, localRaftAddr and voter.
func (*Joiner) Do ¶ added in v1.25.15
func (j *Joiner) Do(ctx context.Context, lg *logrus.Logger, remoteNodes map[string]string) (string, error)
Do will attempt to send to any nodes in remoteNodes a JoinPeerRequest for j.localNodeID with the address j.localRaftAddr. Will join as voter if j.voter is true, non voter otherwise. Returns the leader address if a cluster was joined or an error otherwise.
type PeerJoiner ¶ added in v1.25.15
type PeerJoiner interface {
Join(_ context.Context, leaderAddr string, _ *cmd.JoinPeerRequest) (*cmd.JoinPeerResponse, error)
Notify(_ context.Context, leaderAddr string, _ *cmd.NotifyPeerRequest) (*cmd.NotifyPeerResponse, error)
}
PeerJoiner is the interface we expect to be able to talk to the other peers to either Join or Notify them