|
@@ -44,7 +44,6 @@ type cluster struct {
|
|
|
Agents []client.Agent
|
|
Agents []client.Agent
|
|
|
Stressers []Stresser
|
|
Stressers []Stresser
|
|
|
Names []string
|
|
Names []string
|
|
|
- GRPCURLs []string
|
|
|
|
|
ClientURLs []string
|
|
ClientURLs []string
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -89,7 +88,6 @@ func (c *cluster) Bootstrap() error {
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return err
|
|
return err
|
|
|
}
|
|
}
|
|
|
- grpcURLs[i] = fmt.Sprintf("%s:2378", host)
|
|
|
|
|
clientURLs[i] = fmt.Sprintf("http://%s:2379", host)
|
|
clientURLs[i] = fmt.Sprintf("http://%s:2379", host)
|
|
|
peerURLs[i] = fmt.Sprintf("http://%s:%d", host, peerURLPort)
|
|
peerURLs[i] = fmt.Sprintf("http://%s:%d", host, peerURLPort)
|
|
|
|
|
|
|
@@ -115,9 +113,7 @@ func (c *cluster) Bootstrap() error {
|
|
|
}
|
|
}
|
|
|
if !c.v2Only {
|
|
if !c.v2Only {
|
|
|
flags = append(flags,
|
|
flags = append(flags,
|
|
|
- "--experimental-v3demo",
|
|
|
|
|
- "--experimental-gRPC-addr", grpcURLs[i],
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ "--experimental-v3demo")
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if _, err := a.Start(flags...); err != nil {
|
|
if _, err := a.Start(flags...); err != nil {
|
|
@@ -161,7 +157,6 @@ func (c *cluster) Bootstrap() error {
|
|
|
c.Agents = agents
|
|
c.Agents = agents
|
|
|
c.Stressers = stressers
|
|
c.Stressers = stressers
|
|
|
c.Names = names
|
|
c.Names = names
|
|
|
- c.GRPCURLs = grpcURLs
|
|
|
|
|
c.ClientURLs = clientURLs
|
|
c.ClientURLs = clientURLs
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
@@ -172,7 +167,7 @@ func (c *cluster) WaitHealth() error {
|
|
|
// TODO: set it to a reasonable value. It is set that high because
|
|
// TODO: set it to a reasonable value. It is set that high because
|
|
|
// follower may use long time to catch up the leader when reboot under
|
|
// follower may use long time to catch up the leader when reboot under
|
|
|
// reasonable workload (https://github.com/coreos/etcd/issues/2698)
|
|
// reasonable workload (https://github.com/coreos/etcd/issues/2698)
|
|
|
- healthFunc, urls := setHealthKey, c.GRPCURLs
|
|
|
|
|
|
|
+ healthFunc, urls := setHealthKey, c.ClientURLs
|
|
|
if c.v2Only {
|
|
if c.v2Only {
|
|
|
healthFunc, urls = setHealthKeyV2, c.ClientURLs
|
|
healthFunc, urls = setHealthKeyV2, c.ClientURLs
|
|
|
}
|
|
}
|
|
@@ -192,7 +187,7 @@ func (c *cluster) GetLeader() (int, error) {
|
|
|
return 0, nil
|
|
return 0, nil
|
|
|
}
|
|
}
|
|
|
cli, err := clientv3.New(clientv3.Config{
|
|
cli, err := clientv3.New(clientv3.Config{
|
|
|
- Endpoints: c.GRPCURLs,
|
|
|
|
|
|
|
+ Endpoints: c.ClientURLs,
|
|
|
DialTimeout: 5 * time.Second,
|
|
DialTimeout: 5 * time.Second,
|
|
|
})
|
|
})
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -304,7 +299,7 @@ func setHealthKeyV2(us []string) error {
|
|
|
func (c *cluster) getRevisionHash() (map[string]int64, map[string]int64, error) {
|
|
func (c *cluster) getRevisionHash() (map[string]int64, map[string]int64, error) {
|
|
|
revs := make(map[string]int64)
|
|
revs := make(map[string]int64)
|
|
|
hashes := make(map[string]int64)
|
|
hashes := make(map[string]int64)
|
|
|
- for _, u := range c.GRPCURLs {
|
|
|
|
|
|
|
+ for _, u := range c.ClientURLs {
|
|
|
conn, err := grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second))
|
|
conn, err := grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
return nil, nil, err
|
|
return nil, nil, err
|
|
@@ -328,7 +323,7 @@ func (c *cluster) compactKV(rev int64) error {
|
|
|
conn *grpc.ClientConn
|
|
conn *grpc.ClientConn
|
|
|
err error
|
|
err error
|
|
|
)
|
|
)
|
|
|
- for _, u := range c.GRPCURLs {
|
|
|
|
|
|
|
+ for _, u := range c.ClientURLs {
|
|
|
conn, err = grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second))
|
|
conn, err = grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second))
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
continue
|
|
continue
|