Documentation ¶
Index ¶
- func CheckMounts(nodeStat []byte) (bool, []string)
- func GetRBDPool(device string) (string, string)
- func ParseMountOpts(mountopts string) uintptr
- func Run(zoo Zk, s ServerConf)
- func VersionShow()
- type ClusterStatus
- type IPs
- type Mount
- type MountState
- type Node
- type Quorum
- type RBDDevice
- type Resolve
- type ServerConf
- type Writer
- type Zk
- type ZooNode
- func (z ZooNode) Answer(fqdn string, req string, stderr []byte, t string)
- func (z ZooNode) CheckAndSetHealth(childrens []string)
- func (z ZooNode) CompareChilds(node Node) (bool, []string)
- func (z ZooNode) CreateZkTree(fqdn string)
- func (z ZooNode) DestroyNode(fqdn string) ([]string, string)
- func (z ZooNode) EnsureZooPath(node string) (string, error)
- func (z ZooNode) FindLeader(fqdn string)
- func (z ZooNode) GetLeader() string
- func (z ZooNode) GetQuorumHealth() string
- func (z ZooNode) GetState() []byte
- func (z ZooNode) MountRequest(r RBDDevice) error
- func (z ZooNode) RMR(path string)
- func (z ZooNode) Reconnect()
- func (z ZooNode) RequestWatch(fqdn string)
- func (z ZooNode) Resolve(fqdn string) error
- func (z ZooNode) ResolveRequest(r Resolve) error
- func (z ZooNode) SetDeadlyReason(node Node)
- func (z ZooNode) SetLeader(fqdn string)
- func (z ZooNode) SetQuorumHealth(health string)
- func (z ZooNode) UmountRequest(r RBDDevice) error
- func (z ZooNode) UpdateQuorum(childrens []string)
- func (z ZooNode) UpdateState(zkPath string, fqdn string)
- func (z ZooNode) WatchAnswer(fqdn string, t string) MountState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMounts ¶
CheckMounts ... Check mounts on down node
func GetRBDPool ¶
GetRBDPool get pool from rbd showmapped
func ParseMountOpts ¶ added in v0.0.4
ParseMountOpts parse RBDDevice.Mountopts. Return uintptr
Types ¶
type ClusterStatus ¶
type ClusterStatus struct { Quorum []Node `json:"quorum"` Health string `json:"health"` Zk string `json:"zk"` }
ClusterStatus Quorum status struct
type Mount ¶
type Mount struct { Mountpoint string `json:"mountpoint"` Mountopts string `json:"mountopts"` Fstype string `json:"fstype"` Pool string `json:"pool"` Image string `json:"image"` Block string `json:"block"` }
Mount struct
type MountState ¶
MountState status of mount/umount
type Node ¶
type Node struct { Node string `json:"node"` IP IPs `json:"ip"` Updated int64 `json:"updated"` Mounts []Mount `json:"mounts"` }
Node Node status struct
type Quorum ¶
type Quorum struct { Quorum []Node `json:"quorum"` Leader string `json:"leader"` Health string `json:"health"` DeadlyReason Node `json:"deadlyreason"` }
Quorum quorum information
type RBDDevice ¶
type RBDDevice struct { Node string `json:"node"` Pool string `json:"pool"` Image string `json:"image"` Block string `json:"block"` Mountpoint string `json:"mountpoint"` Mountopts string `json:"mountopts"` Fstype string `json:"fstype"` }
RBDDevice rbd block device struct
func (RBDDevice) UnmapDevice ¶
UnmapDevice unmap rbd block device
type ServerConf ¶
ServerConf configuration of http api server
func (ServerConf) ServeHTTP ¶
func (s ServerConf) ServeHTTP(z ZooNode, fqdn string)
ServeHTTP start http server
func (ServerConf) ServeWebSockets ¶
func (s ServerConf) ServeWebSockets(z ZooNode)
ServeWebSockets start websockets server
type Writer ¶
Writer ws
func (Writer) WriteStatusWs ¶
func (wr Writer) WriteStatusWs(w http.ResponseWriter, r *http.Request)
WriteStatusWs wrtite quorum status to websockets client
type ZooNode ¶
ZooNode zookeeper node
func (ZooNode) CheckAndSetHealth ¶
CheckAndSetHealth ...
func (ZooNode) CompareChilds ¶
CompareChilds return bool Needs rewrite
func (ZooNode) CreateZkTree ¶
CreateZkTree create Zk nodes tree
func (ZooNode) DestroyNode ¶
DestroyNode ... Delete node from quorum
func (ZooNode) EnsureZooPath ¶
EnsureZooPath create zookeeper path
func (ZooNode) FindLeader ¶
FindLeader return f.q.d.n of current leader
func (ZooNode) GetQuorumHealth ¶
GetQuorumHealth return health check of cluster state
func (ZooNode) MountRequest ¶
MountRequest create node with mount requests from API
func (ZooNode) RequestWatch ¶
RequestWatch watch for mount/umount requests
func (ZooNode) ResolveRequest ¶
ResolveRequest make request for resolve deadly.
func (ZooNode) SetDeadlyReason ¶
SetDeadlyReason default null
func (ZooNode) SetQuorumHealth ¶
SetQuorumHealth set current cluster health
func (ZooNode) UmountRequest ¶
UmountRequest create node with umount requests from API OMFG: Needs merge with MountRequest
func (ZooNode) UpdateQuorum ¶
UpdateQuorum set current cluster state
func (ZooNode) UpdateState ¶
UpdateState -- update node status
func (ZooNode) WatchAnswer ¶
func (z ZooNode) WatchAnswer(fqdn string, t string) MountState
WatchAnswer watch for answer