Commit Graph

216 Commits (ccb960f47f357004bd9e68734628788d2512bd25)

Author SHA1 Message Date
Cenk Alti 094cc6347d refactor(main): move main logic to separate package
The use case is to make it easy to embed etcd into another programs.
Currently, the only way of doing this to copy and paste the contents
of the `main()` in etcd.go.
With this commit, contents of the `main()` is moved into `Etcd.Run()`.
2014-04-01 12:41:33 -07:00
Yicheng Qin b2f787a2fd Merge pull request #653 from unihorn/49
chore(etcd): print out go-etcd log in VeryVeryVerbose Mode
2014-03-31 16:55:20 -07:00
Yicheng Qin ea701b3adb chore(etcd): print out go-etcd log in VeryVeryVerbose Mode 2014-03-31 16:53:48 -07:00
Yicheng Qin a3cbf02597 fix(tests): pass all tests using latest raft 2014-03-24 17:35:45 -07:00
Ben Johnson 62b89a128a Merge branch 'master' of https://github.com/coreos/etcd into proxy
Conflicts:
	config/config.go
	server/peer_server.go
	server/transporter.go
	tests/server_utils.go
2014-03-24 15:30:14 -07:00
Ben Johnson 174b9ff343 bump(github.com/goraft/raft): 6bf34b9
Move from coreos/raft to goraft/raft and update to latest.
2014-03-24 15:09:47 -07:00
Xiang Li 3ae792b159 refactor(listener) refactor listener related code
Remove duplicate code around creating http listener.
Start to listen incoming http requests just before serving them.
2014-03-13 15:47:27 -07:00
Ben Johnson f5698d3566 Proxy promotion. 2014-02-24 17:01:04 -07:00
Yicheng Qin 46d817f91b Merge pull request #577 from unihorn/6
chore: rename 'heartbeat timeout' to 'heartbeat interval'
2014-02-18 17:11:31 -08:00
Yicheng Qin f434177a9a chore: rename 'heartbeat timeout' to 'heartbeat interval'
Heartbeat timeout means the period length that indicates heartbeat is
out of service, which is different from heartbeat interval.

So we should use '-peer-heartbeat-interval' instead of
'-peer-heartbeat-timeout' in etcd.

'-peer-heartbeat-timeout' is deprecated but still could be used.
2014-02-18 16:37:20 -08:00
Yicheng Qin 04f21b5976 Merge pull request #569 from unihorn/5
Ordering and functionality of `-discovery` `-peers` and data dir to find peers
2014-02-17 14:34:53 -08:00
Yicheng Qin 3a4df1612c feat(discovery): adjust boot order to find peers
The boot order for peers is -discovery, -peers, log data, forming
new cluster itself.

Special rules:
1. If discovery succeeds, it would find peers specified by discover URL
only.
2. Etcd would fail when meeting bad -discovery, no -peers and log data.

Add TestDiscoveryDownNoBackupPeersWithDataDir as the test.
2014-02-17 12:53:39 -08:00
Brandon Philips fccecd4a05 fix(etcd): get consistent with etcdctl on printing versions
Lets get a bit more consistent in printing the versions:

```
$ ./bin/etcd -version
etcd version 0.3.0+git
$ ./bin/etcdctl -v
etcdctl version 0.3.0+git
```
2014-02-13 07:54:44 -08:00
Brandon Philips 76da437f29 bump(github.com/coreos/raft): ef3280ce54f60fff98a72012f547ed2b3415841f 2014-02-07 11:19:23 -08:00
Brandon Philips 468a68c96c feat(server): make the RetryInterval of PeerServer tunable
For tests and other environments it would be nice to be able to tune how
long to sleep between retries.
2014-02-06 22:10:09 -08:00
Brian Waldon 63fa35c99f refactor(tls): clarify & simplify tls configuration 2014-02-06 21:15:38 -08:00
Brandon Philips 1c91c167fc feat(config): remove the info file
The info file was meant to help the user from accidently making a
mistake but often times it just confuses people:

https://github.com/coreos/etcd/issues/356
https://github.com/coreos/etcd/issues/531
https://github.com/coreos/etcd/issues/318

Lets remove the info file for this next release.
2014-02-05 16:20:50 -08:00
Brandon Philips 40021ab72e bump(github.com/coreos/go-etcd): 526d936ffe75284ca80290ea6386f883f573c232 2014-02-05 09:27:39 -08:00
Brandon Philips f56965b1c0 refactor(config): make config its own package
Refactor config into its own package. Trying to tease the config from
the server so that all of the control surfaces are exposed in the Server
for easier testing.
2014-02-05 09:27:39 -08:00
Brandon Philips 72b393ca53 Merge pull request #519 from philips/fixup-server-tls-client-config
fix(server): fix client certificate verification
2014-02-03 17:33:45 -08:00
Brandon Philips 13b6c1e684 chore(*): make everything use goven
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven  -copy -rewrite $i; done
2014-02-01 23:44:18 -08:00
Brandon Philips ea8a353545 chore(*): gofmt everything 2014-02-01 23:44:10 -08:00
Brandon Philips 0fa6d38574 fix(server): fix client certificate verification
In d0c4916fe9 the TLS CA Certificate
verification broke.

This was bisected using the following basic test:

