mirror of https://github.com/etcd-io/dbtester.git
agent: clean up
This commit is contained in:
parent
40c7ef8e6e
commit
9112a2f02b
|
|
@ -27,6 +27,7 @@ func startCetcd(fs *flags, t *transporterServer, req *agentpb.Request) (*exec.Cm
|
||||||
if !exist(fs.cetcdExec) {
|
if !exist(fs.cetcdExec) {
|
||||||
return nil, fmt.Errorf("cetcd binary %q does not exist", globalFlags.cetcdExec)
|
return nil, fmt.Errorf("cetcd binary %q does not exist", globalFlags.cetcdExec)
|
||||||
}
|
}
|
||||||
|
|
||||||
peerIPs := strings.Split(req.PeerIPString, "___")
|
peerIPs := strings.Split(req.PeerIPString, "___")
|
||||||
clientURLs := make([]string, len(peerIPs))
|
clientURLs := make([]string, len(peerIPs))
|
||||||
for i, u := range peerIPs {
|
for i, u := range peerIPs {
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,14 @@ import (
|
||||||
|
|
||||||
// startConsul starts Consul.
|
// startConsul starts Consul.
|
||||||
func startConsul(fs *flags, t *transporterServer, req *agentpb.Request) (*exec.Cmd, error) {
|
func startConsul(fs *flags, t *transporterServer, req *agentpb.Request) (*exec.Cmd, error) {
|
||||||
if err := os.RemoveAll(fs.consulDataDir); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !exist(fs.consulExec) {
|
if !exist(fs.consulExec) {
|
||||||
return nil, fmt.Errorf("Consul binary %q does not exist", globalFlags.consulExec)
|
return nil, fmt.Errorf("Consul binary %q does not exist", globalFlags.consulExec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := os.RemoveAll(fs.consulDataDir); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
peerIPs := strings.Split(req.PeerIPString, "___")
|
peerIPs := strings.Split(req.PeerIPString, "___")
|
||||||
|
|
||||||
var flags []string
|
var flags []string
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,14 @@ import (
|
||||||
|
|
||||||
// startEtcd starts etcd v2 and v3.
|
// startEtcd starts etcd v2 and v3.
|
||||||
func startEtcd(fs *flags, t *transporterServer, req *agentpb.Request) (*exec.Cmd, error) {
|
func startEtcd(fs *flags, t *transporterServer, req *agentpb.Request) (*exec.Cmd, error) {
|
||||||
if err := os.RemoveAll(fs.etcdDataDir); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if !exist(fs.etcdExec) {
|
if !exist(fs.etcdExec) {
|
||||||
return nil, fmt.Errorf("etcd binary %q does not exist", globalFlags.etcdExec)
|
return nil, fmt.Errorf("etcd binary %q does not exist", globalFlags.etcdExec)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := os.RemoveAll(fs.etcdDataDir); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
peerIPs := strings.Split(req.PeerIPString, "___")
|
peerIPs := strings.Split(req.PeerIPString, "___")
|
||||||
|
|
||||||
names := make([]string, len(peerIPs))
|
names := make([]string, len(peerIPs))
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ snapCount={{.SnapCount}}
|
||||||
{{range .Peers}}server.{{.MyID}}={{.IP}}:2888:3888
|
{{range .Peers}}server.{{.MyID}}={{.IP}}:2888:3888
|
||||||
{{end}}
|
{{end}}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
// this is Zookeeper default configuration
|
||||||
|
// http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html
|
||||||
zkConfigDefault = ZookeeperConfig{
|
zkConfigDefault = ZookeeperConfig{
|
||||||
TickTime: 2000,
|
TickTime: 2000,
|
||||||
ClientPort: "2181",
|
ClientPort: "2181",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue