Documentation
¶
Index ¶
- Constants
- Variables
- func GetBSProjectRoot() string
- func GetDeviceRotationalPath(device string) string
- func GetDeviceShedulerPath(device string) string
- func GetFSClientConfPath() string
- func GetFSClientMountPath(subPath string) string
- func GetFSClientPrefix() string
- func GetFSProjectRoot() string
- func GetFSTabPath() string
- func MigrateClusterServer(old *CurveClusterTopo, migrates []*MigrateServer)
- func ScaleOutClusterPool(old *CurveClusterTopo, dcs []*topology.DeployConfig, poolset Poolset)
- func SortDeployConfigs(dcs []*topology.DeployConfig)
- type Client
- type ClientConfig
- func (cc *ClientConfig) GetClusterMDSAddr() string
- func (cc *ClientConfig) GetContainerImage() string
- func (cc *ClientConfig) GetContainerPid() string
- func (cc *ClientConfig) GetCoreDir() string
- func (cc *ClientConfig) GetCoreLocateDir() string
- func (cc *ClientConfig) GetData() string
- func (cc *ClientConfig) GetDataDir() string
- func (cc *ClientConfig) GetEnvironments() string
- func (cc *ClientConfig) GetKind() string
- func (cc *ClientConfig) GetLogDir() string
- func (cc *ClientConfig) GetS3AccessKey() string
- func (cc *ClientConfig) GetS3Address() string
- func (cc *ClientConfig) GetS3BucketName() string
- func (cc *ClientConfig) GetS3SecretKey() string
- func (cc *ClientConfig) GetServiceConfig() map[string]string
- func (cc *ClientConfig) GetVariables() *variable.Variables
- type CurveClusterTopo
- type FilterMonitorOption
- type Format
- type FormatConfig
- func (fc *FormatConfig) GetBlockSize() int
- func (fc *FormatConfig) GetChunkSize() int
- func (fc *FormatConfig) GetContainerImage() string
- func (fc *FormatConfig) GetDevice() string
- func (fc *FormatConfig) GetFormatPercent() int
- func (fc *FormatConfig) GetHost() string
- func (fc *FormatConfig) GetMountPoint() string
- type LogicalPool
- type MigrateServer
- type MonitorConfig
- func (m *MonitorConfig) GetDataDir() string
- func (m *MonitorConfig) GetGrafanaPassword() string
- func (m *MonitorConfig) GetGrafanaUser() string
- func (m *MonitorConfig) GetHost() string
- func (m *MonitorConfig) GetId() string
- func (m *MonitorConfig) GetImage() string
- func (m *MonitorConfig) GetKind() string
- func (m *MonitorConfig) GetListenPort() int
- func (m *MonitorConfig) GetLogDir() string
- func (m *MonitorConfig) GetNodeIps() []string
- func (m *MonitorConfig) GetNodeListenPort() int
- func (m *MonitorConfig) GetPrometheusIp() string
- func (m *MonitorConfig) GetPrometheusListenPort() int
- func (m *MonitorConfig) GetPrometheusRetentionSize() string
- func (m *MonitorConfig) GetPrometheusRetentionTime() string
- func (m *MonitorConfig) GetPrometheusTarget() string
- func (m *MonitorConfig) GetRole() string
- type PlaygroundConfig
- func (cfg *PlaygroundConfig) GetClientConfig() *ClientConfig
- func (cfg *PlaygroundConfig) GetContainIamge() string
- func (cfg *PlaygroundConfig) GetDeployConfigs() []*topology.DeployConfig
- func (cfg *PlaygroundConfig) GetKind() string
- func (cfg *PlaygroundConfig) GetMointpoint() string
- func (cfg *PlaygroundConfig) GetName() string
- type Poolset
- type Server
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 ( DEFAULT_CONTAINER_IMAGE = "opencurvedocker/curvebs:v1.2" DEFAULT_BLOCK_SIZE = 4096 DEFAULT_CHUNK_SIZE = 16 * 1024 * 1024 )
View Source
const ( ROLE_NODE_EXPORTER = "node_exporter" ROLE_PROMETHEUS = "prometheus" ROLE_GRAFANA = "grafana" ROLE_MONITOR_CONF = "monitor_conf" KEY_HOST = "host" KEY_LISTEN_PORT = "listen_port" KEY_RETENTION_TIME = "retention.time" KEY_RETENTION_SIZE = "retention.size" KEY_PROMETHEUS_TARGET = "target" KEY_GRAFANA_USER = "username" KEY_GRAFANA_PASSWORD = "password" KEY_NODE_IPS = "node_ips" KRY_NODE_LISTEN_PORT = "node_listen_port" KEY_PROMETHEUS_IP = "prometheus_listen_ip" KEY_PROMETHEUS_PORT = "prometheus_listen_port" )
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 )
Variables ¶
View Source
var ( LAYOUT_CURVEBS_ROOT_DIR = topology.GetCurveBSProjectLayout().ProjectRootDir LAYOUT_CURVEFS_ROOT_DIR = topology.GetCurveFSProjectLayout().ProjectRootDir )
View Source
var (
VALID_BLOCK_SIZE = [2]int{512, 4096}
)
Functions ¶
func GetBSProjectRoot ¶
func GetBSProjectRoot() string
func GetDeviceRotationalPath ¶
func GetDeviceShedulerPath ¶
func GetFSClientConfPath ¶
func GetFSClientConfPath() string
func GetFSClientMountPath ¶
func GetFSClientPrefix ¶
func GetFSClientPrefix() string
func GetFSTabPath ¶
func GetFSTabPath() string
func MigrateClusterServer ¶
func MigrateClusterServer(old *CurveClusterTopo, migrates []*MigrateServer)
func ScaleOutClusterPool ¶
func ScaleOutClusterPool(old *CurveClusterTopo, dcs []*topology.DeployConfig, poolset Poolset)
func SortDeployConfigs ¶
func SortDeployConfigs(dcs []*topology.DeployConfig)
we should sort the "dcs" for generate correct zone number
Types ¶
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) GetData ¶ added in v0.3.0
func (cc *ClientConfig) GetData() 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"` Poolsets []Poolset `json:"poolsets"` // curvebs LogicalPools []LogicalPool `json:"logicalpools,omitempty"` // curvebs Pools []LogicalPool `json:"pools,omitempty"` // curvefs NPools int `json:"npools"` }
func GenerateDefaultClusterPool ¶
func GenerateDefaultClusterPool(dcs []*topology.DeployConfig, poolset Poolset) (topo CurveClusterTopo, err error)
type FilterMonitorOption ¶ added in v0.3.0
type Format ¶
type Format struct { ContainerImage string `mapstructure:"container_image"` Hosts []string `mapstructure:"host"` Disks []string `mapstructure:"disk"` BlockSize int `mapstructure:"block_size"` ChunkSize int `mapstructure:"chunk_size"` }
* 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 BlockSize int ChunkSize 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) GetBlockSize ¶ added in v0.3.0
func (fc *FormatConfig) GetBlockSize() int
func (*FormatConfig) GetChunkSize ¶ added in v0.3.0
func (fc *FormatConfig) GetChunkSize() int
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 MigrateServer ¶
type MigrateServer struct { From *topology.DeployConfig To *topology.DeployConfig }
type MonitorConfig ¶ added in v0.3.0
type MonitorConfig struct {
// contains filtered or unexported fields
}
func FilterMonitorConfig ¶ added in v0.3.0
func FilterMonitorConfig(curveadm *cli.CurveAdm, mcs []*MonitorConfig, options FilterMonitorOption) []*MonitorConfig
func ParseMonitorConfig ¶ added in v0.3.0
func ParseMonitorConfig(curveadm *cli.CurveAdm, filename string, data string, hs []string, hostIps []string, dcs []*topology.DeployConfig) ( []*MonitorConfig, error)
func (*MonitorConfig) GetDataDir ¶ added in v0.3.0
func (m *MonitorConfig) GetDataDir() string
func (*MonitorConfig) GetGrafanaPassword ¶ added in v0.3.0
func (m *MonitorConfig) GetGrafanaPassword() string
func (*MonitorConfig) GetGrafanaUser ¶ added in v0.3.0
func (m *MonitorConfig) GetGrafanaUser() string
func (*MonitorConfig) GetHost ¶ added in v0.3.0
func (m *MonitorConfig) GetHost() string
func (*MonitorConfig) GetId ¶ added in v0.3.0
func (m *MonitorConfig) GetId() string
func (*MonitorConfig) GetImage ¶ added in v0.3.0
func (m *MonitorConfig) GetImage() string
func (*MonitorConfig) GetKind ¶ added in v0.3.0
func (m *MonitorConfig) GetKind() string
func (*MonitorConfig) GetListenPort ¶ added in v0.3.0
func (m *MonitorConfig) GetListenPort() int
func (*MonitorConfig) GetLogDir ¶ added in v0.3.0
func (m *MonitorConfig) GetLogDir() string
func (*MonitorConfig) GetNodeIps ¶ added in v0.3.0
func (m *MonitorConfig) GetNodeIps() []string
func (*MonitorConfig) GetNodeListenPort ¶ added in v0.3.0
func (m *MonitorConfig) GetNodeListenPort() int
func (*MonitorConfig) GetPrometheusIp ¶ added in v0.3.0
func (m *MonitorConfig) GetPrometheusIp() string
func (*MonitorConfig) GetPrometheusListenPort ¶ added in v0.3.0
func (m *MonitorConfig) GetPrometheusListenPort() int
func (*MonitorConfig) GetPrometheusRetentionSize ¶ added in v0.3.0
func (m *MonitorConfig) GetPrometheusRetentionSize() string
func (*MonitorConfig) GetPrometheusRetentionTime ¶ added in v0.3.0
func (m *MonitorConfig) GetPrometheusRetentionTime() string
func (*MonitorConfig) GetPrometheusTarget ¶ added in v0.3.0
func (m *MonitorConfig) GetPrometheusTarget() string
func (*MonitorConfig) GetRole ¶ added in v0.3.0
func (m *MonitorConfig) GetRole() string
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 Poolset string `json:"poolset,omitempty"` // curvebs }
Click to show internal directories.
Click to hide internal directories.