configure

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KEY_KIND                     = "kind"
	KEY_CONTAINER_IMAGE          = "container_image"
	KEY_LOG_DIR                  = "log_dir"
	KEY_DATA_DIR                 = "data_dir"
	KEY_CORE_DIR                 = "core_dir"
	KEY_CURVEBS_LISTEN_MDS_ADDRS = "mds.listen.addr"
	KEY_CURVEFS_LISTEN_MDS_ADDRS = "mdsOpt.rpcRetryOpt.addrs"
	KEY_CONTAINER_PID            = "container_pid"
	KEY_ENVIRONMENT              = "env"

	KEY_CLIENT_S3_ACCESS_KEY  = "s3.ak"
	KEY_CLIENT_S3_SECRET_KEY  = "s3.sk"
	KEY_CLIENT_S3_ADDRESS     = "s3.endpoint"
	KEY_CLIENT_S3_BUCKET_NAME = "s3.bucket_name"

	DEFAULT_CORE_LOCATE_DIR = "/core"
)
View Source
const (
	DEFAULT_CURVEBS_CLIENT_CONTAINER_IMAGE = "opencurvedocker/curvebs:v1.2"
	DEFAULT_CURVEFS_CLIENT_CONTAINER_IMAGE = "opencurvedocker/curvefs:latest"
)
View Source
const (
	PATH_FSTAB = "/etc/fstab"

	FORMAT_PATH_DEVICE_SCHEDULER  = "/sys/block/%s/queue/scheduler"
	FORMAT_PATH_DEVICE_ROTATIONAL = "/sys/block/%s/queue/rotational"
)
View Source
const (
	DEFAULT_CURVEBS_CONTAINER_IMAGE = "opencurvedocker/curvebs-playground:v1.2"
	DEFAULT_CURVEFS_CONTAINER_IMAGE = "opencurvedocker/curvefs-playground:v2.3"
)
View Source
const (
	KIND_CURVEBS     = topology.KIND_CURVEBS
	KIND_CURVEFS     = topology.KIND_CURVEFS
	ROLE_CHUNKSERVER = topology.ROLE_CHUNKSERVER
	ROLE_METASERVER  = topology.ROLE_METASERVER

	DEFAULT_REPLICAS_PER_COPYSET = 3
	DEFAULT_ZONES_PER_POOL       = 3
	DEFAULT_TYPE                 = 0
	DEFAULT_SCATTER_WIDTH        = 0
)
View Source
const (
	DEFAULT_CONTAINER_IMAGE = "opencurvedocker/curvebs:v1.2"
)

Variables

View Source
var (
	LAYOUT_CURVEBS_ROOT_DIR = topology.GetCurveBSProjectLayout().ProjectRootDir
	LAYOUT_CURVEFS_ROOT_DIR = topology.GetCurveFSProjectLayout().ProjectRootDir
)

Functions

func GetBSProjectRoot

func GetBSProjectRoot() string

func GetDeviceRotationalPath

func GetDeviceRotationalPath(device string) string

func GetDeviceShedulerPath

func GetDeviceShedulerPath(device string) string

func GetFSClientConfPath

func GetFSClientConfPath() string

func GetFSClientMountPath

func GetFSClientMountPath(subPath string) string

func GetFSClientPrefix

func GetFSClientPrefix() string

func GetFSProjectRoot

func GetFSProjectRoot() string

wrapper interface: curvefs client related

func GetFSTabPath

func GetFSTabPath() string

func MigrateClusterServer

func MigrateClusterServer(old *CurveClusterTopo, migrates []*MigrateServer)

func ScaleOutClusterPool

func ScaleOutClusterPool(old *CurveClusterTopo, dcs []*topology.DeployConfig)

func SortDeployConfigs

func SortDeployConfigs(dcs []*topology.DeployConfig)

we should sort the "dcs" for generate correct zone number

Types

type Client

type Client struct {
	Config map[string]interface{}
}

type ClientConfig

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

func NewClientConfig

func NewClientConfig(config map[string]interface{}) (*ClientConfig, error)

func ParseClientCfg added in v0.2.0

func ParseClientCfg(data string) (*ClientConfig, error)

func ParseClientConfig

func ParseClientConfig(filename string) (*ClientConfig, error)

func (*ClientConfig) GetClusterMDSAddr

func (cc *ClientConfig) GetClusterMDSAddr() string

func (*ClientConfig) GetContainerImage

func (cc *ClientConfig) GetContainerImage() string

func (*ClientConfig) GetContainerPid

func (cc *ClientConfig) GetContainerPid() string

func (*ClientConfig) GetCoreDir

func (cc *ClientConfig) GetCoreDir() string

func (*ClientConfig) GetCoreLocateDir

func (cc *ClientConfig) GetCoreLocateDir() string

func (*ClientConfig) GetDataDir

func (cc *ClientConfig) GetDataDir() string

