mon

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 22 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.

Index

Constants

View Source
const (
	AdminKeyringTemplate = `
[client.admin]
	key = %s
	auid = 0
	caps mds = "allow"
	caps mon = "allow *"
	caps osd = "allow *"
	caps mgr = "allow *"
`
)
View Source
const (
	CephKey = "/rook/services/ceph"
)
View Source
const (
	Port = 6790
)
View Source
const (
	UnhealthyHeartbeatAgeSeconds = 10
)

Variables

This section is empty.

Functions

func CreateDefaultCephConfig

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

func CreateKeyring

func CreateKeyring(context *clusterd.Context, clusterName, 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

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

func GenerateAdminConnectionConfig

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

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 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 NewAgent

func NewAgent() clusterd.ServiceAgent

func ParseMonEndpoints

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

func RemoveMonitorFromQuorum

func RemoveMonitorFromQuorum(context *clusterd.Context, clusterName, name string) error

func Run

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

func WaitForQuorum

func WaitForQuorum(context *clusterd.Context, clusterInfo *ClusterInfo) error

func WaitForQuorumWithMons

func WaitForQuorumWithMons(context *clusterd.Context, clusterName string, mons []string) error

func WriteKeyring

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

Types

type CephMonitorConfig

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

func ToCephMon

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(context *clusterd.Context, adminSecret string) (*ClusterInfo, error)

create new cluster info (FSID, shared keys)

func CreateNamedClusterInfo

func CreateNamedClusterInfo(context *clusterd.Context, adminSecret, clusterName 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

func (c *ClusterInfo) MonEndpoints() string

type Config

type Config struct {
	Name    string
	Cluster *ClusterInfo
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(name string, cluster *ClusterInfo, isDaemon bool) *Config

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"`
	MonHost                  string `ini:"mon host"`
	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"`
	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, 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