topologyyaml

package
v0.0.0-...-1298597 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(topo *Topology) error

Types

type BESpec

type BESpec struct {
	ComponentSpec  `yaml:",inline"`
	BeConfig       BeConfig      `yaml:"-"`
	InstallJava    bool          `yaml:"install_java"`
	JavaPackageURL string        `yaml:"java_package_url"`
	JavaDigest     digest.Digest `yaml:"java_digest"`
	PackageURL     string        `yaml:"package_url"`
	Digest         digest.Digest `yaml:"digest"`
}

func (*BESpec) UnmarshalYAML

func (s *BESpec) UnmarshalYAML(value *yaml.Node) error

type BeConfig

type BeConfig struct {
	BePort               int    `ini:"be_port"`
	WebServerPort        int    `ini:"webserver_port"`
	HeartbeatServicePort int    `ini:"heartbeat_service_port"`
	StorageRootPath      string `ini:"storage_root_path"`
}

type BeInstance

type BeInstance struct {
	DeployUser string
	Topo       *Topology
	BESpec
}

func NewBeInstance

func NewBeInstance(topo *Topology, beSpec BESpec) BeInstance

func (BeInstance) ConfigDir

func (s BeInstance) ConfigDir() string

func (BeInstance) EnvironmentVars

func (s BeInstance) EnvironmentVars() map[string]string

func (BeInstance) PIDFile

func (s BeInstance) PIDFile() string

func (BeInstance) StartupScript

func (s BeInstance) StartupScript() string

func (BeInstance) StopScript

func (s BeInstance) StopScript() string

func (BeInstance) SystemdEnvironment

func (s BeInstance) SystemdEnvironment() string

func (BeInstance) SystemdServiceContent

func (s BeInstance) SystemdServiceContent() (string, error)

func (BeInstance) SystemdServiceName

func (s BeInstance) SystemdServiceName() string

func (BeInstance) SystemdServicePath

func (s BeInstance) SystemdServicePath() string

type BeStatus

type BeStatus struct {
	Host          string `db:"Host"`
	IP            string `db:"IP"` // doris v1.x use IP, v2.x use Host
	Alive         bool   `db:"Alive"`
	AvailCapacity string `db:"AvailCapacity"`
	TotalCapacity string `db:"TotalCapacity"`
	// UsedUsedPct is the percentage of used capacity
	UsedPct string `db:"UsedPct"`
	Version string `db:"Version"`
}

type ClusterStatus

type ClusterStatus struct {
	FeMasterHealthy bool
	Fes             []FeStatus
	Bes             []BeStatus
}

type ComponentSpec

type ComponentSpec struct {
	Host      string `yaml:"host"`
	SSHPort   int    `yaml:"ssh_port"`
	DeployDir string `yaml:"deploy_dir"`
	Config    string `yaml:"config"`
}

type ComponentType

type ComponentType string
const (
	FE  ComponentType = "fe"
	BE  ComponentType = "be"
	JDK ComponentType = "jdk"
)

type ExecOutput

type ExecOutput struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

type FESpec

type FESpec struct {
	ComponentSpec  `yaml:",inline"`
	FeConfig       FeConfig      `yaml:"-"`
	IsMaster       bool          `yaml:"is_master"`
	InstallJava    bool          `yaml:"install_java"`
	JavaPackageURL string        `yaml:"java_package_url"`
	JavaDigest     digest.Digest `yaml:"java_digest"`
	PackageURL     string        `yaml:"package_url"`
	Digest         digest.Digest `yaml:"digest"`
}

func (*FESpec) UnmarshalYAML

func (s *FESpec) UnmarshalYAML(value *yaml.Node) error

type FeConfig

type FeConfig struct {
	HTTPPort    int `ini:"http_port"`
	RPCPort     int `ini:"rpc_port"`
	QueryPort   int `ini:"query_port"`
	EditLogPort int `ini:"edit_log_port"`
}

