Esempio n. 1
0
func main() {
	defer exit.RecoverAll()
	defer logutil.Flush()

	flag.Parse()
	args := flag.Args()
	if len(args) != 0 {
		flag.Usage()
		os.Exit(1)
	}

	if *fromTopo == "" || *toTopo == "" {
		log.Fatalf("Need both from and to topo")
	}

	fromTS := topo.GetServerByName(*fromTopo)
	toTS := topo.GetServerByName(*toTopo)

	if *doKeyspaces {
		helpers.CopyKeyspaces(fromTS, toTS)
	}
	if *doShards {
		helpers.CopyShards(fromTS, toTS, *deleteKeyspaceShards)
	}
	if *doShardReplications {
		helpers.CopyShardReplications(fromTS, toTS)
	}
	if *doTablets {
		helpers.CopyTablets(fromTS, toTS)
	}
}
Esempio n. 2
0
func init() {
	// handles /zk paths
	ts := topo.GetServerByName("zookeeper")
	if ts == nil {
		log.Error("zookeeper explorer disabled: no zktopo.Server")
		return
	}

	HandleExplorer("zk", "/zk/", "zk.html", NewZkExplorer(ts.(*zktopo.Server).GetZConn()))
}