Commit Graph

105 Commits

Author SHA1 Message Date
719c57a29d proxy: retrieve ClientURLs from cluster
This is a simple solution to having the proxy keep up to date with the
state of the cluster. Basically, it uses the cluster configuration
provided at start up (i.e. with `-initial-cluster-state`) to determine
where to reach peer(s) in the cluster, and then it will periodically hit
the `/members` endpoint of those peer(s) (using the same mechanism that
`-cluster-state=existing` does to initialise) to update the set of valid
client URLs to proxy to.

This does not address discovery (#1376), and it would probably be better
to update the set of proxyURLs dynamically whenever we fetch the new
state of the cluster; but it needs a bit more thinking to have this done
in a clean way with the proxy interface.

Example in Procfile works again.
2014-10-24 15:54:12 -07:00
49a68adcf1 Merge pull request #1386 from unihorn/184
etcdserver: update member attribute when apply request
2014-10-24 12:46:11 -07:00
ea0bff80c0 etcdserver: update member attribute when apply request 2014-10-24 12:43:53 -07:00
08593bcdf6 etcdserver: support newly-join member bootstrap 2014-10-24 12:38:44 -07:00
4d80f01201 etcdserver: Cluster.IsIDremoved -> Cluster.IsIDRemoved 2014-10-23 14:29:58 -07:00
8eee8c260e etcdserver: rebase on master and code clean 2014-10-23 13:58:55 -07:00
f8b8bdeb17 etcdserver: use path.Join for member key in cluster 2014-10-23 13:27:54 -07:00
3d243baacd etcdserver: generate id when new cluster 2014-10-23 13:27:54 -07:00
67412e07f8 etcdserver: MemberFromName -> MemberByName 2014-10-23 13:27:54 -07:00
89572b5fd7 etcdserver: refactor cluster and clusterStore
Integrate clusterStore into cluster, and let cluster become the source of
cluster info.
2014-10-23 13:27:54 -07:00
ab90369f9e etcdserver: use hex for cluster and machine id
Continue using hex everywhere. Including here.

TODO: cleanup the printing of the structs which currently have decimal
to/from:

`{Type:MsgAppResp To:9973738105406047488 From:17050684879817348455 T...`
2014-10-22 16:24:50 -07:00
e42d65da12 etcdserver: Check the initial cluster settings after checking if the WAL exists 2014-10-22 18:16:43 -04:00
13656eb4e7 Merge pull request #1340 from barakmich/better_ids2
etcdserver: Calculate IDs based on PeerURLs and --initial-cluster-name
2014-10-22 14:49:49 -04:00
89b032cd69 etcdserver: Member.storeKey -> memberStoreKey 2014-10-22 11:09:36 -07:00
7498234e40 etcdserver: record removed member to check incoming message 2014-10-22 11:09:35 -07:00
502a3c2460 Refactor Cluster to hold and add members. 2014-10-22 13:52:42 -04:00
1ca7c031ff first round of comments
Conflicts:
	etcdserver/config.go
	etcdserver/config_test.go
	etcdserver/server.go
	main.go
2014-10-22 13:49:54 -04:00
456d1ebcae etcdserver: Calculate IDs for nodes solely on PeerURLs
Removes the notion of name being anything more than advisory or
command-line grouping, and adds checks for bootstrapping the command
line. IDs are consistent if the URLs are consistent.
2014-10-22 13:49:54 -04:00
e2b6a4fc4c etcdserver: const XXXDir -> StoreXXXPrefix
and code clean
2014-10-21 16:10:49 -07:00
2ff3cac653 etcdserver/etcdhttp: store location adjustment
Detailed adjustment:
/_etcd/machines/* -> /0/members/*
/* -> /1/*

And it keeps key path returned to user the same as before.
2014-10-21 16:10:19 -07:00
894e678ad6 etcdserver: checking clusterID 2014-10-21 11:05:24 -07:00
a44849deec Merge pull request #1286 from coreos/clusterid
*: generate clusterid
2014-10-20 19:07:03 -07:00
0fd28169c8 etcdserver: use id,cid 2014-10-20 16:35:41 -07:00
dc68dc9ebd etcdserver: add a todo for clusterid generation 2014-10-20 16:26:31 -07:00
92230cee63 Merge pull request #1333 from unihorn/172
etcdserver/raft: remove msgDenied, removedNodes, shouldStop
2014-10-20 16:04:09 -07:00
e200d2a8e2 etcdserver/raft: remove msgDenied, removedNodes, shouldStop
The future plan is to do all these in etcdserver level.
2014-10-20 15:13:18 -07:00
ea6bcacfe4 *: generate clusterid 2014-10-20 15:00:54 -07:00
f7a0d5387b etcdserver: stop server gracefully 2014-10-20 14:43:21 -07:00
058537f34a main: add basic functional test 2014-10-20 14:43:21 -07:00
dcaa7f0a37 Merge pull request #1328 from unihorn/169
skip initial-cluster check when reboot
2014-10-20 13:06:24 -07:00
17382ec905 etcdserver: skip initial-cluster check when reboot
If etcd is provided with data-dir that has data, it will not use
initial-cluster, and initial-cluster could be set to be empty.
2014-10-20 12:41:07 -07:00
7a4d42166b *: add license header to all source files 2014-10-17 15:41:22 -07:00
c28907ba95 etcdserver: fix race and improve stats interfaces 2014-10-16 23:05:48 -07:00
c30b82b596 etcdserver: fix data race in retrieving self stats 2014-10-16 23:05:48 -07:00
97ae531eda etcdserver: split out storestats and serverstats 2014-10-16 10:43:49 -07:00
fedb67a71a etcdserver: fix TODO and change to base 16 2014-10-16 10:43:49 -07:00
8168fed825 etcdserver: add ServerStats and LeaderStats
This adds the remaining two stats endpoints: `/v2/stats/self`, for
various statistics on the EtcdServer, and `/v2/stats/leader`, for
statistics on a leader's followers.

By and large most of the stats code is copied across from 0.4.x, updated
where necessary to integrate with the new decoupling of raft from
transport.

This does not satisfactorily resolve the question of name vs ID. In the
old world, names were unique in the cluster and transmitted over the
wire, so they could be used safely in all statistics. In the new world,
a given EtcdServer only knows its own name, and it is instead IDs that
are communicated among the cluster members. Hence in most places here we
simply substitute a string-encoded ID in place of name, and only where
possible do we retain the actual given name of the EtcdServer.
2014-10-16 10:43:44 -07:00
0a8721a708 etcdserver: expose store statistics 2014-10-16 10:43:23 -07:00
8cd6030a1d etcdserver: add checking when apply conf change 2014-10-16 09:49:26 -07:00
a8a1d4fd93 Merge pull request #1299 from unihorn/162
etcdhttp: add PUT and DELETE on /v2/admin/members/
2014-10-15 10:52:11 -07:00
828accf07b etcdserver: better logging 2014-10-15 13:07:34 +08:00
f98fbbfc14 *: proto refactoring 2014-10-14 21:07:23 +08:00
4183b69e12 *: move from third_party to Godep 2014-10-14 00:37:52 -07:00
31264e7eb5 etcdhttp: add PUT and DELETE on /v2/admin/members/ 2014-10-13 22:36:06 -07:00
6fc0b1977b etcdserver: Id -> ID 2014-10-14 11:30:49 +08:00
b53b74733a etcdserver: add s.apply 2014-10-14 11:30:49 +08:00
30c7a7f2dd etcdserver: add shouldDiscover 2014-10-14 11:29:00 +08:00
a85ec90d68 etcdserver: clean NewServer 2014-10-14 11:29:00 +08:00
f693c6ddf2 etcdserver: apply bootstrap conf change 2014-10-13 11:22:23 -07:00
0319b033ea etcdserver/raft: set context for bootstrap addnode entries 2014-10-13 11:22:23 -07:00