type FeInstance

type FeInstance struct {
	DeployUser string
	Topo       *Topology
	FESpec
}

func NewFeInstance

func NewFeInstance(topo *Topology, feSpec FESpec) FeInstance

func (FeInstance) CheckClusterHealth

func (s FeInstance) CheckClusterHealth(ctx context.Context) (bool, error)

func (FeInstance) CheckHealth

func (s FeInstance) CheckHealth(ctx context.Context) (bool, error)

func (FeInstance) ConfigDir

func (s FeInstance) ConfigDir() string

func (FeInstance) EnvironmentVars

func (s FeInstance) EnvironmentVars() map[string]string

func (FeInstance) GetCluserStatus

func (s FeInstance) GetCluserStatus(ctx context.Context) (ClusterStatus, error)

nolint: gocyclo

func (FeInstance) GetDB

func (s FeInstance) GetDB(_ context.Context) (*sqlx.DB, error)

func (FeInstance) MasterHelper

func (s FeInstance) MasterHelper() string

MasterHelper returns master_fe:master_editlog_port(bdbje helper), used by fe startup script See: https://doris.apache.org/docs/dev/admin-manual/maint-monitor/metadata-operation/

func (FeInstance) PIDFile

func (s FeInstance) PIDFile() string

func (FeInstance) StartupScript

func (s FeInstance) StartupScript() string

func (FeInstance) StopScript

func (s FeInstance) StopScript() string

func (FeInstance) SystemdEnvironment

func (s FeInstance) SystemdEnvironment() string

func (FeInstance) SystemdServiceContent

func (s FeInstance) SystemdServiceContent() (string, error)

func (FeInstance) SystemdServiceName

func (s FeInstance) SystemdServiceName() string

func (FeInstance) SystemdServicePath

func (s FeInstance) SystemdServicePath() string

type FeStatus

type FeStatus struct {
	Host      string `db:"Host"`
	IP        string `db:"IP"` // doris v1.x use IP, v2.x use Host
	IsMaster  bool   `db:"IsMaster"`
	IsHelper  bool   `db:"IsHelper"` // starrocks use "IsHelper"
	QueryPort int    `db:"QueryPort"`
	Alive     bool   `db:"Alive"`
	Version   string `db:"Version"`
}

type GlobalSpec

type GlobalSpec struct {
	DeployUser        string `yaml:"deploy_user"`
	SSHPrivateKeyPath string `yaml:"ssh_private_key_path"`
	UseSystemd        *bool  `yaml:"use_systemd"`
}

type Instance

type Instance interface {
	EnvironmentVars() map[string]string
	PIDFile() string
	StartupScript() string
	StopScript() string
	SystemdEnvironment() string
	SystemdServiceContent() (string, error)
	SystemdServicePath() string
	SystemdServiceName() string
}

type ManualDeployInfo

type ManualDeployInfo struct {
	DeployUser string
	SSHPort    int
	SSHKeyPath string

	FeMaster    string
	FeHosts     []string
	BeHosts     []string
	FeDeployDir string
	BeDeployDir string
}

type Topology

type Topology struct {
	Global GlobalSpec `yaml:"global"`
	// TODO: maybe some common config for all fe/bes, to shorten the topology yaml
	FEs []FESpec `yaml:"fes"`
	BEs []BESpec `yaml:"bes"`
}

func BuildTopoFromManualDeploy

func BuildTopoFromManualDeploy(deployInfo ManualDeployInfo) *Topology

BuildTopoFromManualDeploy transform deploy information into (incomplete) Topology struct It then be used to complete and generate a topology yaml file

func Load

func Load(r io.Reader) (*Topology, error)

func LoadFromFile

func LoadFromFile(filename string) (*Topology, error)

func (*Topology) UseSystemd

func (t *Topology) UseSystemd() bool

Jump to

Keyboard shortcuts

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