```
./bin/etcd -f -name machine0 -data-dir machine0 -ca-file=/tmp/ca/ca.crt -cert-file=/tmp/ca/server.crt -key-file=/tmp/ca/server.key.insecure
```

And in another window doing

```
curl --key /tmp/ca/server2.key.insecure  --cert /tmp/ca/server2.crt -k -L https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```

Before merging this PR there are a few things that need to be fixed up:

1) Tests for client certs both positive and negative
2) Refactor (or at least documentation of) the TLSConfig types
2014-01-31 16:56:15 -08:00
Brian Waldon 2fe22f1890 refactor(servers): emit http.Handlers from *Server 2014-01-22 11:17:58 -08:00
Brian Waldon 089021ca6d refacotor(transporter): make TLS config explicit 2014-01-22 11:17:58 -08:00
Brian Waldon f158dfcd77 refactor(peerserver): Remove PeerServerConfig.Path 2014-01-22 11:17:58 -08:00
Brian Waldon a7d9efa900 refactor(server): Remove ServerConfig struct 2014-01-22 11:17:58 -08:00
Brian Waldon 0abd860f7e refactor(server): drop Serve code; rename cors object
* server/cors.go renamed to http/cors.go
* all CORS code removed from Server and PeerServer
* Server and PeerServer fulfill http.Handler, now passed to http.Serve
* non-HTTP code in PeerServer.Serve moved to PeerServer.Start
2014-01-22 11:17:57 -08:00
Brian Waldon 5c3a3db2d8 refactor(server): treat Server as an http.Handler 2014-01-22 11:17:57 -08:00
Brian Waldon a2ee620394 refactor(raft): init raft transporter & server in main 2014-01-22 11:17:56 -08:00
Brian Waldon 7bd4d05a38 refactor(peer-server): move listener init out of peer_server.go 2014-01-22 11:17:41 -08:00
Brian Waldon d0c4916fe9 refactor(server): move listener init out of server.go 2014-01-22 11:17:26 -08:00
Brian Waldon 91fc6aabd2 chore(gofmt): Run gofmt 2014-01-22 11:17:26 -08:00
Brian Waldon c0ff8f6026 chore(imports): Shift around some imports 2014-01-22 11:17:26 -08:00
Brian Waldon a93d60be90 refactor(cors): Break apart CORS data and middleware 2014-01-22 11:17:26 -08:00
Brian Waldon c47760382e refactor(Server): Use a config struct in Server 2014-01-22 11:17:25 -08:00
Brian Waldon 9c8a23c333 refactor(PeerServer): Use a config struct in PeerServer 2014-01-22 11:17:03 -08:00
Brian Waldon 7eaad5c8e0 feat(metrics): enable some metrics; push to graphite
* -trace flag controls whether or not to enable metrics-gathering
  and the /debug/* HTTP endpoints
* -graphite-host flag controls where metrics should be sent
* timer.ae.handle metric tracks execution time of AppendEntriesRequest
2014-01-20 15:39:36 -08:00
Brian Waldon 32df6f92fc fix(peer): Pass peer server timeouts through factory
The peer's heartbeat and election timeouts are needed to build
the transporter in the factory method.
2014-01-14 09:18:03 -08:00
Brian Waldon b0cdf73565 feat(logging): Add VeryVeryVerbose opt to control raft trace info
Set very_very_verbose=true in a config file or use the -vvv CLI
option to get raft trace logs in addition to etcd debug logs.
2014-01-10 11:45:04 -08:00
Ben Johnson c7536ff5e1 Add Tuning section to README. 2013-12-18 16:40:29 -07:00
Ben Johnson 8442e7a0dc Timeout refactor. 2013-12-07 14:35:31 -07:00
Neil Dunbar a06f5e74af Merge remote-tracking branch 'upstream/master' into feature-parametric-timeout
Conflicts:
	Dockerfile
	server/usage.go
	tests/server_utils.go
2013-12-06 10:13:33 +00:00
Brian Waldon e7839e8c57 fix(etcd): Fix forced config reset
When a server name or a data directory were not provided, the
reset functionality would fail to clear out config files from
the appropriate place. This calcualtes the default server name
and data directory before reset is called.
2013-12-05 13:26:31 -08:00
Neil Dunbar 46f8a354d1 Added the ability to specify heartbeat and election timeouts as
config parameters.
2013-12-04 16:58:44 +00:00
Brandon Philips 04711ecde5 fix(etcd): fixup the name and data dir guessing
- Only generate the name from a hostname if the data dir is not
  specified and the name is not specified

- Only guess the data dir from Name if the data dir wasn't already
  specified
2013-11-27 12:20:26 -08:00
Brandon Philips 7c07810958 fix(etcd): remove duplicate DataDir setup
In the refactor of the configuration and flags I think that we
accidently placed this logic twice. The side effect is that we always
ended up with a `.etcd` directory.
2013-11-26 10:22:39 -06:00
Xiang Li 8a0496cfae bump deps 2013-11-22 08:59:24 -08:00
Ben Johnson ea6b11bbf6 Config clean up and usage messaging. 2013-11-20 10:52:01 -07:00
Ben Johnson 8952c1bd42 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config
Conflicts:
	etcd.go
2013-11-19 08:28:46 -07:00