zkctl

package
v0.0.0-...-d4b8c80 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StartWaitTime    = 20 // number of seconds to wait at Start
	ShutdownWaitTime = 20 // number of seconds to wait at Shutdown
)
View Source
const GUESS_MYID = 0

Variables

This section is empty.

Functions

func MakeZooCfg

func MakeZooCfg(cnfFiles []string, cnf *ZkConfig, header string) (string, error)

Search for first existing file in cnfFiles and subsitute in the right values.

Types

type ZkConfig

type ZkConfig struct {
	ServerId   uint32
	ClientPort int
	Servers    []zkServerAddr
	Global     bool
}

func MakeZkConfigFromString

func MakeZkConfigFromString(cmdLine string, myId uint32) *ZkConfig

Create a config for this instance.

<server_id>@<hostname>:<leader_port>:<election_port>:<client_port>

If server_id > 1000, then we assume this is a global quorum. server_id's must be 1-255, global id's are 1001-1255 mod 1000.

func NewZkConfig

func NewZkConfig() *ZkConfig

ServerId is a unique id for a server - must be 1-255

func (*ZkConfig) ConfigFile

func (cnf *ZkConfig) ConfigFile() string

func (*ZkConfig) DataDir

func (cnf *ZkConfig) DataDir() string

func (*ZkConfig) DirectoryList

func (cnf *ZkConfig) DirectoryList() []string

func (*ZkConfig) LogDir

func (cnf *ZkConfig) LogDir() string

func (*ZkConfig) MyidFile

func (cnf *ZkConfig) MyidFile() string

func (*ZkConfig) PidFile

func (cnf *ZkConfig) PidFile() string

func (*ZkConfig) WriteMyid

func (cnf *ZkConfig) WriteMyid() error

type Zkd

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

func NewZkd

func NewZkd(config *ZkConfig) *Zkd

createConnection: closure that returns a new connection or an error

func (*Zkd) CheckProcess

func (zkd *Zkd) CheckProcess() error

func (*Zkd) ConfigChanged

func (zkd *Zkd) ConfigChanged() (bool, error)

func (*Zkd) Init

func (zkd *Zkd) Init() error

func (*Zkd) Inited

func (zkd *Zkd) Inited() bool

func (*Zkd) LocalClientAddr

func (zkd *Zkd) LocalClientAddr() string

func (*Zkd) Reinit

func (zkd *Zkd) Reinit(preserveData bool) (err error)

func (*Zkd) Shutdown

func (zkd *Zkd) Shutdown() error

func (*Zkd) Start

func (zkd *Zkd) Start() error

ZOO_LOG_DIR="" ZOO_CFG="/.../zoo.cfg" ZOOMAIN="org.apache.zookeeper.server.quorum.QuorumPeerMain" java -DZOO_LOG_DIR=${ZOO_LOG_DIR} -cp $CLASSPATH $ZOOMAIN $YT_ZK_CFG

func (*Zkd) Teardown

func (zkd *Zkd) Teardown() error

Jump to

Keyboard shortcuts

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