mon

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2016 The Rook Authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	CephKey = "/rook/services/ceph"
)
View Source
const (
	Port = 6790
)
View Source
const (
	UnhealthyHeartbeatAgeSeconds = 10
)

Variables

This section is empty.

Functions

func ConnectToCluster

func ConnectToCluster(context *clusterd.Context, factory client.ConnectionFactory, cluster *ClusterInfo,
	basePath, user, keyringPath string) (client.Connection, error)

opens a connection to the cluster that can be used for management operations

func ConnectToClusterAsAdmin

func ConnectToClusterAsAdmin(context *clusterd.Context, factory client.ConnectionFactory, cluster *ClusterInfo) (client.Connection, error)

func CreateDefaultCephConfig

func CreateDefaultCephConfig(context *clusterd.Context, cluster *ClusterInfo, runDir string, bluestore bool) *cephConfig

func CreateKeyring

func CreateKeyring(conn client.Connection, username, keyringPath string, access []string, generateContents func(string) string) error

create a keyring for access to the cluster, with the desired set of privileges

func FlattenMonEndpoints added in v0.3.0

func FlattenMonEndpoints(mons map[string]*CephMonitorConfig) string

func GenerateConfigFile

func GenerateConfigFile(context *clusterd.Context, cluster *ClusterInfo, pathRoot, user, keyringPath string,
	bluestore bool, userConfig *cephConfig, clientSettings map[string]string) (string, error)

generates and writes the monitor config file to disk

func GenerateConnectionConfigFile

func GenerateConnectionConfigFile(context *clusterd.Context, cluster *ClusterInfo, pathRoot, user, keyringPath string) (string, error)

generates and writes the monitor config file to disk

func GenerateTempConfigFiles

func GenerateTempConfigFiles(context *clusterd.Context, cluster *ClusterInfo) (string, string, string, error)

func GetClusterName

func GetClusterName(etcdClient etcd.KeysAPI) (string, error)

func GetConfFilePath

func GetConfFilePath(root, clusterName string) string

get the path of a given monitor's config file

func GetDesiredMonitors

func GetDesiredMonitors(etcdClient etcd.KeysAPI) (map[string]*CephMonitorConfig, error)

func NewConnectionFactoryWithClusterInfo added in v0.3.0

func NewConnectionFactoryWithClusterInfo(clusterInfo *ClusterInfo) *useConnFactory

func NewConnectionFactoryWithLookup added in v0.3.0

func NewConnectionFactoryWithLookup() *lookupConnFactory

func ParseMonEndpoints added in v0.3.0

func ParseMonEndpoints(input string) map[string]*CephMonitorConfig

func Run added in v0.3.0

func Run(context *clusterd.DaemonContext, config *Config) error

func WriteKeyring added in v0.3.0

func WriteKeyring(keyringPath, keyring string, generateContents func(string) string) error

Types

type CephLauncher added in v0.3.0

type CephLauncher interface {
	Run(id string, args ...string) error
}

type CephMonitorConfig

type CephMonitorConfig struct {
	Name     string `json:"name"`
	Endpoint string `json:"endpoint"`
}

func ToCephMon added in v0.3.0

func ToCephMon(name, ip string) *CephMonitorConfig

type ClusterInfo

type ClusterInfo struct {
	FSID          string
	MonitorSecret string
	AdminSecret   string
	Name          string
	Monitors      map[string]*CephMonitorConfig
}

func CreateClusterInfo

func CreateClusterInfo(factory client.ConnectionFactory, adminSecret string) (*ClusterInfo, error)

create new cluster info (FSID, shared keys)

func LoadClusterInfo

func LoadClusterInfo(etcdClient etcd.KeysAPI) (*ClusterInfo, error)

attempt to load any previously created and saved cluster info

func (*ClusterInfo) MonEndpoints added in v0.3.0

func (c *ClusterInfo) MonEndpoints() string

type Config added in v0.3.0

type Config struct {
	Name    string
	Cluster *ClusterInfo
	CephLauncher
}

type ConnectionFactory

type ConnectionFactory interface {
	ConnectAsAdmin(context *clusterd.Context, cephFactory client.ConnectionFactory) (client.Connection, error)
}

type GlobalConfig

type GlobalConfig struct {
	EnableExperimental       string `ini:"enable experimental unrecoverable data corrupting features"`
	FSID                     string `ini:"fsid,omitempty"`
	RunDir                   string `ini:"run dir,omitempty"`
	MonMembers               string `ini:"mon initial members,omitempty"`
	LogFile                  string `ini:"log file,omitempty"`
	MonClusterLogFile        string `ini:"mon cluster log file,omitempty"`
	PublicAddr               string `ini:"public addr,omitempty"`
	PublicNetwork            string `ini:"public network,omitempty"`
	ClusterAddr              string `ini:"cluster addr,omitempty"`
	ClusterNetwork           string `ini:"cluster network,omitempty"`
	MonKeyValueDb            string `ini:"mon keyvaluedb"`
	DebugLogDefaultLevel     int    `ini:"debug default"`
	DebugLogRadosLevel       int    `ini:"debug rados"`
	DebugLogMonLevel         int    `ini:"debug mon"`
	DebugLogOSDLevel         int    `ini:"debug osd"`
	DebugLogBluestoreLevel   int    `ini:"debug bluestore"`
	DebugLogFilestoreLevel   int    `ini:"debug filestore"`
	DebugLogJournalLevel     int    `ini:"debug journal"`
	DebugLogLevelDBLevel     int    `ini:"debug leveldb"`
	FileStoreOmapBackend     string `ini:"filestore_omap_backend"`
	OsdPgBits                int    `ini:"osd pg bits,omitempty"`
	OsdPgpBits               int    `ini:"osd pgp bits,omitempty"`
	OsdPoolDefaultSize       int    `ini:"osd pool default size,omitempty"`
	OsdPoolDefaultMinSize    int    `ini:"osd pool default min size,omitempty"`
	OsdPoolDefaultPgNum      int    `ini:"osd pool default pg num,omitempty"`
	OsdPoolDefaultPgpNum     int    `ini:"osd pool default pgp num,omitempty"`
	OsdMaxObjectNameLen      int    `ini:"osd max object name len,omitempty"`
	OsdMaxObjectNamespaceLen int    `ini:"osd max object namespace len,omitempty"`
	OsdObjectStore           string `ini:"osd objectstore"`
	RbdDefaultFeatures       int    `ini:"rbd_default_features,omitempty"`
	CrushtoolPath            string `ini:"crushtool"`
	FatalSignalHandlers      string `ini:"fatal signal handlers"`
}

type Leader

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

func NewLeader

func NewLeader() *Leader

func (*Leader) Configure

func (m *Leader) Configure(context *clusterd.Context, factory client.ConnectionFactory, adminSecret string) error

Apply the desired state to the cluster. The context provides all the information needed to make changes to the service. Create the ceph monitors Must be idempotent

Jump to

Keyboard shortcuts

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