etcdserver: introduce the cluster and member

This introduces two new concepts: the cluster and the member.

Members are logical etcd instances that have a name, raft ID, and a list
of peer and client addresses.

A cluster is made up of a list of members.
This commit is contained in:
Brandon Philips
2014-09-24 19:51:27 -07:00
parent 56c64ab2e8
commit 5e3fd6ee3f
13 changed files with 654 additions and 477 deletions

View File

@ -382,14 +382,14 @@ func testServer(t *testing.T, ns int64) {
}
}
peers := make([]int64, ns)
members := make([]int64, ns)
for i := int64(0); i < ns; i++ {
peers[i] = i + 1
members[i] = i + 1
}
for i := int64(0); i < ns; i++ {
id := i + 1
n := raft.StartNode(id, peers, 10, 1)
n := raft.StartNode(id, members, 10, 1)
tk := time.NewTicker(10 * time.Millisecond)
defer tk.Stop()
srv := &EtcdServer{