Documentation ¶
Index ¶
- Variables
- func FinishBootstrapOrder(tx store.Transaction) error
- func RestartServers(errCh chan error) error
- func SelfDeregister()
- func Start(configFilePath string)
- func StartBootstrapInOrder(s store.Store, c *boot_config.Config) (store.Transaction, error)
- func StartComponents(ctx context.Context, cfg *boot_config.Config) error
- func StartConfigCenterComponents(ctx context.Context, cfg *boot_config.Config, s store.Store, ...) error
- func StartDiscoverComponents(ctx context.Context, cfg *boot_config.Config, s store.Store, ...) error
- func StartServers(ctx context.Context, cfg *boot_config.Config, errCh chan error) ([]apiserver.Apiserver, error)
- func StopServers(servers []apiserver.Apiserver)
- func WaitSignal(servers []apiserver.Apiserver, errCh chan error)
- type SelfHeathChecker
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 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 WaitSignal ¶
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()
Click to show internal directories.
Click to hide internal directories.