bootstrap

package
v1.13.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 3 more Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func FinishBootstrapOrder

func FinishBootstrapOrder(tx store.Transaction) error

FinishBootstrapOrder 完成 提交锁

func RestartServers

func RestartServers(errCh chan error) error

RestartServers 重启server

func RunMainLoop

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

RunMainLoop 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, authMgn auth.AuthServer) error

StartConfigCenterComponents 启动配置中心模块

func StartDiscoverComponents

func StartDiscoverComponents(ctx context.Context, cfg *boot_config.Config, s store.Store,
	cacheMgn *cache.CacheManager, authMgn auth.AuthServer) 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

Types

type SelfHeathChecker

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

func NewSelfHeathChecker

func NewSelfHeathChecker(instances []*api.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