Skip to content

Commit

Permalink
adress comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch committed May 25, 2017
1 parent a091036 commit d70c6ee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/pd-recover/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import (
)

var (
endpoints = flag.String("endpoints", "http://127.0.0.1:2379", "endpoints urls")
allocID = flag.Uint64("alloc-id", 0, "please make sure alloced ID is safe")
clusterID = flag.Uint64("cluster-id", 0, "please make cluster ID match with tikv")
endpoints = flag.String("endpoints", "http://127.0.0.1:2379", "endpoints urls")
allocID = flag.Uint64("alloc-id", 0, "please make sure alloced ID is safe")
clusterID = flag.Uint64("cluster-id", 0, "please make cluster ID match with tikv")
maxReplicas = flag.Int("max-replicas", 3, "max replicas is the number of replicas for each region")
)

const (
Expand Down Expand Up @@ -69,7 +70,7 @@ func main() {
// recover meta of cluster
clusterMeta := metapb.Cluster{
Id: *clusterID,
MaxPeerCount: uint32(3),
MaxPeerCount: uint32(*maxReplicas),
}
clusterValue, err := clusterMeta.Marshal()
if err != nil {
Expand All @@ -89,10 +90,10 @@ func main() {
exitErr(err)
}
if !resp.Succeeded {
fmt.Println("cluster already bootstrapped")
fmt.Println("failed to recover: the cluster is already bootstrapped")
return
}
fmt.Println("recover success! please restart PD")
fmt.Println("recover success! please restart the PD cluster")
}

func uint64ToBytes(v uint64) []byte {
Expand Down

0 comments on commit d70c6ee

Please sign in to comment.