func (*ClientConfig) GetEnvironments added in v0.2.0

func (cc *ClientConfig) GetEnvironments() string

func (*ClientConfig) GetKind

func (cc *ClientConfig) GetKind() string

func (*ClientConfig) GetLogDir

func (cc *ClientConfig) GetLogDir() string

func (*ClientConfig) GetS3AccessKey

func (cc *ClientConfig) GetS3AccessKey() string

func (*ClientConfig) GetS3Address

func (cc *ClientConfig) GetS3Address() string

func (*ClientConfig) GetS3BucketName

func (cc *ClientConfig) GetS3BucketName() string

func (*ClientConfig) GetS3SecretKey

func (cc *ClientConfig) GetS3SecretKey() string

func (*ClientConfig) GetServiceConfig

func (cc *ClientConfig) GetServiceConfig() map[string]string

func (*ClientConfig) GetVariables

func (cc *ClientConfig) GetVariables() *variable.Variables

type CurveClusterTopo

type CurveClusterTopo struct {
	Servers      []Server      `json:"servers"`
	LogicalPools []LogicalPool `json:"logicalpools,omitempty"` // curvebs
	Pools        []LogicalPool `json:"pools,omitempty"`        // curvefs
	NPools       int           `json:"npools"`
}

func GenerateDefaultClusterPool

func GenerateDefaultClusterPool(dcs []*topology.DeployConfig) (topo CurveClusterTopo, err error)

type Format

type Format struct {
	ContainerImage string   `mapstructure:"container_image"`
	Hosts          []string `mapstructure:"host"`
	Disks          []string `mapstructure:"disk"`
}

* host: * - machine1 * - machine2 * - machine3 * disk: * - /dev/sda:/data/chunkserver0:10 # device:mount_path:format_percent * - /dev/sdb:/data/chunkserver1:10 * - /dev/sdc:/data/chunkserver2:10

type FormatConfig

type FormatConfig struct {
	ContainerIamge string
	Host           string
	Device         string
	MountPoint     string
	FormtPercent   int
}

* host: * - machine1 * - machine2 * - machine3 * disk: * - /dev/sda:/data/chunkserver0:10 # device:mount_path:format_percent * - /dev/sdb:/data/chunkserver1:10 * - /dev/sdc:/data/chunkserver2:10

func ParseFormat

func ParseFormat(filename string) ([]*FormatConfig, error)

func (*FormatConfig) GetContainerImage

func (fc *FormatConfig) GetContainerImage() string

func (*FormatConfig) GetDevice

func (fc *FormatConfig) GetDevice() string

func (*FormatConfig) GetFormatPercent

func (fc *FormatConfig) GetFormatPercent() int

func (*FormatConfig) GetHost

func (fc *FormatConfig) GetHost() string

func (*FormatConfig) GetMountPoint

func (fc *FormatConfig) GetMountPoint() string

type LogicalPool

type LogicalPool struct {
	Name         string `json:"name"`
	Replicas     int    `json:"replicasnum"`
	Zones        int    `json:"zonenum"`
	Copysets     int    `json:"copysetnum"`
	Type         int    `json:"type"`         // curvebs
	ScatterWidth int    `json:"scatterwidth"` // curvebs
	PhysicalPool string `json:"physicalpool"` // curvebs
}

type MigrateServer

type MigrateServer struct {
	From *topology.DeployConfig
	To   *topology.DeployConfig
}

type PlaygroundConfig

type PlaygroundConfig struct {
	Kind           string
	Name           string
	ContainerImage string
	Mountpoint     string

	DeployConfigs []*topology.DeployConfig
	ClientConfig  *ClientConfig
}

func (*PlaygroundConfig) GetClientConfig added in v0.2.0

func (cfg *PlaygroundConfig) GetClientConfig() *ClientConfig

func (*PlaygroundConfig) GetContainIamge

func (cfg *PlaygroundConfig) GetContainIamge() string

func (*PlaygroundConfig) GetDeployConfigs added in v0.2.0

func (cfg *PlaygroundConfig) GetDeployConfigs() []*topology.DeployConfig

func (*PlaygroundConfig) GetKind

func (cfg *PlaygroundConfig) GetKind() string

func (*PlaygroundConfig) GetMointpoint

func (cfg *PlaygroundConfig) GetMointpoint() string

func (*PlaygroundConfig) GetName

func (cfg *PlaygroundConfig) GetName() string

type Server

type Server struct {
	Name         string `json:"name"`
	InternalIp   string `json:"internalip"`
	InternalPort int    `json:"internalport"`
	ExternalIp   string `json:"externalip"`
	ExternalPort int    `json:"externalport"`
	Zone         string `json:"zone"`
	PhysicalPool string `json:"physicalpool,omitempty"` // curvebs
	Pool         string `json:"pool,omitempty"`         // curvefs
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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