majorupgradechecklist

package
v0.0.0-...-43a96cf Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_OPEN_FILE_DEFAULT  = "65535"
	MAX_LOCKED_MEM_DEFAULT = "unlimited"
	MAX_OPEN_FILE_KEY      = "Max open files"
	MAX_LOCKED_MEM_KEY     = "Max locked memory"

	INDICES_TOTAL_SHARD_DEFAULT         = 2000
	INDICES_BREAKER_TOTAL_LIMIT_DEFAULT = "95"

	INDICES_TOTAL_SHARD_INCREMENT_DEFAULT = 500

	MAX_POSSIBLE_HEAP_SIZE = 32

	V3ESSettingFile               = "/hab/svc/deployment-service/old_es_v3_settings.json"
	AutomateOpensearchConfigPatch = "/hab/svc/deployment-service/oss-config.toml"
)
View Source
const (
	MIN_DIRSIZE_GB float64 = 5

	DISKSPACE_CHECK_ERROR = `` /* 187-byte string literal not displayed */

	HAB_DIR                  = "/hab"
	HAB_5GB_FREE_SPACE_ERROR = "\n  - /hab/ directory should have more than 5GB free space"
	DIR_FREE_SPACE_ERROR     = "\n  - %s directory should have more than %.2fGB free space"
	DEST_FLAG_INFO           = "" /* 129-byte string literal not displayed */
)
View Source
const (
	FILE_NAME = "upgrade_metadata.json"
)
View Source
const (
	POST_UPGRADE_HEADER = `
Post Upgrade Steps:
===================
`
)

Variables

This section is empty.

Functions

func CheckSpaceAvailable

func CheckSpaceAvailable(isMigration bool, dbDataPath string, version string, skipStorageCheck bool, osDestDataDir string) (bool, error)

func CreateJsonFile

func CreateJsonFile(params *PostChecklist, path string) error

func GetMajorVersion

func GetMajorVersion(version string) (string, bool)

func IsExternalElasticSearch

func IsExternalElasticSearch() bool

func IsExternalPG

func IsExternalPG() bool

func PatchBestOpenSearchSettings

func PatchBestOpenSearchSettings(writer cli.FormatWriter, isEmbedded bool) error

func SetSeenTrueForExternal

func SetSeenTrueForExternal() error

Types

type Checklist

type Checklist struct {
	Name        string
	Description string
	TestFunc    func(ChecklistHelper) error
}

type ChecklistHelper

type ChecklistHelper struct {
	Writer cli.FormatWriter
}

type ChecklistManager

type ChecklistManager interface {
	RunChecklist(int64, ChecklistUpgradeFlags) error
	GetPostChecklist() []PostCheckListItem
}

func NewChecklistManager

func NewChecklistManager(writer cli.FormatWriter, version string) (ChecklistManager, error)

type ChecklistUpgradeFlags

type ChecklistUpgradeFlags struct {
	SkipStorageCheck bool
	OsDestDataDir    string
}

type ESSettings

type ESSettings struct {
	TotalShardSettings       int64  `json:"totalShardSettings" toml:"totalShardSettings"`
	IndicesBreakerTotalLimit string `json:"indicesBreakerTotalLimit" toml:"indicesBreakerTotalLimit"`
	RuntimeMaxOpenFile       string `json:"runtimeMaxOpenFile" toml:"runtimeMaxOpenFile"`
	RuntimeMaxLockedMem      string `json:"runtimeMaxLockedMem" toml:"runtimeMaxLockedMem"`
	HeapMemory               string `json:"heapMemory" toml:"heapMemory"`
}

func GetBestSettings

func GetBestSettings(writer cli.FormatWriter) *ESSettings

func GetDefaultOSSettings

func GetDefaultOSSettings() *ESSettings

func GetESSettings

func GetESSettings(writer cli.FormatWriter) (*ESSettings, error)

type IndexInfo

type IndexInfo struct {
	Settings struct {
		Index struct {
			Version struct {
				CreatedString string `json:"created_string"`
				Created       string `json:"created"`
			} `json:"version"`
		} `json:"index"`
	} `json:"settings"`
}

type IndicesShardTotal

type IndicesShardTotal struct {
	Indices struct {
		Shards struct {
			Total int64 `json:"total"`
		} `json:"shards"`
	} `json:"indices"`
}

type IndicesTotalLimit

type IndicesTotalLimit struct {
	Defaults struct {
		ClusterMaxShardsPerNode  string `json:"cluster.max_shards_per_node"`
		IndicesBreakerTotalLimit string `json:"indices.breaker.total.limit"`
	} `json:"defaults"`
}

type PostCheckListItem

type PostCheckListItem struct {
	Id         string `json:"id"`
	Msg        string `json:"msg"`
	Cmd        string `json:"cmd"`
	Optional   bool   `json:"optional"`
	IsExecuted bool   `json:"is_executed"`
}

type PostChecklist

type PostChecklist struct {
	Version       string              `json:"version"`
	PostChecklist []PostCheckListItem `json:"post_checklist"`
	Seen          bool                `json:"seen"`
}

func ReadJsonFile

func ReadJsonFile(path string) (*PostChecklist, error)

type PostChecklistManager

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

func NewPostChecklistManager

func NewPostChecklistManager(version string) (*PostChecklistManager, error)

func (*PostChecklistManager) CreatePostChecklistFile

func (pcm *PostChecklistManager) CreatePostChecklistFile(path string) error

func (*PostChecklistManager) ReadPendingPostChecklistFile

func (pcm *PostChecklistManager) ReadPendingPostChecklistFile(path string) ([]string, error)

func (*PostChecklistManager) ReadPostChecklistById

func (pcm *PostChecklistManager) ReadPostChecklistById(id string, path string) (bool, error)

func (*PostChecklistManager) UpdatePostChecklistFile

func (pcm *PostChecklistManager) UpdatePostChecklistFile(id string, path string) error

type V3ChecklistManager

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

func NewV3ChecklistManager

func NewV3ChecklistManager(writer cli.FormatWriter, version string) *V3ChecklistManager

func (*V3ChecklistManager) GetPostChecklist

func (ci *V3ChecklistManager) GetPostChecklist() []PostCheckListItem

func (*V3ChecklistManager) RunChecklist

func (ci *V3ChecklistManager) RunChecklist(timeout int64, flags ChecklistUpgradeFlags) error

type V4ChecklistManager

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

func NewV4ChecklistManager

func NewV4ChecklistManager(writer cli.FormatWriter, version string) *V4ChecklistManager

func (*V4ChecklistManager) GetPostChecklist

func (ci *V4ChecklistManager) GetPostChecklist() []PostCheckListItem

func (*V4ChecklistManager) RunChecklist

func (ci *V4ChecklistManager) RunChecklist(timeout int64, flags ChecklistUpgradeFlags) error

Jump to

Keyboard shortcuts

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