bootstrap

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SelfServiceInstance = make([]*apiservice.Instance, 0)
	ConfigFilePath      = ""
)

Functions

func FinishBootstrapOrder

func FinishBootstrapOrder(tx store.Transaction) error

FinishBootstrapOrder 完成 提交锁

func RestartServers

func RestartServers(errCh chan error) error

RestartServers 重启server

func SelfDeregister

func SelfDeregister()

SelfDeregister Server退出的时候,自动反注册

func Start

func Start(configFilePath string)

Start 启动

func StartBootstrapInOrder

func StartBootstrapInOrder(s store.Store, c *boot_config.Config) (store.Transaction, error)

StartBootstrapInOrder 开始进入启动加锁 原因:Server启动的时候会从数据库拉取大量数据,防止同时启动把DB压死 还有一种场景,server全部宕机批量重启,导致数据库被压死,导致雪崩

func StartComponents

func StartComponents(ctx context.Context, cfg *boot_config.Config) error

StartComponents start health check and naming components

func StartConfigCenterComponents

func StartConfigCenterComponents(ctx context.Context, cfg *boot_config.Config, s store.Store,
	cacheMgn *cache.CacheManager, userMgn auth.UserServer, strategyMgn auth.StrategyServer) error

StartConfigCenterComponents 启动配置中心模块

func StartDiscoverComponents

func StartDiscoverComponents(ctx context.Context, cfg *boot_config.Config, s store.Store,
	cacheMgn *cache.CacheManager) error

func StartServers

func StartServers(ctx context.Context, cfg *boot_config.Config, errCh chan error) (
	[]apiserver.Apiserver, error)

StartServers 启动server

func StopServers

func StopServers(servers []apiserver.Apiserver)

StopServers 接受外部信号,停止server

func WaitSignal

func WaitSignal(servers []apiserver.Apiserver, errCh chan error)

WaitSignal 等待信号量或err chan 从而执行restart或平滑退出

Types

type SelfHeathChecker

type SelfHeathChecker struct {
	// contains filtered or unexported fields
}

func NewSelfHeathChecker

func NewSelfHeathChecker(instances []*apiservice.Instance, interval int) (*SelfHeathChecker, error)

func (*SelfHeathChecker) Start

func (s *SelfHeathChecker) Start()

func (*SelfHeathChecker) Stop

func (s *SelfHeathChecker) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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