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
- func CreateDefaultCephConfig(context *clusterd.Context, cluster *ClusterInfo, runDir string, bluestore bool) *cephConfig
- func CreateKeyring(context *clusterd.Context, clusterName, username, keyringPath string, ...) error
- func FlattenMonEndpoints(mons map[string]*CephMonitorConfig) string
- func GenerateAdminConnectionConfig(context *clusterd.Context, cluster *ClusterInfo) error
- func GenerateConfigFile(context *clusterd.Context, cluster *ClusterInfo, ...) (string, error)
- func GenerateConnectionConfigFile(context *clusterd.Context, cluster *ClusterInfo, ...) (string, error)
- func GetClusterName(etcdClient etcd.KeysAPI) (string, error)
- func GetConfFilePath(root, clusterName string) string
- func GetDesiredMonitors(etcdClient etcd.KeysAPI) (map[string]*CephMonitorConfig, error)
- func NewAgent() clusterd.ServiceAgent
- func ParseMonEndpoints(input string) map[string]*CephMonitorConfig
- func RemoveMonitorFromQuorum(context *clusterd.Context, clusterName, name string) error
- func Run(context *clusterd.Context, config *Config) error
- func WaitForQuorum(context *clusterd.Context, clusterInfo *ClusterInfo) error
- func WaitForQuorumWithMons(context *clusterd.Context, clusterName string, mons []string) error
- func WriteKeyring(keyringPath, keyring string, generateContents func(string) string) error
- type CephMonitorConfig
- type ClusterInfo
- type Config
- type GlobalConfig
- type Leader
Constants ¶
const (
AdminKeyringTemplate = `
[client.admin]
key = %s
auid = 0
caps mds = "allow"
caps mon = "allow *"
caps osd = "allow *"
caps mgr = "allow *"
`
)
const (
CephKey = "/rook/services/ceph"
)
const (
Port = 6790
)
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 GetConfFilePath ¶
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 WaitForQuorum ¶
func WaitForQuorum(context *clusterd.Context, clusterInfo *ClusterInfo) error
func WaitForQuorumWithMons ¶
Types ¶
type CephMonitorConfig ¶
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 }
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"` }