Compare commits

...

1094 Commits

Author SHA1 Message Date
f9d27c37aa Merge pull request #548 from philips/0.3.0
doc(CHANGELOG): document v0.3.0
2014-02-07 15:57:08 -08:00
ddc40e5b45 doc(CHANGELOG): document v0.3.0 2014-02-07 15:54:45 -08:00
0c2287b201 fix(scripts/build-release): use cross compilation 2014-02-07 15:50:57 -08:00
102d8e543d bump(mod/dashboard): rebuild the dashboard for the latest fixes 2014-02-07 15:17:00 -08:00
b4d5534c75 Merge pull request #546 from sym3tri/dashboard-tabindexes
fix(dashboard): disable some tab indexes.
2014-02-07 15:10:09 -08:00
4f72403acd Merge pull request #544 from bcwaldon/case-insensitive-query-params
fix(v2): Use case-insensitive check on bool query params
2014-02-07 15:09:51 -08:00
4c0c256a9d fix(dashboard): disable some tab indexes. 2014-02-07 15:09:30 -08:00
d0f254a278 Merge pull request #545 from bcwaldon/doc-prevNode
doc(api): Document prevNode
2014-02-07 15:08:28 -08:00
0696e5026f doc(api): Document prevNode 2014-02-07 15:03:15 -08:00
42363001b4 fix(v2): Use case-insensitive check on bool query params
Fix issue #261
2014-02-07 14:29:08 -08:00
ed3d63248a Merge pull request #543 from philips/bump-goraft
bump(github.com/coreos/raft): ef3280ce54f60fff98a72012f547ed2b3415841f
2014-02-07 12:33:25 -08:00
2a2714a4bf Merge pull request #514 from cenkalti/prevNode
feat(prevNode): add "prevNode" to "Set" response
2014-02-07 12:04:18 -08:00
27cb38f38c fix(Documentation): add etcd-dump to libraries and tools
Fixes #325
2014-02-07 11:35:19 -08:00
e8be43d4c6 Merge pull request #528 from coreos/restructure-dashboard
Restructure dashboard & bug fixes
2014-02-07 11:26:18 -08:00
76da437f29 bump(github.com/coreos/raft): ef3280ce54f60fff98a72012f547ed2b3415841f 2014-02-07 11:19:23 -08:00
b4635b0b80 Merge pull request #542 from philips/fix-the-build
Fix the tests
2014-02-07 07:01:00 -08:00
147235f8f5 fix(test.sh): re-add the config tests
These tests were left behind in the move to put config in its own
package.
2014-02-06 22:52:50 -08:00
aa5c8b8ffd test(config): unexport ETCD_DISCOVERY
if this is exported the next tests will try and use it and fail.
2014-02-06 22:52:18 -08:00
1b3481fe25 fix(server/peer_server): stop the raftServer in Stop()
Stop() the raftServer if we stop the peerServer so that tests that start
and stop PeerServers exit cleanly.
2014-02-06 22:10:10 -08:00
21d7d14178 chore(tests/discovery): remove errant debug statement 2014-02-06 22:10:10 -08:00
14f15c33fe fix(tests/server_utils): use a WaitGroup for RunServer
Make sure that all of the servers exit before we return by using a
WaitGroup in each handler. This was used to help track down the issue
with the TestDiscoverySecondPeerUp test and the hung go-etcd watcher.
2014-02-06 22:10:10 -08:00
bfbc539321 hack(tests/discovery): don't use go-etcd for watch
go-etcd has a bug in the watcher that holds open a goroutine. Avoid
goetcd for this operation until it is fixed.
2014-02-06 22:10:10 -08:00
5f124166eb feat(tests/discovery): use low retry interval
In TestDiscoverySecondPeerFirstNoResponse use a low retryinterval so the
test doesn't take forever.
2014-02-06 22:10:10 -08:00
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
da3fe920cb fix(tests/v1_migration): add a -name flag
The info flag is ignored as of 1c91c167fc
so in order for this test to work we need to add `-name` flag.
2014-02-06 21:23:00 -08:00
3d9fc3846c fix(scripts/test-cluster): fix backwards logic on peers add 2014-02-06 21:15:38 -08:00
63fa35c99f refactor(tls): clarify & simplify tls configuration 2014-02-06 21:15:38 -08:00
68305181f9 Merge pull request #538 from xiangli-cmu/fix_hidden_watch
fix(watcher_hub)
2014-02-06 12:39:18 -05:00
c844fccf2a fix(watcher_hub) isHidden checks the length of the watchPath before getting subString of keyPath 2014-02-06 11:09:47 -05:00
f2452a4a3c fix(build): Use ngmin. Fix all introduced erros in previous commits. 2014-02-05 22:41:10 -08:00
4e21405647 fix(dashboard): bugs in key browser and stats page.
Fixed key add, key delete bugs. More refactoring.
2014-02-05 22:40:04 -08:00
06f990236c refactor(dashboard): Restructured front-end dashboard code. 2014-02-05 22:39:46 -08:00
8a172322ff Merge pull request #537 from xiangli-cmu/fix_hidden_watch
fix(watch hidden key)
2014-02-05 23:43:41 -05:00
1b5f9eb013 test (isHidden) add unit test for isHidden function 2014-02-05 23:32:12 -05:00
5851cb5b8d chrod(watcher_hub) add comment to isHidden function 2014-02-05 23:31:38 -05:00
ba98de6ef0 fix(watch hidden key) Fix hidden keys preventing deeper recursive watches from receiving events
If a watcher has given the correct hidden directory, we should allow it to watch the non-hidden events under that hidden directory. This pull request achieves this by checking if the path after the watching prefix has a "/_" which indicates a hidden key.
2014-02-05 22:34:41 -05:00
d2a0f8f2fd Merge pull request #535 from robszumski/master
fix(docs): explicitly create links instead of using the markdown parser
2014-02-05 16:53:56 -08:00
445b584333 fix(docs): explicitly create links instead of using the markdown parser 2014-02-05 16:52:31 -08:00
f7dae0de02 Merge pull request #533 from robszumski/master
fix(docs): add full command example and link to discovery spec
2014-02-05 16:29:43 -08:00
1c6a41dda4 Merge pull request #532 from philips/remove-info-file
feat(config): remove the info file
2014-02-05 16:21:27 -08:00
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
39518b463a Merge pull request #534 from philips/discovery-protocol-fix
fix(discovery): use prevExist instead of prevValue=init
2014-02-05 15:15:08 -08:00
cbdf4a738c fix(discovery): use prevExist instead of prevValue=init
Use PUT /_state?prevExist=true in the protocol instead of PUT
/_state?prevValue=init. This lets people point one vanilla etcd at the
key prefix of another vanilla etcd and have it just work.
2014-02-05 15:14:57 -08:00
1d4912b22f fix merge conflicts 2014-02-05 14:39:48 -08:00
bc7297c2d0 feat(docs): add cluster discovery documentation 2014-02-05 14:37:40 -08:00
39ddb29e63 Merge pull request #515 from robszumski/master
feat(docs): add cluster discovery documentation
2014-02-05 11:53:31 -08:00
fe35839a77 feat(docs): add cluster discovery documentation 2014-02-05 10:54:28 -08:00
297832ff91 Merge pull request #512 from philips/bootstrap-protocol
feat(discovery): initial working code
2014-02-05 09:27:52 -08:00
2d75ef0c7a feat(Documentation/discovery-protocol): explain heartbeating
Explain more information about how the TTL works and etcds role.
2014-02-05 09:27:40 -08:00
2822b9c579 tests(tests/functional): add tests for Discovery
This tests a variety of failure cases for the Discovery service
including:

- Initial leader failures
- Discovery service failures
- Positive tests for discovery working flawlessly
2014-02-05 09:27:39 -08:00
ff6090836c fix(tests/server_utils): add a metrics bucket
This is required to avoid getting nil pointer exceptions if a peer joins
this test server.
2014-02-05 09:27:39 -08:00
a8b07b1b48 chore(config): go fmt 2014-02-05 09:27:39 -08:00
8687dd3802 feat(discovery): fully working discovery now 2014-02-05 09:27:39 -08:00
40021ab72e bump(github.com/coreos/go-etcd): 526d936ffe75284ca80290ea6386f883f573c232 2014-02-05 09:27:39 -08:00
72514f8ab2 feat(bootstrap): initial working code
This is an initial version of the bootstrap code that seems to work
under the normal circumstances. I need to mock out a server that will
test out all of the error cases now.
2014-02-05 09:27:39 -08:00
40a8542c22 feat(bootstrap): wire up the flag
This wires up `-bootstrap-url` to some code (which crashes) :)
2014-02-05 09:27:39 -08:00
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
69922340f6 refactor(server): move utilities into pkg
like camlistore lets move these utilities into a `pkg` prefix.
2014-02-05 09:27:39 -08:00
0e50d9787a feat(*): bootstrap initial commit
Setup the flags, and checkin the docs. Lets do this!
2014-02-05 09:27:39 -08:00
9e43e726a9 Merge pull request #507 from philips/turn-snapshots-on-by-default
feat(*): enable snapshots by default
2014-02-05 09:08:43 -08:00
03cadc543f Merge pull request #525 from yifan-gu/fix_comments
fix some typos in comments in store.go
2014-02-04 11:46:29 -08:00
b61cf9cb8e fix a format error in libraries-and-tools.md 2014-02-04 14:30:40 -05:00
8d2a8e1c7a fix some typos in comments in store.go 2014-02-04 14:17:44 -05:00
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
6398206e4f Merge pull request #1 from bcwaldon/fixup-server-tls-client-config
test(TLS): Add test coverage for etcd TLS
2014-02-03 17:33:34 -08:00
226c20c097 test(TLS): Add test coverage for etcd TLS 2014-02-03 17:32:24 -08:00
0b9c5c975e fix(test.sh): use . not source 2014-02-02 17:01:21 -08:00
272dc343ef Merge pull request #520 from philips/use-goven
Use goven for all third party dependencies
2014-02-02 16:58:07 -08:00
d7d20d1c3d bump(github.com/stretchr/testify): 9cc77fa25329013ce07362c7742952ff887361f2 2014-02-02 16:57:36 -08:00
2557992b70 fix(tests): use correct raft package 2014-02-02 16:57:36 -08:00
33be0e09fe fix(build/test.sh): use new GOPATH setup 2014-02-02 16:57:36 -08:00
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
ea8a353545 chore(*): gofmt everything 2014-02-01 23:44:10 -08:00
0566bf2d5d Revert "Fix compile bug in peer_server_handlers.go "
This reverts commit e1ed380f04.
2014-02-01 20:09:53 -08:00
93a129e55a Merge pull request #516 from augustoroman/patch-1
fix(server compilation): compile bug in peer_server_handlers.go
2014-02-01 19:52:08 -08:00
58e1f12240 doc(server): some basic docs on the tls_config object
This should be refactored but something to remember while refactoring.
2014-01-31 17:08:37 -08:00
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
e1ed380f04 Fix compile bug in peer_server_handlers.go
resp.Success is a func() bool, not a bool.  Call it.
2014-01-30 15:31:36 -08:00
354a91290e feat(prevNode): add test for prevNode 2014-01-29 17:52:25 -08:00
3ec7004421 feat(prevNode): add "prevNode" to "Set" response 2014-01-29 17:30:33 -08:00
a542a7804b Merge pull request #508 from jonboulle/master
Various cleanup to API documentation
2014-01-25 13:06:29 -08:00
03ff4c8b76 Missed one 2014-01-25 12:22:37 -08:00
7992448f6a Various cleanup to API documentation 2014-01-25 12:08:57 -08:00
9a0ddb3760 feat(server): log on snapshot success or failure
lila.local: snapshot of 12 events completed at index 479
lila.local: snapshot of 12 events at index 491 attempted and failed: handling snapshot
2014-01-24 07:13:01 -08:00
7ee7e910eb feat(*): enable snapshots by default
Ben recently added test coverage for snapshots so we should enable it in
etcd. Lets do this.

1d66f6a111
2014-01-23 20:53:22 -08:00
281b0e7e59 Merge pull request #506 from philips/add-freebsd-docs
feat(Documentation): add instructions on freebsd
2014-01-23 16:44:38 -08:00
50e6256058 feat(Documentation): add instructions on freebsd 2014-01-23 16:43:38 -08:00
1b00c449a5 Revert "Better error message when setting values on directories"
This reverts commit d13dd50d51.
2014-01-23 11:22:11 -08:00
9848072d21 Merge pull request #487 from intjonathan/patch-1
English clarity in filesystem documentation.
2014-01-23 04:03:05 -08:00
2652e46d66 Merge pull request #504 from kelseyhightower/master
Better error message when setting values on directories
2014-01-23 03:59:40 -08:00
d13dd50d51 Better error message when setting values on directories
Without this commit etcd returns the following error message when
setting values on directories:

    {
      "errorCode":102,
      "message":"Not a file",
      "cause":"/postgres",
      "index":2
    }

While the above error message is accurate it's not very descriptive.
This commit adds a new error code/message which better describes why the
write operation failed. etcd now returns the following:

    {
      "errorCode":109,
      "message":"Cannot set value on directory",
      "cause":"/postgres",
      "index":2
    }
2014-01-22 23:02:33 -08:00
8fece992eb Update filesystem documenation for clarity. 2014-01-22 20:43:54 -08:00
3264b51a74 Merge pull request #501 from benbjohnson/snapshot-documentation
Add snapshot documentation
2014-01-22 15:26:53 -08:00
0692097a73 Add snapshot documentation. 2014-01-22 16:06:25 -07:00
19ef1042d6 Merge pull request #497 from philips/store-bench-no-rand
fix(store/store_bench): don't use rand
2014-01-22 13:19:04 -08:00
394e651591 Merge pull request #484 from bcwaldon/server-config
Refactor server init code
2014-01-22 11:39:27 -08:00
2fe22f1890 refactor(servers): emit http.Handlers from *Server 2014-01-22 11:17:58 -08:00
089021ca6d refacotor(transporter): make TLS config explicit 2014-01-22 11:17:58 -08:00
f158dfcd77 refactor(peerserver): Remove PeerServerConfig.Path 2014-01-22 11:17:58 -08:00
19980a7033 refactor(peerserver): remove timeouts from PeerServerConfig 2014-01-22 11:17:58 -08:00
a7d9efa900 refactor(server): Remove ServerConfig struct 2014-01-22 11:17:58 -08:00
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
5c3a3db2d8 refactor(server): treat Server as an http.Handler 2014-01-22 11:17:57 -08:00
074099a1b2 refactor(cors): Simplify corsInfo struct 2014-01-22 11:17:57 -08:00
a2ee620394 refactor(raft): init raft transporter & server in main 2014-01-22 11:17:56 -08:00
ffa2b07dc4 refactor(transporter): Pass in everything the transporter needs 2014-01-22 11:17:43 -08:00
60bbc57aeb refactor(transporter): pass in timeouts 2014-01-22 11:17:43 -08:00
86718167e8 refactor(peer_server): move stats construction to factories 2014-01-22 11:17:42 -08:00
7bd4d05a38 refactor(peer-server): move listener init out of peer_server.go 2014-01-22 11:17:41 -08:00
d0c4916fe9 refactor(server): move listener init out of server.go 2014-01-22 11:17:26 -08:00
91fc6aabd2 chore(gofmt): Run gofmt 2014-01-22 11:17:26 -08:00
c0ff8f6026 chore(imports): Shift around some imports 2014-01-22 11:17:26 -08:00
a93d60be90 refactor(cors): Break apart CORS data and middleware 2014-01-22 11:17:26 -08:00
c47760382e refactor(Server): Use a config struct in Server 2014-01-22 11:17:25 -08:00
9c8a23c333 refactor(PeerServer): Use a config struct in PeerServer 2014-01-22 11:17:03 -08:00
91f768f9ae refactor(cors): Rename cors_handler.go to cors.go 2014-01-22 10:59:12 -08:00
6c48466bfe Merge pull request #500 from drusellers/patch-2
adding .net client to the matrix
2014-01-22 09:26:44 -08:00
5bf667851c adding .net client to the matrix 2014-01-22 10:00:22 -06:00
d77e3a203f Merge pull request #499 from drusellers/patch-1
adding .net client
2014-01-22 07:29:09 -08:00
c32dfa013d adding .net client 2014-01-22 09:24:54 -06:00
6b70efbe30 Merge pull request #498 from tobz/actually-hidden-keys
fix(store): properly hide hidden keys from watchers, not just gets
2014-01-22 06:52:31 -08:00
641edd4e6e test(store): group together all store tests that deal with hidden keys 2014-01-22 09:29:53 -05:00
823fdfab12 fix(store): make isHidden see if any portion of the path is hidden, not just the last element 2014-01-22 09:29:33 -05:00
0cacb6cba4 test(store): exercise watchers receiving notifications of non-hidden keys within hidden directories 2014-01-22 09:20:57 -05:00
7a948746a8 fix(store): move logic to handle whether or not to notify (re: hidden keys) entirely into watcher hub 2014-01-22 09:02:42 -05:00
139f59f7d1 fix(store): properly hide hidden keys from watchers, not just gets 2014-01-21 20:26:56 -05:00
80c22a4fb2 fix(store/store_bench): don't use rand
rand just introduces more noise to the results, don't use it.
2014-01-21 17:01:26 -08:00
a417782151 Merge pull request #483 from bcwaldon/metrics
Integrate go-metrics
2014-01-21 14:17:03 -08:00
e87f3231a1 Merge pull request #496 from bcwaldon/droneio
test(ci): Replace travis.ci with drone.io
2014-01-21 12:28:52 -08:00
fe39288ebf test(ci): Replace travis.ci with drone.io 2014-01-21 11:50:36 -08:00
97bc5b260d feat(metrics): Publish peer heartbeat events as metrics 2014-01-21 11:44:22 -08:00
47f24d1088 bump(github.com/coreos/raft): bf7accb84ce4fe446983abffe00dd18a6b8cbc18 2014-01-21 11:18:50 -08:00
3a75d0a465 Merge pull request #493 from xiangli-cmu/bench_watcher
test(store_bench_test.go) add watch bench
2014-01-21 07:35:18 -08:00
17c8f6d2e8 test(store_bench_test.go) add watch bench 2014-01-21 06:51:40 -05:00
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
3e7c2dff96 feat(metrics): Add documentation and contrib scripts 2014-01-20 15:37:31 -08:00
14c96306a0 feat(metrics): Add metrics pkg 2014-01-20 13:32:42 -08:00
d122ed3bcd Merge pull request #492 from rwindelz/fix-ttl
fix(store): TTL should range 1..n rather than 1..n+1
2014-01-20 09:28:38 -08:00
451e874696 Merge pull request #480 from xiangli-cmu/store_bench
feat(store/store_bench_test.go) add a benchmark for set operation
2014-01-20 07:00:54 -08:00
290ca6bbc7 Merge pull request #491 from jkakar/master
Trivial typo fix in API documentation
2014-01-19 21:53:26 -08:00
a2e5bae951 fix(store): TTL should range 1..n rather than 1..n+1
was experiencing intermittent functional test fails where TTL was eg 101
when 100 was expected
informal testing on a windows platform shows Go times resolving to the
nanosecond but with an accuracy of approximately 1 millisecond
I believe some of the functional test steps would run in under a
millisecond and cause the TTL to be recomputed with the same time.Now()
value resulting in a TTL that was +1 from the expected
2014-01-19 21:45:53 -08:00
823e744ed9 - Fix typo. 2014-01-18 18:28:33 -08:00
35c89c7537 feat(metrics): Add github.com/rcrowley/go-metrics 2014-01-17 16:12:18 -08:00
77887e8253 fix(bench): remove trailing slash
Remove trailing slash. This works around
https://github.com/coreos/go-etcd/issues/82
2014-01-17 16:03:46 -08:00
1e6c0dee24 Merge pull request #488 from robszumski/master
feat(docs): Prepare to sync security doc to CoreOS website
2014-01-17 13:11:49 -08:00
e89e42382a fix(docs): remove header 2014-01-17 13:06:59 -08:00
184a5901e6 feat(docs): modify for sync to CoreOS website 2014-01-17 12:25:36 -08:00
6f8b0dc7ef add delete bench 2014-01-17 15:18:11 +08:00
21f0c6f9d4 feat(store_bench) add set bench for different value sizes 2014-01-17 14:19:31 +08:00
bd2b3793a6 Merge pull request #486 from philips/document-profiling-binary
fix(Documentation/profiling): note about using the right binary
2014-01-16 17:09:43 -08:00
25caac370f bump(github.com/coreos/go-log): 70d039bee4b0e389e5be560491d8291708506f59 2014-01-16 16:56:10 -08:00
0c8329a3fb fix(scripts/test-cluster): use v2 flags and find the path for etcd 2014-01-16 16:40:49 -08:00
444b5d329c fix(Documentation/profiling): note about using the right binary 2014-01-16 15:51:30 -08:00
7a7f6aea00 Merge pull request #479 from philips/add-debug-endpoint
add-debug-endpoint
2014-01-16 11:28:52 -08:00
b226b14eb2 add mem stats for sets benchmark 2014-01-16 16:06:18 +08:00
72b165ad4c Merge pull request #482 from bcwaldon/etcdbench
etcdbench -endpoint flag; error reporting
2014-01-15 22:37:33 -08:00
bd04905154 fix(etcdbench): Check for error in etcdbench set operation 2014-01-15 22:33:34 -08:00
471c40735c feat(etcdbench): Add -endpoint flag to etcdbench 2014-01-15 22:33:25 -08:00
c2d1dc4f51 add a setWithJson test 2014-01-16 09:16:33 +08:00
000290dc94 Merge pull request #481 from philips/fixup-test-cluster
fix(scripts/test-cluster): use ./bin/etcd now
2014-01-15 17:15:53 -08:00
3f3a324108 fix(scripts/test-cluster): use ./bin/etcd now 2014-01-15 17:15:18 -08:00
77477b3e43 feat(store/store_bench_test.go) add a benchmark for set operation of store pkg
We randomly generage N 3 level keys. We benchmark the speed of setting each key into etcd store.
2014-01-16 09:03:42 +08:00
c2077ed0b6 feat(server): add net/http/pprof endpoints
Add some basic profiling endpoints over http to start digging into
memory and request latencies.
2014-01-15 15:03:29 -08:00
ceefa98c76 Merge pull request #476 from ekristen/master
fixes bug with the etcd docker image not being able to run
2014-01-15 10:39:38 -08:00
d3fb9f0f0f etcd is in the bin directory, fixes bug with the docker image not working 2014-01-15 12:46:09 -05:00
d9088a5f18 Merge pull request #473 from bcwaldon/fix-peer-timeouts
Use election and heartbeat timeouts when building peer transporter
2014-01-15 02:11:40 -08:00
87113f985f Merge pull request #472 from benbjohnson/fix-error-codes
Fix mod/lock and mod/leader return error codes.
2014-01-15 01:14:59 -08:00
4da933e4a4 Merge pull request #475 from philips/fixup-travis
fix(travis): fixes from the third_party.go merge
2014-01-14 22:41:34 -08:00
56909bb6a3 fix(travis): fixes from the third_party.go merge 2014-01-14 22:36:40 -08:00
ecd73acc01 Merge pull request #460 from philips/use-third-party.go
chore(build): use third_party.go
2014-01-14 22:16:15 -08:00
e2e0853492 fix(server/release_version): checkin to git 2014-01-14 22:14:47 -08:00
0f97e3528a chore(build): use third_party.go
use the third_party.go project to replace our update script. This
requires moving a few things around and gets rid of a few annoying bugs:

- You can now bump individual packages
- A new src directory isn't created on build
- Less shell scripting!
- Things get built into ./bin/
2014-01-14 22:14:47 -08:00
89074ffcea Merge pull request #474 from jpetazzo/switch-to-go-1.2
Download and build Go 1.2 in the Dockerfile.
2014-01-14 21:54:14 -08:00
6b14fe7747 Download and build Go 1.2 in the Dockerfile.
The dependency BurntSushi/toml actually needs Go 1.2, because it uses
encoding.TextUnmarshaler, which didn't exist in Go 1.1. Since the PPA
that we use doesn't have Go 1.2 yet, we will use the same method as
Docker, i.e. download Go source tarball and compile it.
2014-01-14 18:19:37 -08:00
48e36422b5 chore(gofmt): Run gofmt on server/config.go 2014-01-14 09:18:09 -08:00
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
cde184fdbf Fix mod/lock and mod/leader return error codes. 2014-01-14 07:57:30 -07:00
97f1363afa Merge pull request #470 from ranjib/consistent_curl_examples
style(Documentation/api): keep curl based examples consistent and correct
2014-01-12 21:54:39 -08:00
8b8b8d74fe style(Documentation/api): keep curl based examples consistent and correct
- fix curl examples where `http://` was missing.
- consistent passing HTTP method parameter (all examples now have -X ACTION at
 the end or the url, GET is implicit)
- quote url when it contains `&` , instead of escaping
2014-01-11 20:51:25 -08:00
5821a1390a Merge pull request #466 from bcwaldon/verbosity
Add more control over verbose logging
2014-01-10 14:30:32 -08:00
ae2130952b fix(config): Set VeryVerbose properly 2014-01-10 11:45:04 -08:00
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
c64c739fab Merge pull request #461 from xiangli-cmu/stream_watcher
feat(stream watchers) add stream watcher support
2014-01-10 08:42:31 -08:00
feb6f2dad7 Merge pull request #465 from philips/add-note-that-the-dahboard-is-compiled-in
feat(Documentation/modules): note the dashboard is compiled in
2014-01-10 06:10:36 -08:00
2c42271cea Merge pull request #18 from cenkalti/li
feat(stream watchers) fix locking issue
2014-01-10 06:07:14 -08:00
8597904bc2 feat(stream watchers) fix locking issue 2014-01-10 16:04:23 +02:00
227ea57c37 Merge pull request #17 from cenkalti/li
feat(stream watchers) disable double chunking
2014-01-10 05:17:44 -08:00
5b924dfd4e feat(stream watchers) disable double chunking 2014-01-10 15:09:35 +02:00
181805bb87 feat(Documentation/modules): note the dashboard is compiled in 2014-01-09 17:57:14 -08:00
63c06d6c79 Merge pull request #463 from robszumski/master
feat(docs): make clustering examples more complete
2014-01-09 17:07:12 -08:00
782166dadd feat(docs): make clustering examples more complete 2014-01-09 14:37:04 -08:00
7bfd11679b Merge pull request #462 from xiangli-cmu/sync_cnt_for_snapshot
fix(snapshot) count num of log entries rather than etcd transcations
2014-01-09 05:29:18 -08:00
f250649a5e fix(snapshot) count num of log entries rather than etcd transcations 2014-01-09 21:28:09 +08:00
629a827ee2 Merge pull request #16 from cenkalti/li
feat(stream watchers) end streaming if too many notifications
2014-01-09 04:21:26 -08:00
c247d807af feat(stream watchers) end streaming if too many notifications 2014-01-09 14:15:36 +02:00
22a25a18b3 feat(stream watchers) add stream watcher support 2014-01-09 15:28:33 +08:00
6b77b94127 Merge pull request #420 from benbjohnson/logging
Logging
2014-01-08 21:36:52 -08:00
2bfb8f5e4f Merge pull request #418 from xiangli-cmu/cancel_watcher
cancel watcher
2014-01-08 21:34:32 -08:00
dd6623be2f Merge pull request #454 from dsoprea/master
Added HTTPS for python-etcd-client.
2014-01-08 21:32:59 -08:00
fa3b4a7941 refactor(watcher) change newWatcher to Watch 2014-01-09 13:29:04 +08:00
8047cfd48e Merge pull request #447 from robszumski/master
Prepare docs to be synced to website
2014-01-08 16:38:44 -08:00
53477af1eb Merge branch 'master' of https://github.com/coreos/etcd into logging 2014-01-08 16:50:51 -07:00
355bd6df9b Fix Travis CI. 2014-01-08 16:41:01 -07:00
8d25dac1ba Revert test.sh changes. 2014-01-08 16:21:22 -07:00
b47042634a Add ThresholdMonitorTimeout. 2014-01-08 15:51:13 -07:00
e02441acb1 Merge pull request #455 from philips/fixup-cas-header
chore(Documentation/api): introduce acronym later in the text
2014-01-08 10:46:46 -08:00
ddd8e85146 chore(Documentation/api): introduce acronym later in the text 2014-01-08 10:46:05 -08:00
68546de2cb Merge pull request #444 from philips/document-stats-api
Documentation: document the stats API
2014-01-08 10:41:29 -08:00
7553a92232 feat(Documentation/api): document the store statistics 2014-01-08 10:40:57 -08:00
c7e642baa2 fix(Documentation/api): fixup the names in stats
This was fixed in #449
2014-01-08 10:36:44 -08:00
0377ea751d Added additional separator column. 2014-01-08 10:48:29 -05:00
5efad911d5 Added HTTPS for python-etcd-client. 2014-01-08 09:57:45 -05:00
d38a260e00 Merge pull request #452 from xiangli-cmu/fix_client-matrix_link
doc(Documentation/libraries-and-tools.md) fix link to clients-matrix
2014-01-07 22:32:51 -08:00
0cc2e8887f doc(Documentation/libraries-and-tools.md) fix link to clients-matrix 2014-01-08 14:26:56 +08:00
3736b7678a Merge pull request #449 from xiangli-cmu/fix_stats
fix(peer_server.go) init name field and update leader field
2014-01-07 19:21:30 -08:00
e373c9ac8c fix(docs): suggest cors flag for using dashboard 2014-01-07 17:08:15 -08:00
5f2d9b38dc fix(docs): reference correct cors flag 2014-01-07 17:03:45 -08:00
a7eeb01bc8 fix(docs): reference correct cors flag 2014-01-07 17:03:11 -08:00
c26215a740 Merge pull request #450 from dsoprea/master
Updated client matrix.
2014-01-07 16:06:10 -08:00
4e8828c5c4 Merge pull request #451 from philips/use-the-right-port
fix(README): use 4002 not 4001
2014-01-07 15:58:20 -08:00
2dde2cbb6f fix(README): use 4002 not 4001
The default port is 4001 not 4002. Fix this.
2014-01-07 15:57:18 -08:00
88e0263d08 Add heartbeat and timeout threshold loggers. 2014-01-07 16:17:48 -07:00
28652ed7af Updated client matrix. 2014-01-07 00:49:28 -05:00
60c2680bfd fix(peer_server.go) init name field and update leader field 2014-01-07 12:30:20 +08:00
9a8bd96ad3 feat(Documentation/api): add a statistics section 2014-01-05 23:06:56 -08:00
66271fe986 chore(Documentation/api): remove some whitespace 2014-01-05 23:05:15 -08:00
1caa3245e6 feat(Documentation/api): add some intro material
add some intro material and normalize the headers to the rest of the
coreos/docs.
2014-01-05 23:04:27 -08:00
04720bd8bf Merge pull request #442 from philips/remove-ETCD_WEB_URL
chore(server): remove web url
2014-01-05 20:41:28 -08:00
ecc96df699 chore(server): remove web url
web URL is not longer used so remove it from tests and configuration
documents.
2014-01-05 20:39:39 -08:00
0b47d6888d Merge pull request #441 from lavagetto/matrix
docs(clients-matrix.md): Introducing the library features matrix.
2014-01-05 20:27:10 -08:00
e9b85264ab docs(clients-matrix.md): Introducing the library features matrix.
As support for etcd features is very uneven between different clients,
a feature matrix can help application developers to understand what a
client library can offer them, and also help client libraries
developers to understand what they should work on. I assessed the
features of all client libraries by looking at their master branch on
github, to the best of my knowledge.
2014-01-05 11:30:11 +01:00
d397e83a05 Merge pull request #440 from philips/splitup-README
feat(README): splitup the sections into individual files
2014-01-04 17:59:17 -08:00
801b642dea fix(Documentation): fixup headers
fixup the headers on the api and tuning sections
2014-01-04 17:58:39 -08:00
e7527ebb45 fix(README): link to the configuration file too 2014-01-03 14:39:23 -08:00
bfde27a99d feat(README): splitup the sections into individual files
The README is getting rather large so split it into individual files.

The next step will be rendering these into HTML pages with a TOC so that
they are a bit more navigable.

What do people think of this?
2014-01-03 14:37:53 -08:00
c65f8fc7ad Merge pull request #439 from lavagetto/master
docs(README.md): update client libraries and projects.
2014-01-03 10:29:12 -08:00
547c05685e Merge pull request #438 from robszumski/master
feat(docs): add cluster size guide
2014-01-03 10:28:59 -08:00
5794d70881 docs(README.md): update client libraries and projects.
This commit adds information about API version support for all
clients - clearly listing which clients support API v2.

Also, a new nodejs client is added, and a new project as well.
2014-01-03 17:34:18 +01:00
009b84c5fc feat(docs): add cluster size guide 2014-01-02 16:11:25 -08:00
b5426d967e Fix TOML. 2014-01-02 16:48:50 -07:00
60827ebd5a bump(code.google.com/p/go.net): d4afe896f927+ 2014-01-02 16:41:38 -07:00
ae10b6226d bump(github.com/gorilla/mux): 9ede152210fa25c1377d33e867cb828c19316445 2014-01-02 16:41:33 -07:00
d32fd00bbb bump(github.com/coreos/go-systemd): 05a794e41e912eca8ebe1538241815f80da76d69 2014-01-02 16:41:31 -07:00
7c29d5bf5c bump(github.com/coreos/go-log/log): 2014-01-02 16:41:31 -07:00
f37d9df118 bump(github.com/coreos/go-etcd): 9de519a68a870466f217c35f476ba658f1694bbe 2014-01-02 16:41:28 -07:00
7da85d66fd bump(github.com/coreos/raft): 20e384681d014100733dd69d287fe254d685f319 2014-01-02 16:41:27 -07:00
cf656ccfdd bump(github.com/BurntSushi/toml): 2fffd0e6ca4b88558be4bcab497231c95270cd07 2014-01-02 16:41:25 -07:00
d7087ed61a Merge branch 'master' of https://github.com/coreos/etcd into logging 2014-01-02 16:30:09 -07:00
98351b9756 Merge pull request #436 from thwarted/help-version-fixups
docs(server/config.go): minor formatting changes
2014-01-02 13:50:19 -08:00
5260c7c939 Merge pull request #434 from rwindelz/master
fix (scripts/release-version.ps1): fix windows build
2014-01-02 12:39:15 -08:00
78e2fc1bc8 Merge pull request #437 from bcwaldon/README-indexes
chore(README): Expand README with more info about indexes
2014-01-02 12:33:49 -08:00
c17ad07bdb chore(README): Expand README with more info about indexes 2014-01-02 11:35:17 -08:00
5b105ed156 fix deprecated option tests 2014-01-02 11:11:27 -06:00
af3240fa18 docs(server/config.go): minor formatting changes
When -version or -help are given, don't warn about having to derive
the data directory name.
Print warnings about deprecated options on separate lines so the log
isn't screwy.
2014-01-02 04:30:38 -06:00
45b4d6d194 fix(build.ps1): not required to be admin to run build in windows
mklink /D in windows requires elevated privilege (Runas Administrator),
'/J' to create a directory junction point runs with user privilege
use an explicit fully qualified path for junction target
2014-01-01 22:23:07 -08:00
04ad7a91dd fix (scripts/release-version.ps1): fix windows build
fix reflects changes made in commit
7670c85d70
2014-01-01 21:16:40 -08:00
fd0d0813ce Merge pull request #432 from btipling/fix_trimsplit
Trimsplit Wasn't using separator, more efficient.
2014-01-01 13:46:08 -08:00
5a4c41be37 Don't copy strings. 2014-01-01 13:44:04 -08:00
57f94f65a8 Merge pull request #433 from xiangli-cmu/prevNode
feat(node_extern.go) add prevNode field
2014-01-01 12:59:41 -08:00
189b98c03f refactor(node_extern.go) remove unused prevValue field 2014-01-01 20:01:29 +08:00
f46fdbf078 feat(node_extern.go) add prevNode field 2014-01-01 19:50:07 +08:00
ed2d7d64cd Trimsplit Wasn't using separator, more efficient. 2013-12-31 09:13:41 -08:00
cc10b1084d Merge branch 'master' of https://github.com/coreos/etcd into logging
Conflicts:
	tests/functional/simple_snapshot_test.go
2013-12-30 16:19:57 -07:00
c49711ae2c Merge pull request #429 from philips/README-remove-prevValue
fix(README): remove prevValue references in the README
2013-12-30 13:53:17 -08:00
b7be38da12 Merge pull request #430 from philips/remove-old-release-version
chore(release_version): remove this unused file
2013-12-30 13:52:44 -08:00
6b8b6cda66 Merge pull request #431 from btipling/master
Weird grammar, not sure I fixed it well enough.
2013-12-30 13:06:09 -08:00
850cbf6018 Weird grammar, not sure I fixed it well enough. 2013-12-30 12:49:19 -08:00
dcabc6ae80 chore(release_version): remove this unused file
Fixes #425
2013-12-30 11:37:32 -08:00
1ab3db18bb fix(README): remove prevValue references in the README
We plan on adding a PrevNode field in the Response object but it hasn't
been needed thus far. Discussion was here:

http://thread.gmane.org/gmane.comp.distributed.etcd/56

Fixes #428
2013-12-30 10:44:35 -08:00
8edc1f30d9 Merge pull request #424 from xiangli-cmu/fix_lock_doc
docs(README.md) fix wrong index value in lock section
2013-12-29 17:26:26 -08:00
5266968b61 docs(README.md) fix wrong index value in lock section 2013-12-30 09:24:18 +08:00
9bd36f173e Merge pull request #422 from dsoprea/master
Add documentation for enumerating sorted, in-order keys.
2013-12-29 10:09:01 -08:00
a9e20aecc6 Raft fixes, integrate logging. 2013-12-29 10:40:10 -07:00
e66f6d76e6 Modified doc. 2013-12-28 11:38:59 -05:00
c62603ba73 Added documentation for sorted listings. 2013-12-28 11:37:32 -05:00
4692d6e966 Merge pull request #421 from philips/README-api-versioning
feat(README): add an API versioning section
2013-12-28 07:33:13 -08:00
9049a2afd5 feat(README): add an API versioning section
Based on a question on the mailing list. Add a section about API
versioning.
2013-12-28 07:13:41 -08:00
bbbf8fd574 fix(watcher_hub.go) decrease count when remove a watcher 2013-12-28 15:51:16 +08:00
d66dc3c1c7 refactor(watcher_hub.go) refactor notifyWatchers() 2013-12-28 15:49:05 +08:00
59ccefee0f fix(watchhub.go) add a lock to protect the hashmap 2013-12-28 14:55:50 +08:00
3b485e20bb Merge pull request #419 from kula/fix-leader-documentation
fix(README): fixup leader docs
2013-12-27 22:48:31 -08:00
44af8ea190 bump(github.com/coreos/raft): ca61124b291fe38a2ab592a8b42f1423e3c31cc4 2013-12-27 15:24:37 -07:00
2504c4ad34 bump(code.google.com/p/goprotobuf): dd4df9b5c0cf 2013-12-27 15:23:35 -07:00
d447ba52ad fix(README): fixup leader docs
The leader module uses PUT to set a leader value and DELETE to delete one. Fix
the documents to reflect that.
2013-12-27 15:15:19 -05:00
5e499456f0 init cancel watcher 2013-12-26 22:06:15 +08:00
e96234382a Merge pull request #417 from philips/fixup-readme
fix(README): Remove excress backticks
2013-12-25 23:06:25 -08:00
78e2a27ee0 fix(README): Remove excress backticks 2013-12-25 19:28:43 -08:00
715b4d7bfc Merge pull request #408 from xiangli-cmu/compareAndDelete
Compare and delete
2013-12-25 13:16:27 -08:00
c36f306a1d test(delete_handler_test.go) fix inconsistent between test case and comments 2013-12-25 19:05:40 +08:00
bfa7d54b02 refactor(store.go) handle short condition first 2013-12-25 19:01:04 +08:00
4ff773aaaf bump(github.com/coreos/raft): 0c36c972a25343e7e353257284ef6df5c8676a3d 2013-12-23 16:08:10 -07:00
0611c81e88 bump(code.google.com/p/go.net): 127da548775d 2013-12-23 16:02:02 -07:00
6b4f7cf861 bump(github.com/coreos/go-etcd): d2eb551cc057fdaf9848d6130292187bb1368208 2013-12-23 16:01:54 -07:00
51406a3582 bump(github.com/coreos/raft): 0409b22a50cb2576318f294eba5c1092316dbea1 2013-12-23 16:01:53 -07:00
9ebac0b9fd bump(github.com/BurntSushi/toml): da57f3b4c85ec56cf139d7dc05396fa98a040773 2013-12-23 16:01:51 -07:00
4acfc26c5e Add event-based debugging output. 2013-12-23 16:01:05 -07:00
5271378fc2 Merge pull request #416 from drnic/patch-1
[readme] references to BOSH releases using etcd
2013-12-23 11:14:28 -08:00
5ab2f5454c [readme] references to BOSH releases using etcd 2013-12-23 09:49:24 -08:00
4748da1e09 Merge pull request #415 from philips/fix-lock-docs
fix(README): fixup lock docs
2013-12-23 05:53:23 -08:00
c3b4d10b74 fix(README): fixup lock docs
I thought that @benbjohnson had changed the lock "value" to "name" but
that doesn't look to be the case. It is OK, just fix the docs.
2013-12-22 22:03:07 -08:00
f026d1c14e Merge pull request #414 from philips/getting-started
fix(README): we are building containers too
2013-12-22 20:43:19 -08:00
e30bf19684 fix(README): we are building containers too
We are building a docker container now too so don't get specific about
just the binary.

I thought about adding instructions to the README but lets just keep
following the pattern of putting version getting started guides on the
release page.
2013-12-22 20:13:02 -08:00
d4553714d9 Merge pull request #413 from philips/event_history
fix(event_history): fix a bug in event queue
2013-12-22 15:48:31 -08:00
e1d909eb0e test(store/event_test): add a test for a full queue 2013-12-22 15:42:51 -08:00
317b34f4a0 refactor(store/event_history): cleanup some comments 2013-12-22 15:42:10 -08:00
0937b4d266 refactor(event_history.go) remove the extra logic 2013-12-22 15:42:10 -08:00
ef988020b7 fix(event_history) fix a bug in event queue 2013-12-22 15:42:10 -08:00
70c8c09360 Merge pull request #412 from mojotech/cas/403-proper-http-statuses
Use more appropriate HTTP status codes for error cases.
2013-12-21 20:29:40 -08:00
d89fa131ab feat(v2/errors): Use more appropriate HTTP status codes for error cases.
This commits adds test coverage for all the error and non-error cases
described below, but only the behavior of the 403, 404 and 412 cases
are changing in this commit.

When setting a key results in a new resource, we asset an HTTP status
code of 201 (aka "Created").

When attempting to get a resource that doesn't exist, we assert an
HTTP status code of 404 (aka "Not Found").

When attempting to delete a directory without dir=true, or a non-empty
directory without recursive=true, but the request is otherwise valid,
we assert an HTTP status code of 403 (aka "Forbidden").

When a precondition (e.g. specified by prevIndex, or prevValue) is not
met, but the request is otherwise syntactically valid, we assert an
HTTP status code of 412 (aka "Precondition Failed").  However,
prevExist is handled slightly differently.  If prevExist=false fails,
then this is treated like a failed precondition, so it should use
PreconditionFailed.  But, if prevExist=true fails, then this is
treated like other requests that require the existence of the
resource, and uses NotFound if the resource doesn't exist.

We continue to assert an HTTP status code of 400 when the request is
syntactically invalid (e.g. when prevIndex=bad_index).
2013-12-21 21:39:19 -05:00
3f85829e87 fix(v2/tests): make comments and tests agree about what's being tested
In cases where the comments were incorrect, this changes them to agree
with the tests.  In cases where the comments were correct, this extends
the tests to cover the behavior described in the comment.
2013-12-21 21:39:19 -05:00
3cde996d21 refactor(v2/tests): don't repeat construction of full test URL 2013-12-21 21:39:19 -05:00
39fb266776 fix(error.go): fix typo in comment 2013-12-21 21:39:19 -05:00
557ffbb861 Merge pull request #411 from xiangli-cmu/bench
Bench
2013-12-21 14:16:08 -08:00
ddcf3975ed fix bench 2013-12-21 16:44:28 +08:00
cc88215b46 fix(bench): initial commit 2013-12-20 15:19:02 -08:00
3bd2d0da88 bump(code.google.com/p/goprotobuf): 8ba95f2a7335 2013-12-20 15:39:30 -07:00
b7854354ff bump(code.google.com/p/go.net): a1b606ad6242 2013-12-20 15:39:29 -07:00
80bc68eb49 bump(github.com/stretchr/testify/mock): 2013-12-20 15:39:26 -07:00
8c8ab6a4cb bump(github.com/gorilla/mux): 9ede152210fa25c1377d33e867cb828c19316445 2013-12-20 15:39:24 -07:00
985db7838c bump(github.com/gorilla/context): a08edd30ad9e104612741163dc087a613829a23c 2013-12-20 15:39:23 -07:00
04c98d0a75 bump(github.com/coreos/go-systemd): 700560af03f8e1df35839041745c9f1fccba7c72 2013-12-20 15:39:22 -07:00
53436af899 bump(github.com/coreos/go-etcd): 925b981b19b370a2fe073c2395e8f76cfc241124 2013-12-20 15:39:19 -07:00
81a73dbc80 bump(github.com/coreos/raft): ac7be58b1bec49dfcfc7216df4ae27173da1fa57 2013-12-20 15:39:17 -07:00
c4179829d6 tests(get_handler) loosen the time assumption for the un 2013-12-20 08:23:50 +08:00
9cf1fcc987 refactor(compareAndDelete) 2013-12-20 05:10:22 +08:00
e2fa89d554 merge compareAndDelete 2013-12-19 22:19:49 +08:00
75c02ed0da Merge pull request #405 from benbjohnson/tuning
Add Tuning section to README.
2013-12-18 15:42:16 -08:00
c7536ff5e1 Add Tuning section to README. 2013-12-18 16:40:29 -07:00
fd8ce5d11a Merge pull request #398 from benbjohnson/mod-leader
mod/leader
2013-12-16 14:55:11 -08:00
838645f1b7 Merge pull request #402 from philips/add-header-docs
feat(README): document the etcd request headers
2013-12-16 12:44:49 -08:00
4fb8e79237 Merge pull request #404 from philips/add-cetcd
feat(README): add cetcd
2013-12-16 10:38:01 -08:00
c352db9acd feat(README): add cetcd 2013-12-16 10:37:26 -08:00
60813103e3 Merge pull request #401 from philips/add-dir-docs
feat(README): add notes about in-order key creation
2013-12-16 10:30:32 -08:00
d816db07e3 feat(README): add directory tutorial 2013-12-16 10:30:13 -08:00
296eaf7b34 Add leader module to README. 2013-12-16 08:00:16 -07:00
2ce587ebc7 Merge branch 'master' of https://github.com/coreos/etcd into mod-leader 2013-12-16 07:47:31 -07:00
18bf886368 feat(README): document the etcd request headers 2013-12-15 21:45:10 -08:00
1de78fef4d feat(README): add notes about in-order key creation 2013-12-14 13:08:02 -08:00
54794d57fe Merge pull request #400 from philips/add-lock-docs2
fix(README): cleanup lock documentation
2013-12-13 15:07:56 -08:00
412f56f971 fix(README): cleanup lock documentation
accidently merged this without any review. Here are some more cleanups.
2013-12-13 15:07:39 -08:00
e87ee6a86b Merge pull request #399 from philips/add-lock-docs
feat(README): add a modules section to the README
2013-12-13 15:02:37 -08:00
418eccb3d7 feat(README): add a modules section to the README 2013-12-13 15:02:25 -08:00
61227d7477 mod/leader 2013-12-13 15:25:03 -07:00
931ae5fec3 Merge pull request #397 from philips/fixups-for-the-dashboard
Two dashboard fixups
2013-12-13 12:47:00 -08:00
bcf692d775 chore(mod/dashboard): rebuild to the latest version 2013-12-13 12:44:24 -08:00
7e5aa3137d fix(server/registry): use url.Value.Encode()
Instead of open coding url encoding which lead to error, make it real
and use the library.
2013-12-13 12:43:01 -08:00
e24d2fdb6c fix(mod/dashboard): fix after api changes
use node instead of kvs and value
2013-12-13 12:36:29 -08:00
fe80a868a0 Merge pull request #396 from ccding/master
gofmt for ./server ./test
2013-12-12 15:00:41 -08:00
468bfedf34 gofmt 2013-12-12 14:53:22 -08:00
5e1fdf554d Merge pull request #389 from philips/document-ttl-directories
feat(README): add directory TTL documentation
2013-12-12 11:38:49 -08:00
d204fa8438 Merge pull request #394 from xiangli-cmu/fix_error_msg
fix(store.go) report node.path
2013-12-12 10:13:01 -08:00
dba5eb57cf fix(store.go) report node.path 2013-12-12 10:12:33 -08:00
0399593589 Merge pull request #393 from xiangli-cmu/fix_index
fix(dispatch) should call e.Index()
2013-12-12 09:57:16 -08:00
36dda352d9 fix(dispatch) should call e.Index() 2013-12-12 09:56:28 -08:00
44f050f59a Merge pull request #384 from benbjohnson/refactor-mod-lock
Refactor mod/lock.
2013-12-11 19:34:26 -08:00
3caf7745b6 2013-12-11 20:24:43 -07:00
c1508becd6 Merge pull request #390 from xiangli-cmu/fix_v1_index_inconsistence
fix index inconsistence in v1 api
2013-12-11 11:24:53 -08:00
a5bca025b1 fix index inconsistence in v1 api 2013-12-11 11:12:39 -08:00
bb64e7b6e5 feat(README): add directory TTL documentation 2013-12-11 10:47:00 -08:00
f66bd1689d Merge pull request #387 from xiangli-cmu/fix_expire_notify
Fix expire notify
2013-12-11 10:23:53 -08:00
3e4f8a382e fix TestV2WatchKeyInDir test 2013-12-11 10:19:16 -08:00
44b08fea62 Merge branch 'add-expire-dir-test' of https://github.com/philips/etcd into fix_expire_notify 2013-12-11 09:57:34 -08:00
74bd0d95b8 fix(server): try and add a expire dir test
This doesn't actually work yet.
2013-12-10 16:32:37 -08:00
f83e76eb60 Merge https://github.com/coreos/etcd into fix_expire_notify 2013-12-10 15:18:00 -08:00
06473ba6fe fix(store.go) expire should also notify all the watchers under the path 2013-12-10 15:17:13 -08:00
cb9f677cf6 chore(server): cleanup some whitespace 2013-12-10 11:13:37 -08:00
9ea1ef8916 hack(travis): temporarily fix travis
try a quick workaround for https://github.com/travis-ci/travis-ci/issues/1727
2013-12-09 21:46:55 -08:00
dd354c9e22 Merge pull request #376 from xiangli-cmu/dir_flag
feat add dir_flag
2013-12-09 08:34:57 -08:00
59e98fcc62 doc fix grammar issue 2013-12-09 11:33:55 -05:00
4bec461db1 Refactor mod/lock. 2013-12-08 15:26:58 -07:00
8442e7a0dc Timeout refactor. 2013-12-07 14:35:31 -07:00
aabd0faebe Merge branch 'feature-parametric-timeout' of https://github.com/neildunbar/etcd into neildunbar-feature-parametric-timeout 2013-12-07 14:07:53 -07:00
31bc0bb670 Merge pull request #380 from bcwaldon/drop-prevValue
fix(v2): Drop prevValue from exported fields
2013-12-06 14:11:01 -08:00
0fb8fc0b8d fix(v2): Drop prevValue from exported fields 2013-12-06 11:46:23 -08:00
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
5edaee79e6 Merge pull request #363 from xiangli-cmu/fix_consistent_redirection
fix redirect url should include rawquery
2013-12-05 20:33:56 -08:00
0762c79e2e refactor remove unused const 2013-12-05 21:04:00 -05:00
d646d7c16a tests add tests for dir flag 2013-12-05 20:46:52 -05:00
1a7eb36b6f Merge pull request #372 from philips/bind-addr-ports
fix(server): override port of bind
2013-12-05 15:29:37 -08:00
9db521ca04 fix(server): override port of bind
Allow people to specify ports on the `-bind-addr` arguments so that they
can use randomly assigned port numbers in containers.
2013-12-05 15:29:25 -08:00
e00296960c test fix tests 2013-12-05 18:16:01 -05:00
c305eda344 docs(delete_command.go) document about recursive implies dir 2013-12-05 17:52:32 -05:00
636dad190e refactor(error.go) error messages 2013-12-05 17:50:20 -05:00
b556252358 tests fix all tests 2013-12-05 17:48:32 -05:00
4ba7d85d56 refactor(update) more clear dir checking 2013-12-05 17:16:44 -05:00
40d297be66 feat add dir_flag 2013-12-05 17:10:37 -05:00
d971d22849 Merge pull request #375 from philips/fix-reset
fix(etcd): Fix forced config reset
2013-12-05 13:26:57 -08:00
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
af20be8123 Merge pull request #347 from benbjohnson/mod-lock
WIP: mod/lock
2013-12-05 10:59:32 -08:00
70e31c71f3 Merge pull request #371 from polvi/dockerfile
fix(Dockerfile): remove bogus -bind-addr, and use default -addr
2013-12-05 10:50:34 -08:00
b22c6fed4d fix(Dockerfile): remove bogus -bind-addr, and use default -addr 2013-12-05 18:07:51 +00:00
0867b33de5 fix(Dockerfile): reverted unneeded changes
fix(server/config.go): ensured params are changeable from config file and env
fix(server/server.go): removed unnecessary debug line
fix(server/timeout.go): removed a commented block
style(server/transporter.go): put explicit vars to replace timeout expressions
style(tests/server_utils.go): ran gofmt to clean up indenting
2013-12-05 09:23:23 +00:00
b784ced517 Update mod/lock versioning. 2013-12-04 22:39:59 -07:00
5d865e321c Merge branch 'master' of https://github.com/coreos/etcd into mod-lock
Conflicts:
	server/v2/tests/delete_handler_test.go
	server/v2/tests/get_handler_test.go
	server/v2/tests/post_handler_test.go
	server/v2/tests/put_handler_test.go
	third_party/github.com/coreos/go-etcd/etcd/requests.go
2013-12-04 22:36:53 -07:00
e76b7d1e8b Add mod/lock version. 2013-12-04 22:24:04 -07:00
f3d438a93f Add mod/lock connection monitoring. 2013-12-04 16:23:27 -07:00
618def7ab0 Merge pull request #369 from philips/format-json
fix(README): prettify json
2013-12-04 13:50:05 -08:00
7ec3f861e4 fix(README): prettify json
fixed using vim and python -m json.tool
2013-12-04 13:48:38 -08:00
67f3fc349c Merge pull request #368 from philips/cleanup-responses
fix(README): use the new response format
2013-12-04 12:22:19 -08:00
0dc428b5d6 fix(README): use the new response format
update all of the examples to use the new response format.
2013-12-04 12:06:41 -08:00
faab194247 Fixed test case 2013-12-04 17:39:03 +00:00
46f8a354d1 Added the ability to specify heartbeat and election timeouts as
config parameters.
2013-12-04 16:58:44 +00:00
e4f1e22401 Merge pull request #357 from philips/add-osx-curl-note
chore(README): add note about curl on OSX
2013-12-03 22:35:55 -08:00
aa4660d780 chore(README): add note about curl on OSX
Discussion about this issue here:
https://groups.google.com/forum/#!topic/munki-dev/oX2xUnoQEi4
2013-12-03 22:35:13 -08:00
ded3cc24c0 fix redirect url should include rawquery 2013-12-02 22:53:36 -05:00
73f04d5cec Merge pull request #343 from xiangli-cmu/refactoring_event
Refactoring event
2013-12-02 19:48:23 -08:00
c6e1af8321 merge master 2013-12-02 22:36:38 -05:00
7875ba28c9 Merge pull request #360 from philips/fix-peerurl
fix(server/v2): redirect to ClientURL not PeerURL
2013-12-02 19:02:58 -08:00
d5e4aef6c2 Merge pull request #361 from philips/cleanup-peers-usage
cleanup-peers-usage
2013-12-02 19:01:18 -08:00
6729776e25 fix(server/usage): fixup the usage based on feedback
People were getting confused by the lack of explanation on which port to
use. Fix this.

/cc @polvi
2013-12-02 18:41:03 -08:00
72bf216cb4 fix(server/v2): redirect to ClientURL not PeerURL
If consistent is set you must redirect the client to the leader's
ClientURL not the PeerURL.
2013-12-02 18:20:11 -08:00
df20be775c Fix test harness. 2013-12-02 15:43:37 -07:00
cfb6eb6e50 Merge pull request #355 from xiangli-cmu/root_readonly
WIP fix root should be rdonly
2013-12-02 10:27:02 -08:00
e34d368a3e Merge pull request #354 from philips/fixup-prevExist-README
feat(README): add a prevExist example
2013-12-01 15:24:45 -08:00
b929e71948 tests add root readonly test 2013-12-01 18:16:32 -05:00
6252037376 fix root should be rdonly 2013-12-01 18:01:24 -05:00
577d08ea7d Merge pull request #352 from xiangli-cmu/fix_watch_prefix
fix(event_history.go) should not scan prefix
2013-12-01 14:40:15 -08:00
78e382cb6b test add watcher prefix test 2013-12-01 17:35:22 -05:00
fc562bd625 fix tests bump deps 2013-12-01 17:24:30 -05:00
1d02a70802 feat(README): add a prevExist example
On the mailing list Dustin Oprea suggested adding a prevExist concrete
example would make it more clear that the value must be true or false.
2013-12-01 13:28:08 -08:00
3d16633a94 update the v2 server to support recursive on CompareAndDelete events 2013-12-01 13:56:32 -07:00
d2d7e37990 implement recursive for CompareAndDelete in the store 2013-12-01 13:38:09 -07:00
f8985d731f keep the Delete tests together 2013-12-01 13:28:14 -07:00
ff081dca88 Merge pull request #353 from baruch/patch-1
Fix spelling mistakes in internal-protocol-versioning.md
2013-12-01 08:52:13 -08:00
cc9c75acbe fix(README): repair some noisy spaces 2013-11-30 22:46:12 -08:00
08dffe85d6 Fix spelling mistakes in internal-protocol-versioning.md 2013-12-01 08:35:56 +02:00
5097a2adee fix(event_history.go) should not scan prefix 2013-12-01 00:47:23 -05:00
373199fe46 support CreateAndDelete through the v2 server 2013-11-30 16:25:26 -07:00
171072c736 add the CompareAndDelete command 2013-11-30 16:24:23 -07:00
90a8f56c96 add compareAndDelete event action 2013-11-30 10:08:25 -07:00
5b739f6166 track CompareAndDelete stats 2013-11-30 10:05:48 -07:00
702cf1cc36 teach store.Store about CompareAndDelete 2013-11-30 10:02:03 -07:00
7997fdc76f Merge pull request #330 from philips/fixup-readme-remove-v1
fix(README): fix 9 instances of v1
2013-11-29 22:28:02 -08:00
2a5030b3ca fix(README): fix 9 instances of v1
remove references to the v1 API and consistently use the v2 API.
2013-11-29 22:26:52 -08:00
d5172849bc Merge pull request #342 from philips/use-machine-nomenclature
fix(README): use machine instead of node
2013-11-29 16:57:28 -08:00
03571d3cda Merge branch 'master' of https://github.com/coreos/etcd into mod-lock 2013-11-29 16:34:04 -07:00
d8e9838c38 Lock testing. 2013-11-29 16:33:49 -07:00
67b4c27d5d refactor change node_repr to node_extern 2013-11-28 21:34:38 -05:00
b7d07ea5c8 refactor event 2013-11-28 11:33:40 -05:00
08c59895b5 refactor(Node) do not expose node struct 2013-11-28 11:33:23 -05:00
22c2935ddb Initial mod_lock acquire. 2013-11-27 16:59:05 -07:00
978cb54fc7 fix(README): use machine instead of node
Internally we call every member of an etcd cluster a "machine" so stay
consistent when talking in the README.
2013-11-27 14:37:31 -08:00
d3a83805cc fix(README): link to etcdctl directly
link to the etcdctl homepage directly
2013-11-27 14:29:41 -08:00
e41b86fd68 Merge pull request #341 from philips/fixup-name-and-data-dir-guessing
fix(etcd): fixup the name and data dir guessing
2013-11-27 14:26:02 -08:00
74ad50efa6 Merge branch 'master' of https://github.com/coreos/etcd into mod-lock
Conflicts:
	mod/mod.go
2013-11-27 14:47:13 -07:00
32861246b9 mod/lock 2013-11-27 14:36:14 -07:00
0344e759d9 Merge pull request #340 from philips/add-rthomas-clj-etcd
feat(README): add clojure client rthomas/clj-etcd
2013-11-27 12:25:28 -08:00
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
da666d9143 feat(README): add clojure client rthomas/clj-etcd 2013-11-27 09:11:00 -06:00
c93f086032 Merge pull request #329 from philips/remove-redundant-datadir-code
fix(etcd): remove duplicate DataDir setup
2013-11-26 13:20:29 -08:00
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
0ed3509ec1 Merge pull request #324 from philips/redirect-mod-dashboard-trailing-slash
fix(mod): redirect dashboard to /dashboard
2013-11-26 08:15:33 -08:00
64e49726cd fix(mod): redirect dashboard to /dashboard 2013-11-23 23:31:28 -08:00
b4f3d02c1c Merge pull request #322 from xiangli-cmu/master
bump deps
2013-11-22 14:18:17 -08:00
a607c9eace fix dep issue 2013-11-22 13:27:04 -08:00
4520705bdf Merge pull request #320 from philips/add-cors-options
feat(server): introduce a cors handler
2013-11-22 11:53:45 -08:00
40a574a8ca wip commit 2013-11-22 11:32:24 -08:00
522a833ab2 bump go-etcd 2013-11-22 11:31:46 -08:00
8a0496cfae bump deps 2013-11-22 08:59:24 -08:00
b190c4250a chore(mod/dashboard/resources): use the latest version of the code 2013-11-21 17:23:40 -08:00
4c06e19cf2 fix(mod/dashboard): grab the leader URL
query etcd to find the URL of the leader before making any http requests
that can't be redirected from a browser like PUT/POST and DELETE.
2013-11-21 17:12:58 -08:00
a1ec895b91 feat(server): introduce a cors handler
Introduce a handler that lives under the gorilla mux and adds the
correct headers based on the request and always returns 200 OK when
there OPTIONS is called on a URL.

This fixes the ability to DELETE from the dashboard on peer X when peer
Y is the leader. As a side effect it reveals some bugs in the dashboard
though notably:

- Due to the RTT immediatly refreshing the dashboard doesn't work and
  deleted keys are still there

- For some reason PUTS from peer X are creating directories and not
  keys.
2013-11-21 09:25:21 -08:00
68e7455374 Merge pull request #317 from benbjohnson/fix-help-flag
Config clean up and usage messaging.
2013-11-20 10:35:55 -08:00
ea6b11bbf6 Config clean up and usage messaging. 2013-11-20 10:52:01 -07:00
228754a99c mod_lock 2013-11-19 16:12:58 -07:00
fca8506331 Merge pull request #312 from benbjohnson/clean-up-config
Renamed Configuration Parameters
2013-11-19 13:49:40 -08:00
15eee885d7 Merge branch 'master' of https://github.com/coreos/etcd into clean-up-config 2013-11-19 10:13:39 -07:00
a414b15f9a Config fixes. 2013-11-19 09:20:20 -07:00
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
01a0f79efb Merge pull request #314 from xiangli-cmu/fix-content-type
fix set content-type to application/json
2013-11-16 20:50:36 -08:00
1d34c82643 fix set content-type to application/json 2013-11-16 20:48:44 -08:00
cba2611c68 Renamed configuration parameters. 2013-11-15 00:13:32 -05:00
48f5a47ff1 Merge pull request #310 from xiangli-cmu/master
test fix wrong assumption should be previous index + 501 + 6
2013-11-14 20:20:57 -08:00
4f45de6953 test fix wrong assumption should be previous index + 501 + 6 2013-11-14 20:22:25 -08:00
1c1d3dd708 Merge pull request #309 from xiangli-cmu/master
fix create folder before write info file
2013-11-14 20:11:22 -08:00
e90937a2b4 tests loosen the ttl checking 2013-11-14 20:09:12 -08:00
516f249403 fix create folder before write info file 2013-11-14 20:00:44 -08:00
3ce1132d5c Merge pull request #305 from philips/cherry-pick-lost-changes
feat(README): add an erlang library marshall-lee/etcd.erl
2013-11-13 20:44:31 -08:00
39e4e0c3d9 feat(README): add an erlang library marshall-lee/etcd.erl 2013-11-13 20:39:40 -08:00
5747b3b401 fix(README): cleanup a bad merge 2013-11-13 20:37:46 -08:00
f499100426 Merge branch 'master' of https://github.com/benbjohnson/etcd into benbjohnson-master
Conflicts:
	README.md
2013-11-13 22:38:06 -05:00
aa047b124d v0.2.0-rc1 2013-11-13 22:34:13 -05:00
256a0428dd CHANGELOG 2013-11-13 21:56:02 -05:00
d9c7796d56 Merge pull request #303 from philips/fixup-certificates
fix(fixtures/ca): make the certificates work
2013-11-13 11:56:36 -08:00
b3704a7119 fix(fixtures/ca): make the certificates work
Something was wrong with the old certificates. Rebuild them to get them
all working.
2013-11-13 11:45:20 -08:00
a5402435b9 Merge pull request #301 from philips/use-directory-based-on-machine-name
feat(etcd): create unique directory on no-flag case
2013-11-13 11:23:19 -08:00
6066862c34 Merge pull request #299 from benbjohnson/release
README
2013-11-13 11:22:31 -08:00
a0bfe411f8 Merge pull request #298 from benbjohnson/migration-test
Migration test
2013-11-13 10:19:33 -08:00
eecd9f7e35 feat(etcd): create unique directory on no-flag case
Tell etcd to store the log and configuration into directory in the
pattern of `${machineName}.etcd` if no directory is specified.
2013-11-13 10:16:02 -08:00
5057036563 Merge pull request #300 from philips/remove-etcd-from-mod
refactor(mod): remove the /etcd/ prefix
2013-11-13 07:13:16 -08:00
ca7e61052d refactor(mod): remove the /etcd/ prefix
Originally we were going to move all of the API endpoints to /etcd/ so
that you could move etcd traffic over a multiplexed HTTP proxy with
other service but since we don't have a strong use case for this just
remove this for now.
2013-11-13 06:15:35 -08:00
df00306a71 README 2013-11-12 21:28:51 -05:00
954217fb73 Fix v1 cluster migration test. 2013-11-12 19:27:29 -05:00
ccc27a61f5 Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-12 17:29:58 -05:00
5abbaf59e3 Merge pull request #292 from xiangli-cmu/fix-ttl
WIP: fix ttl
2013-11-11 21:30:32 -08:00
811c577fe8 test stop mockSync goroutines 2013-11-11 21:31:12 -08:00
fe5fb6cfba style naming the initialization fields for sync command 2013-11-11 21:21:50 -08:00
8b2e1025ef style remove the extra space 2013-11-11 21:19:30 -08:00
d8157472fe Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-11 18:12:24 -05:00
b988f5b323 chore(CONTRIBUTING): make the allowed types a list
The list was formatted as one long sentence. Fix that.
2013-11-11 11:57:38 -08:00
e427c85f03 refactor add debug info to remove_node test 2013-11-09 21:31:17 -08:00
27157e5e78 fix tests 2013-11-09 21:17:32 -08:00
cb4b6f1fe4 feat add modifiedIndex in kvpair 2013-11-09 20:52:06 -08:00
06f1b7f2e8 refactor change Index to modifiedIndex 2013-11-09 20:49:19 -08:00
d8e5994c35 feat attach etcd-index,raft-index,raft-term to header 2013-11-09 20:20:47 -08:00
e397e807ca Merge pull request #297 from philips/add-trello
feat(README): add link to trello
2013-11-09 19:45:51 -08:00
fcba6436e8 feat(README): add link to trello 2013-11-09 19:24:37 -08:00
d87e0e93d3 fix get return the last modified index of the node 2013-11-09 19:05:38 -08:00
eca433cee5 fix add sync_command.go 2013-11-09 18:59:43 -08:00
6156d5c790 refactor separate etcd index from raft index 2013-11-09 17:55:54 -08:00
fc25ef8383 Merge pull request #246 from philips/add-dashboard-0.2
0.2: add the dashboard
2013-11-09 13:06:04 -08:00
84be60c920 feat(dashboard): use all of the latest js/css
rebuild all of the js and css as go binaries
2013-11-08 17:48:02 -08:00
bfe33bd3c4 feat(dashboard): have stats use the v2 API 2013-11-08 17:45:55 -08:00
c91cb72ee2 feat(dashboard): have browser use the v2 api 2013-11-08 17:41:04 -08:00
d045f43cda bug(css): Reset line-height to prevent jumping 2013-11-08 16:59:58 -08:00
7ca09579c2 feat(dashboard): Sort machine list to prevent jumping 2013-11-08 16:59:52 -08:00
4fab919fcb fix(dashboard): use a more memory friendly bindata 2013-11-08 16:59:37 -08:00
5620f88635 feat(server): insert the mod path 2013-11-08 16:59:30 -08:00
0372cdea23 refactor move sync command into etcd 2013-11-08 16:00:58 -08:00
56bbab74ca bug(back button): back button now is disabled when invalid 2013-11-08 14:09:36 -08:00
59b2eb4618 feature(selection): prevent selection of non-text elements with CSS 2013-11-08 14:09:36 -08:00
98d1209ca2 chore(dashboard) update color ranges 2013-11-08 14:09:35 -08:00
d12f97c8cf chore(dashboard): Remove restangular 2013-11-08 14:09:35 -08:00
713d50951b fix(dashboard): fix bug in toggling views 2013-11-08 14:09:35 -08:00
40142cbacc feat(dashboard): Notate leader in machine list 2013-11-08 14:09:35 -08:00
478118497c A little lit bit easy to read
I have only reordered to parameters to be according to the first instance executed.
2013-11-08 14:09:35 -08:00
cc9b5fca90 feat(README): add go-discover 2013-11-08 14:08:39 -08:00
b7084fda45 docs(dashboard): improve instructions 2013-11-08 14:08:39 -08:00
8540249c4e Update README.md 2013-11-08 14:08:39 -08:00
b54a6a2ac8 Update README.md 2013-11-08 14:08:39 -08:00
f62095428f Update README.md 2013-11-08 14:08:39 -08:00
3f5c39afd9 fix(mod/dashboard): bump the resources
bump all of the resources to get the new delete_key fix.
2013-11-08 14:08:39 -08:00
4005312ee5 feat(scripts): add build-release script 2013-11-08 14:08:39 -08:00
677590feb7 docs(dashboard): add instructions to get started 2013-11-08 14:08:39 -08:00
fa1b00cf91 chore(mod/dashboard): remove fmt package
Always build before pushing to origin master! Sorry for this noise. I
deleted the debug message but not fmt.
2013-11-08 14:08:39 -08:00
b819bb1c8c chore(mod/dashboard): remove debug line
Oops, this debug line made it into the tree. Remove it.
2013-11-08 14:08:39 -08:00
26806a10fc fix(mod/dashboard): use deleteKey() not delete_key()
small bug I overlooked while refactoring all of the dashboard function
names to be more "javascripty"
2013-11-08 14:08:39 -08:00
55356465c6 feat(mod/dashboard): add cleaner urls for stats and browser
you can hit them at:

- http://localhost:4001/etcd/mod/dashboard/stats
- http://localhost:4001/etcd/mod/dashboard/browser
2013-11-08 14:08:38 -08:00
bb275e3f45 Including clojure library 2013-11-08 14:08:38 -08:00
0c676ac93a feat(mod): introduce the /etcd/mod namespace
introduce the `/etcd/mod` namespace and add the dashboard into it.
2013-11-08 14:05:38 -08:00
26c24dd889 Add confd to list of projects using etcd 2013-11-08 14:05:30 -08:00
ae05a9f003 feat(mods): add README file 2013-11-08 14:05:30 -08:00
5e604b7a18 chore(dashboard): move to the mod directory 2013-11-08 14:05:29 -08:00
13f7257dd7 fix(dashboard): add moment to bower dependencies 2013-11-08 14:05:29 -08:00
6e278294af fix(dashboard): add d3 to bower 2013-11-08 14:05:29 -08:00
8acaf71a59 feat(dashboard): introduce the in memory handler
the in memory handler gives etcd the ability to serve a dashboard
without on disk resources. This is the first time we are using the
/mod/ path too.

TODO: cleanup the mod stuff so it isn't hacked into etcd_handlers.
2013-11-08 14:05:29 -08:00
af3804d728 feat(dashboard): inital commit of resources package 2013-11-08 14:05:16 -08:00
b2d72b3e55 bump(github.com/jteeuwen/go-bindata): 79847ab3e91ae5d2e1b18796c1795c78f29565d7 2013-11-08 14:05:16 -08:00
53678ad134 feat(dashboard): Initial commit of frontend code 2013-11-08 14:04:51 -08:00
bf5f0ab3f2 feat(dashboard/README): initial commit 2013-11-08 14:04:51 -08:00
6a074d4f6f chore(*.go): add copyright notice 2013-11-08 14:04:15 -08:00
acd940a450 refactor comments on IsPermanent 2013-11-08 13:37:30 -08:00
5a4e764d7a refactor add comments for receiving expire commands 2013-11-08 13:24:23 -08:00
b4f4528ef4 feat upgrade get_handler 2013-11-07 22:29:15 -08:00
28ac516f68 fix sinceIndex 2013-11-07 20:55:26 -08:00
41695eb1c8 Merge pull request #296 from cloudaice/patch-1
Update README.md
2013-11-07 19:37:25 -08:00
64875d39b0 Update README.md
fixed mistake
2013-11-08 11:36:10 +08:00
4c1d864095 fix cleanup 2013-11-06 21:27:39 -08:00
c307b6abca fix watcher_hub 2013-11-06 21:19:37 -08:00
55058c64f5 feat wathch for expiring need to be pending 2013-11-05 23:30:48 -08:00
779195eb4f fix bug in update ttl 2013-11-05 22:18:54 -08:00
49c55477e5 refactor clean up 2013-11-05 21:56:21 -08:00
797d996535 init sync to delete expiring keys 2013-11-05 21:47:25 -08:00
8c6606ed12 Fix TTL migration issue. 2013-11-05 15:57:53 -07:00
1d49098954 feat add heap top 2013-11-04 22:13:26 -08:00
07b52ee24c fix save and recovery 2013-11-04 21:51:14 -08:00
0d8510df33 refactor use push 2013-11-04 21:36:05 -08:00
efe431ead0 refactor add push/pop function 2013-11-04 21:33:23 -08:00
c5a6f9bb6b fix iszero 2013-11-04 21:22:22 -08:00
3f6d6cf4c6 refactor use time.IsZero 2013-11-04 20:56:41 -08:00
c05df9e3f5 refactor add newTTLKeyHeap function 2013-11-04 20:31:24 -08:00
d3bfc49b7c Remove leading slash from handlers. 2013-11-04 14:36:20 -07:00
35d9719707 Add v1.solo migration fixture. 2013-11-04 13:56:02 -07:00
6b5d6ecd8b Cluster migration test. 2013-11-04 13:46:43 -07:00
bf76af8fd1 Update migration. 2013-11-04 13:16:45 -07:00
b9593b80ec feat add update heap test 2013-11-03 23:51:48 -08:00
5394c8a894 feat add ttl heap 2013-11-03 23:34:47 -08:00
51f57629f9 Merge pull request #281 from xiangli-cmu/fix-snapshot
fix snapshot
2013-11-03 21:10:53 -08:00
235ffc234d refactor change cmd argument snapCount to snapshotCount 2013-11-03 21:06:51 -08:00
52d5e05201 refactor use defer 2013-11-03 20:59:08 -08:00
3d4e604607 Merge branch '0.2' of https://github.com/coreos/etcd into migration-test 2013-11-03 16:03:20 -07:00
44356dc654 Update migration script. 2013-11-03 16:02:59 -07:00
3a29ce4d17 Update migration. 2013-11-03 15:58:16 -07:00
02abbb6a6c Migration test. 2013-11-03 15:49:00 -07:00
71a73d3904 Merge pull request #290 from xiangli-cmu/feat-use-raft-protobuf
feat use-raft-protobuf
2013-11-03 10:52:37 -08:00
e951b99bdd Merge pull request #291 from xiangli-cmu/master
feat use protobuf for 0.1.2
2013-11-03 10:51:25 -08:00
63768e3742 feat use protobuf 2013-11-03 09:15:02 -08:00
f3ce75f2b4 feat add a simple speed test 2013-11-02 22:05:44 -07:00
eb2fbcb575 feat use-raft-protobuf 2013-11-02 21:50:35 -07:00
fa0cd3ae87 Merge pull request #288 from bcwaldon/fix-readme
Fix typos in README.md
2013-11-02 14:30:00 -07:00
8aeb4121cf Merge pull request #287 from bcwaldon/vagrantfile
Add Vagrantfile
2013-11-02 14:29:17 -07:00
9f3524fd11 Fix typos in README.md 2013-11-02 14:10:51 -07:00
6f054827a3 Add Vagrantfile 2013-11-02 13:09:22 -07:00
3062aab44f Merge pull request #268 from xiangli-cmu/0.2-readme
update readme
2013-11-01 16:04:36 -07:00
ae615eda62 fix typo 2013-11-01 15:56:38 -07:00
0c4b45d4fb Merge pull request #283 from philips/use-hostname-as-machine-name
feat(etcd): use hostname as machine name
2013-11-01 06:45:01 -07:00
c10653ae0c feat(etcd): use hostname as machine name
by default I don't want etcd to require parameters so people can rapidly
try it out. Try to use the hostname as the name instead.
2013-10-31 15:16:28 -07:00
c88a556917 test add snapshot tests 2013-10-30 19:41:21 -07:00
f29ab366c3 merge with 0.2 2013-10-30 17:44:20 -07:00
9d0de611a7 feat add snapCount parameter 2013-10-30 17:36:15 -07:00
0e15962cef Merge pull request #276 from xiangli-cmu/feat-kvpair-ttl
feat kvpair include ttl
2013-10-30 15:56:28 -07:00
0cd78e210a tests more delay for passing tests on travis 2013-10-30 15:51:46 -07:00
f723651a6d fix test: should wait for watch response 2013-10-30 15:46:01 -07:00
bd651edf80 test add integration test 2013-10-30 15:27:16 -07:00
107762e82a fix snapshot 2013-10-30 15:14:34 -07:00
1a2a9d60e6 fix(README): make contacts a list 2013-10-30 15:02:28 -07:00
03c836faff Merge pull request #280 from philips/add-readme-contact
feat(README): add mailing list and IRC
2013-10-30 15:01:30 -07:00
90b49fa53c feat(README): add mailing list and IRC 2013-10-30 14:14:13 -07:00
0435284a37 Merge pull request #278 from benbjohnson/upgrade-version
Add version upgrade endpoint.
2013-10-30 06:37:07 -07:00
ddf527e092 Add version upgrade endpoint. 2013-10-29 15:49:10 -06:00
d59134a5b5 feat(README): add an erlang library marshall-lee/etcd.erl 2013-10-29 14:25:44 -07:00
576badd334 Merge pull request #277 from benbjohnson/versioning
Internal Versioning
2013-10-29 09:39:05 -07:00
ec175d4c47 test add test for ttl in kv pair 2013-10-28 09:42:54 -07:00
23dc0b9317 Merge branch '0.2' of https://github.com/coreos/etcd into versioning
Conflicts:
	server/v2/put_handler.go
2013-10-28 06:39:56 -06:00
aa9ae32998 Internal versioning. 2013-10-27 14:09:40 -06:00
bd0d2e8494 Merge pull request #275 from xiangli-cmu/fix-put-ttl
Fix put ttl
2013-10-27 10:09:26 -07:00
a70aa3e0da Merge pull request #266 from benbjohnson/config
Tiered Configuration
2013-10-27 09:52:10 -07:00
7b60f8bdc3 feat kvpair include ttl 2013-10-26 21:21:48 -07:00
1fb3799118 fix put ttl 2013-10-26 21:04:44 -07:00
3be69f09ac Merge pull request #272 from dmarti/patch-1
Add instructions for setting a value only if the key does not exist
2013-10-26 20:00:30 -07:00
e254b9cec6 Add instructions for setting a value only if the key does not exist
Use an empty prevValue to atomically test for the existence of a key before setting the value.
2013-10-25 10:09:57 -07:00
9ed2776639 Merge pull request #253 from philips/add-Access-Control-Allow-Methods
fix(handlers): add Access-Control-Allow-Methods to cors
2013-10-23 14:04:22 -07:00
e40bb2e8d8 Merge pull request #267 from xiangli-cmu/fix-wait-handler
fix wait handler should close connection if client leaves
2013-10-23 13:33:11 -07:00
378c3d1dcf Merge pull request #265 from xiangli-cmu/fix-timeout
headerTimeout should be longer and body should be shorter
2013-10-23 13:30:51 -07:00
41e7266ff7 Merge branch '0.2' into config
Conflicts:
	Documentation/external-documentation.md
	server/config.go
	server/config_test.go
	server/tls_info.go
	server/util.go
2013-10-23 13:59:28 -06:00
f99d24310f Fix conf extension and documentation. 2013-10-23 13:44:53 -06:00
53b638558b Update readme 2013-10-22 14:30:55 -07:00
65663b2dae Merge branch '0.2' of https://github.com/coreos/etcd into 0.2 2013-10-22 13:09:26 -06:00
c697767c47 Merge pull request #270 from mattcottingham/fix-systemd-journal-panic
Update go-systemd packages to fix panic
2013-10-22 09:45:47 -07:00
32c2f89fe6 Update go-systemd packages to coreos/go-systemd:80318d 2013-10-22 10:46:25 +01:00
63456b5c4b fix close connection when client leaves 2013-10-22 00:17:58 -07:00
98fad7b86a update readme 2013-10-21 21:51:15 -07:00
7d4908a6c3 Merge branch '0.2' of https://github.com/coreos/etcd into config 2013-10-21 21:38:58 -06:00
bc0e07bca2 Add tiered configuration. 2013-10-21 21:37:25 -06:00
91cad59ada refactor use transtiemout 2013-10-21 17:53:24 -07:00
a659dec00b fix headerTimeout should be longer and body should be shorter 2013-10-21 17:33:23 -07:00
48b3e7f2ab Add basic config. 2013-10-21 16:00:20 -06:00
e8a7230a1d Merge pull request #264 from xiangli-cmu/0.2
refactor remove extra print parameter
2013-10-21 12:38:01 -07:00
6803d077b9 fix store pacakge pass go vet 2013-10-21 12:37:22 -07:00
94accfcb23 refactor remove extra print parameter 2013-10-21 12:35:02 -07:00
90c5614cd4 Merge pull request #260 from benbjohnson/clean-store-tests
Clean up store tests.
2013-10-20 18:08:17 -07:00
23119d1672 Refactor store tests. 2013-10-20 16:09:45 -06:00
f19567fd3e Merge pull request #259 from xiangli-cmu/0.2
fix do not need to parse the original url
2013-10-20 11:27:47 -07:00
2cafdcd657 fix do not need to parse the original url 2013-10-20 11:27:40 -07:00
93bdce32a8 Merge pull request #258 from xiangli-cmu/0.2
use net/url pacakge
2013-10-20 11:25:44 -07:00
1119a86cc3 fix add fragment 2013-10-20 11:25:24 -07:00
5767b4e245 use net/url pacakge 2013-10-20 11:10:24 -07:00
61f238f22e Merge pull request #255 from xiangli-cmu/0.2-fix-devlist-issue
0.2 fix devlist issue
2013-10-20 10:29:29 -07:00
0cdb865b4c Merge pull request #256 from xiangli-cmu/0.2-refactor-status-code
refactor return http status 201 Created when creating a new node
2013-10-20 10:25:01 -07:00
b852a746ce refactor move http status logic to server.go 2013-10-20 10:21:54 -07:00
8e12e4e480 Merge pull request #251 from benbjohnson/v2-handler-tests
v2 Handler Unit Tests
2013-10-20 10:12:44 -07:00
acbc0c8846 refactor return http status 201 Created when creating a new node 2013-10-19 19:57:36 -07:00
6684186033 fix append rawqurey to the redirect location. 2013-10-19 15:06:35 -07:00
e931ff23d8 Merge branch '0.2' of https://github.com/coreos/etcd into 0.2-fix-devlist-issue 2013-10-19 11:52:47 -07:00
7b6e305d40 fix update also return newValue 2013-10-19 11:51:41 -07:00
55f9045561 fix(handlers): add Access-Control-Allow-Methods to cors
This is needed to have CORs work properly. Fixes #252
2013-10-18 11:44:29 -07:00
62b890839a Merge branch '0.2' of https://github.com/coreos/etcd into v2-handler-tests
Conflicts:
	test.sh
2013-10-18 08:54:51 -06:00
97987e72a7 Merge pull request #250 from xiangli-cmu/0.2-fix-test
fix use right gopath
2013-10-17 21:12:38 -07:00
a6f7069264 fix use right gopath 2013-10-17 20:57:00 -07:00
58495d1dcf Merge pull request #249 from xiangli-cmu/0.2-fix-path
fix bad cert path
2013-10-17 20:54:15 -07:00
4135f425d3 fix bad cert path 2013-10-17 20:53:30 -07:00
dcef04b796 Add v2 unit tests. 2013-10-17 21:52:15 -06:00
2eff77ea92 Merge pull request #247 from xiangli-cmu/0.2-handlers
fix v1 handler: use create command when test against prevexistence
2013-10-17 20:37:16 -07:00
d5f0642524 Merge pull request #244 from robszumski/sort-machine-list
Sort Machine List on Dashboard
2013-10-17 17:07:33 -07:00
87b2a0d9c5 fix remove unused package 2013-10-17 10:50:00 -07:00
a0d3488d94 Merge branch '0.2' of https://github.com/coreos/etcd into 0.2-handlers 2013-10-17 10:46:01 -07:00
088a01f19c Merge pull request #248 from benbjohnson/build-fail
Update build script to fail on error.
2013-10-17 09:27:22 -07:00
4fb3a01f25 Update build script to fail on error. 2013-10-17 10:02:59 -06:00
4479d72e93 fix hmm... another stupid mistake 2013-10-17 00:12:39 -07:00
28722e2127 fix v1 handler: use create command when test against prevexistence 2013-10-16 23:57:42 -07:00
7fa99b3794 Merge pull request #245 from benbjohnson/0.2
Travis Fix
2013-10-16 18:37:39 -07:00
c39f0963ae Merge branch '0.2' of https://github.com/coreos/etcd into 0.2 2013-10-16 19:36:38 -06:00
e0636ce655 Merge pull request #242 from philips/add-version-flag-0.2
feat(etcd): add version flag
2013-10-16 17:33:35 -07:00
7670c85d70 feat(server): export ReleaseVersion
releaseVersion is needed in etcd.go to print it out in the -version
flag.
2013-10-16 17:29:53 -07:00
f998a19c3d feat(etcd): add version flag
print the version and exit, very simple :)

Conflicts:
	etcd.go
2013-10-16 17:29:53 -07:00
4774466a75 bug(css): Reset line-height to prevent jumping 2013-10-16 14:48:26 -07:00
3fa0d21049 feat(dashboard): Sort machine list to prevent jumping 2013-10-16 14:47:10 -07:00
bc8c338bed Travis fix. 2013-10-16 15:23:11 -06:00
66becddac3 Merge pull request #243 from benbjohnson/reintegrate-functional-tests
Reintegrate functional tests into etcd.
2013-10-16 14:13:21 -07:00
b4d311d6a1 Reintegrate functional tests into etcd. 2013-10-16 13:58:03 -06:00
f5fa89c0e1 Merge pull request #238 from xiangli-cmu/0.2-handlers
0.2 handlers
2013-10-16 10:56:39 -07:00
5305b802b2 Merge pull request #241 from robszumski/fix-highlight
Fix highlight
2013-10-15 23:34:49 -07:00
e680f28c2f fix move update check to update handler 2013-10-15 23:25:12 -07:00
0392c18794 refactor put_handler.go 2013-10-15 23:18:03 -07:00
4c3509ac09 bug(back button): back button now is disabled when invalid 2013-10-15 23:11:34 -07:00
baa683b484 feat POST-create unique node under given path 2013-10-15 22:21:55 -07:00
45b0b35a0f feature(selection): prevent selection of non-text elements with CSS 2013-10-15 22:01:45 -07:00
36ae9e9437 Merge pull request #240 from robszumski/color-ranges
chore(dashboard) update color ranges
2013-10-15 16:13:06 -07:00
53e9e1966f chore(dashboard) update color ranges 2013-10-15 15:58:56 -07:00
9838cae49d chore(dashboard): Remove restangular 2013-10-15 10:58:31 -07:00
aa49d5c1bd fix(dashboard): fix bug in toggling views 2013-10-15 10:58:18 -07:00
1c401a05b1 feat(dashboard): Notate leader in machine list 2013-10-15 10:57:58 -07:00
01bbad31c7 refactor remove web pacakge 2013-10-14 23:16:48 -07:00
c5f9afa0e8 fix store test 2013-10-14 23:15:31 -07:00
fbf40fb74a refactor store.go add set function 2013-10-14 23:04:21 -07:00
278a089908 fix set should register set rather than create 2013-10-14 22:45:29 -07:00
53a9bd0618 feat add set command 2013-10-14 22:44:17 -07:00
2aeb25e80c refactor change handler name to its method 2013-10-14 22:38:07 -07:00
9ebdcb8ae3 refactor change testAndSet to CompareAndSwap 2013-10-14 22:32:22 -07:00
545f8ed6a1 fix update PUT handler 2013-10-14 22:22:23 -07:00
811d172a54 fix change wait_index to waitIndex; we do not use post in 0.2 2013-10-14 21:22:20 -07:00
3f896cf586 Merge pull request #236 from benbjohnson/remove-functional-tests
Remove functional tests.
2013-10-14 13:56:29 -07:00
fb7a91739a Remove functional tests. 2013-10-14 14:20:50 -06:00
812fd4393e Merge pull request #235 from xiangli-cmu/0.2
Test both of the condition if given
2013-10-14 13:03:02 -07:00
2b6c628342 Merge branch '0.2' of https://github.com/coreos/etcd into 0.2 2013-10-14 12:57:38 -07:00
c87a7a039e feat test both of the condidtion 2013-10-14 12:57:35 -07:00
89660ce0cd Merge pull request #234 from benbjohnson/raft-server-interface
Use raft.Server interface.
2013-10-14 12:55:29 -07:00
e7598075ac Use raft.Server interface. 2013-10-14 13:51:20 -06:00
ad5cfab5ba Merge pull request #232 from adrianlzt/patch-1
A little lit bit easy to read
2013-10-14 10:59:39 -07:00
4f5ec77f87 Merge pull request #233 from benbjohnson/store-interface
Extract Store into an interface.
2013-10-14 10:57:55 -07:00
12636ce89c A little lit bit easy to read
I have only reordered to parameters to be according to the first instance executed.
2013-10-14 19:14:14 +02:00
1321c63f3b Extract Store into an interface. 2013-10-14 11:12:30 -06:00
5a1338ce8a Merge pull request #231 from benbjohnson/test-fix
Fix etcd.NewClient().
2013-10-14 10:07:43 -07:00
c434f2cae7 Merge pull request #229 from amirhhz/patch-1
Correct index number to match description in 'watch' example
2013-10-14 09:10:29 -07:00
a6a32a592d Merge branch '0.2' into test-fix 2013-10-14 10:06:51 -06:00
56192b7f85 bump(code.google.com/p/go.net): 355ff0aa1b2e 2013-10-14 10:05:49 -06:00
e1003a8623 bump(bitbucket.org/kardianos/osext): 364fb577de68 2013-10-14 10:05:46 -06:00
6b55a47090 bump(github.com/coreos/go-systemd): af0e6cd015e5fad8d9d090ad7aa343a1f680318d 2013-10-14 10:05:43 -06:00
13b86f5360 bump(github.com/coreos/go-log/log): 2013-10-14 10:05:43 -06:00
1843f7bda5 bump(github.com/coreos/go-etcd): 0cc84e9bc81c45e074864360adc549e61a3a7f83 2013-10-14 10:05:39 -06:00
375f7a73b9 bump(github.com/coreos/go-raft): 9fed6b9e77a96f1ab3a4c02bc8dbed72fbac9eb0 2013-10-14 10:05:38 -06:00
63e128670e Fix etcd.NewClient(). 2013-10-14 09:55:57 -06:00
a0007dbeab Correct index number to match description in 'watch' example 2013-10-14 13:48:20 +01:00
259e1ce256 Merge pull request #228 from xiangli-cmu/0.2
refactor move raft http handlers to peer_server_handlers.go
2013-10-13 23:20:21 -07:00
ef74464aea refactor remove extra function 2013-10-13 23:09:52 -07:00
090d049b81 refactor move raft http handlers to peer_server_handlers.go 2013-10-13 22:50:51 -07:00
755c18d491 Merge pull request #227 from xiangli-cmu/0.2
refactor remove the extra function
2013-10-13 22:20:52 -07:00
7565313290 refactor add wrapper function 2013-10-13 22:20:23 -07:00
a635f6b17c refactor remove the extra function 2013-10-13 22:13:20 -07:00
2b291aabea Merge pull request #218 from benbjohnson/refactoring
[wip] Refactoring
2013-10-13 21:15:29 -07:00
dc59bd8d77 gofmt 2013-10-13 21:37:45 -06:00
0e49c49dce Remove verbosity from test. 2013-10-13 21:36:42 -06:00
1a27c9de67 Add github.com/gorilla/context. 2013-10-13 21:15:13 -06:00
8475d9878e bump(github.com/gorilla/context): 708054d61e5a2918b9f4e9700000ee611dcf03f5 2013-10-13 21:14:45 -06:00
d44fd6661a Fix registry cache issues. 2013-10-13 21:09:56 -06:00
013d07bc2a Fix server dispatch redirection. 2013-10-13 16:58:36 -06:00
77572b01f8 Merge pull request #2 from xiangli-cmu/refactoring
fix registry.go: use the correct node name; self is already in the list
2013-10-13 15:27:40 -07:00
e954d3d41f fix registry.go: use the correct node name; self is already in the list 2013-10-13 15:25:07 -07:00
55c1f45805 Merge branch 'refactoring' of https://github.com/benbjohnson/etcd into refactoring
Conflicts:
	server/registry.go
2013-10-13 15:04:21 -06:00
ec24e76959 Fix duplicates in registry. 2013-10-13 14:56:17 -06:00
2b9c4bc90d Merge pull request #1 from xiangli-cmu/refactoring
fix server/server.go accept name when creating a when server; gofmt
2013-10-13 13:53:34 -07:00
0c5808eeec fix server/server.go accept name when creating a when server; gofmt 2013-10-13 10:44:40 -07:00
d58c4a9145 Merge pull request #224 from philips/bump-protobuf
bump(code.google.com/p/goprotobuf): 61664b8425f3
2013-10-13 10:19:13 -07:00
bd893986b2 bump(code.google.com/p/goprotobuf): 61664b8425f3 2013-10-13 10:08:40 -07:00
d3b064c2e9 Refactor v2 routes. 2013-10-13 00:29:58 -06:00
7416d2fdcc Mostly working. 2013-10-12 23:39:34 -06:00
d8d712e8f0 Merge pull request #223 from xiangli-cmu/refactoring_store
refactor create do not need to check existence first
2013-10-12 21:49:23 -07:00
b0793e2dd9 refactor create do not need to check existence first 2013-10-12 21:48:29 -07:00
c7d3d3371b feat(README): add go-discover 2013-10-12 21:27:20 -07:00
52b67ca307 Add gorilla/mux to third_party. 2013-10-12 20:35:10 -06:00
34b99ee343 bump(github.com/gorilla/mux): b08c5fcf14d01cb0c20ddf70157f54d4a2c3a38a 2013-10-12 20:34:31 -06:00
8670e1b7aa Refactored. 2013-10-12 15:56:43 -06:00
bb9401544a Intermediate commit. 2013-10-12 13:35:23 -06:00
ba0c104cc8 Merge pull request #215 from robszumski/update-dashboard-readme
docs(dashboard): add instructions to get started
2013-10-12 12:01:02 -07:00
eb78d96a20 Intermediate commit. 2013-10-12 00:28:46 -06:00
e1186bbead docs(dashboard): improve instructions 2013-10-11 15:37:30 -07:00
89334df5ae Refactor commands. 2013-10-11 01:02:38 -06:00
0dfbb3f921 Merge pull request #217 from xiangli-cmu/master
Add F&Q about creating a valid client auth cert
2013-10-10 23:45:12 -07:00
beac6d8589 Update README.md 2013-10-10 23:44:59 -07:00
188a903e97 Update README.md 2013-10-10 23:43:47 -07:00
d65c2451c4 Update README.md 2013-10-10 23:15:48 -07:00
594c2cab47 Refactor v2 API into server/v2. 2013-10-11 00:07:22 -06:00
a113a51d73 Refactor v1 API into server/v1. 2013-10-10 22:42:45 -06:00
a8b677f6e7 Merge pull request #214 from xiangli-cmu/newStore
WIP refactor remove raft singleton
2013-10-10 19:49:52 -07:00
40c520ca1b refactor remove raft singleton 2013-10-10 15:40:05 -07:00
e77b9aa020 fix(mod/dashboard): bump the resources
bump all of the resources to get the new delete_key fix.
2013-10-10 15:28:19 -07:00
45f0ff5679 feat(scripts): add build-release script 2013-10-10 14:39:12 -07:00
52c34a2323 docs(dashboard): add instructions to get started 2013-10-10 13:32:37 -07:00
8ebbb96611 chore(mod/dashboard): remove fmt package
Always build before pushing to origin master! Sorry for this noise. I
deleted the debug message but not fmt.
2013-10-10 12:41:20 -07:00
3d5087d488 chore(mod/dashboard): remove debug line
Oops, this debug line made it into the tree. Remove it.
2013-10-10 12:34:08 -07:00
777e03491f fix(mod/dashboard): use deleteKey() not delete_key()
small bug I overlooked while refactoring all of the dashboard function
names to be more "javascripty"
2013-10-10 12:19:01 -07:00
bc077b66b0 Merge pull request #207 from philips/integrate-dashboard
New dashboard as module
2013-10-10 11:42:49 -07:00
05202c9ce9 feat(mod/dashboard): add cleaner urls for stats and browser
you can hit them at:

- http://localhost:4001/etcd/mod/dashboard/stats
- http://localhost:4001/etcd/mod/dashboard/browser
2013-10-10 11:32:39 -07:00
a3b07f71d2 Merge pull request #212 from xiangli-cmu/newStore
refactor command.go: commands do not rely on the etcdStore singleton.
2013-10-10 10:15:12 -07:00
4246d3a400 Merge pull request #213 from aterreno/master
Including clojure library
2013-10-10 08:48:10 -07:00
cb323e95ff Including clojure library 2013-10-10 13:43:51 +01:00
255e14a5c4 refactor command.go,server.go: add raftWrapper as context, totally get rid of reference in command.go 2013-10-09 20:51:21 -07:00
61899d62c5 refactor command.go: commands do not rely on the etcdStore singleton. So we can seprate command into a package in the furture. 2013-10-09 20:34:00 -07:00
302347426e Merge pull request #210 from philips/add-version-flag
feat(etcd): add version flag
2013-10-09 14:48:49 -07:00
af30cb8725 feat(etcd): add version flag
print the version and exit, very simple :)
2013-10-09 14:26:49 -07:00
1d6a6d20d1 feat(mod): introduce the /etcd/mod namespace
introduce the `/etcd/mod` namespace and add the dashboard into it.
2013-10-09 13:54:44 -07:00
b8e5794765 Merge remote-tracking branch 'xiangli-cmu/newStore' into 0.2 2013-10-09 12:28:55 -07:00
4bf57537b5 refactor store.go remove extra assignment 2013-10-08 22:12:00 -07:00
e597947bd8 refactor store.go update 2013-10-08 22:10:18 -07:00
a030a41153 refactor store.go remove unwanted print 2013-10-08 22:01:22 -07:00
75959f9948 refactor add node.ExpirationAndTTL 2013-10-08 21:49:10 -07:00
c3e2332479 refactor separate kvpair to kvpair.go; simplify sorting interface 2013-10-08 21:25:56 -07:00
f8b0c876f7 Merge pull request #208 from kelseyhightower/master
Add confd to list of projects using etcd
2013-10-08 15:31:39 -07:00
52d5773cc6 Add confd to list of projects using etcd 2013-10-08 14:41:39 -07:00
32f562a013 feat(mods): add README file 2013-10-08 11:22:48 -07:00
8ee0845631 chore(dashboard): move to the mod directory 2013-10-08 11:17:12 -07:00
bed3980e9c fix(dashboard): add moment to bower dependencies 2013-10-08 11:15:03 -07:00
d2904ae36e fix(dashboard): add d3 to bower 2013-10-08 11:15:03 -07:00
431eebf754 feat(dashboard): introduce the in memory handler
the in memory handler gives etcd the ability to serve a dashboard
without on disk resources. This is the first time we are using the
/mod/ path too.

TODO: cleanup the mod stuff so it isn't hacked into etcd_handlers.
2013-10-08 11:15:03 -07:00
637650e2a9 feat(dashboard): inital commit of resources package 2013-10-08 11:15:03 -07:00
65948d531c bump(github.com/jteeuwen/go-bindata): 79847ab3e91ae5d2e1b18796c1795c78f29565d7 2013-10-08 11:15:03 -07:00
52da2acffd feat(dashboard): Initial commit of frontend code 2013-10-08 11:15:03 -07:00
3c7f9215d1 comments node.go 2013-10-07 23:30:51 -07:00
48e6137f46 fix node.go race between expire and update 2013-10-07 23:21:39 -07:00
a07802a347 refactor node.go; use once 2013-10-07 23:12:13 -07:00
a71838a59b refactor watcher.go 2013-10-07 22:17:58 -07:00
84ea824b96 feat(dashboard/README): initial commit 2013-10-07 16:50:29 -07:00
5a4f096647 feat(etcd_handlers): add the dashboard URL
/dashboard serves a dashboard now
2013-10-07 16:50:29 -07:00
44c16dd30d Merge pull request #206 from philips/fixup-copyright
chore(*.go): add copyright notice
2013-10-07 09:49:23 -07:00
41b9051686 chore(*.go): add copyright notice 2013-10-07 09:48:28 -07:00
0facc24016 Merge remote-tracking branch 'xiangli-cmu/newStore' into 0.2 2013-10-06 11:39:49 -07:00
baaaf24f70 (feat) v1 apt backward support 2013-10-06 11:23:52 -07:00
5cc585af96 Merge pull request #201 from rca/master
Update README.md
2013-10-03 11:31:27 -07:00
d64cf5f64c Update README.md
Minor typo fix (dead -> died).
2013-10-03 12:45:26 -04:00
b8b81d5b03 feat(store) create node with incremental suffix. accept #190 in new API 2013-10-03 08:59:05 -07:00
512dede9ce finish todo 2013-10-02 22:15:12 -07:00
c988b1e5b0 Merge pull request #199 from zined/update_documentation
adopt documentation to implementation
2013-10-02 07:28:38 -07:00
5a7ba24790 adopt documentation to implementation
as requesting the root path of etcd leads to a 404, whereas a request
to /version leads to the etcd version, update the documentation.
2013-10-02 15:04:26 +02:00
9412c86b97 fix wrong logic in event.go 2013-09-30 23:51:47 -07:00
558d30f33f simplify lock 2013-09-30 23:18:52 -07:00
d2407dff9f Merge pull request #15 from evan-gu/newStore
add watcher for expiration, add expiration for TestAndSet
2013-09-30 23:00:22 -07:00
974d74befb add some comment and change a declaration form 2013-10-01 01:25:45 -04:00
6f591032ef rename to DupCnt, duped; add some comments, maintained some format, add notification for immediate expiration 2013-10-01 00:35:44 -04:00
6fdffbcc85 delete some debug comments in stats_test.go 2013-09-30 22:17:17 -04:00
b8ac1d082b fix race between Expire() and others, fix UpdateTTL(), modified watcher to catch Expire() 2013-09-30 22:10:40 -04:00
9a5775cff0 fix(CONTRIBUTING): try and fix # links in markdown 2013-09-30 12:24:50 -07:00
482afb44f3 Update CONTRIBUTING.md 2013-09-30 12:23:52 -07:00
68206a74e7 Merge pull request #197 from philips/add-contributing
feat(README): add contributing section and file
2013-09-30 12:21:29 -07:00
98eba608fc feat(README): add contributing section and file
Direct people to the contributing file and README. Trying to solve the
problem of people emailing developers directly.
2013-09-30 12:13:24 -07:00
0959448855 add LastIndex and LastTerm in EventHistory 2013-09-30 12:18:28 -04:00
3ae316ac38 add ExpireCount and some test case 2013-09-30 02:39:40 -04:00
35724319c9 add watcher for expiration, add expiration for TestAndSet, add related test case 2013-09-30 01:06:18 -04:00
c345203c27 README: add russellhaering/txectd 2013-09-29 10:37:29 -07:00
dbf69907fa Merge pull request #194 from mburns/patch-1
Clarify FAQ language
2013-09-29 06:31:44 -07:00
248992e380 Typos 2013-09-29 04:45:35 -07:00
4b2e53f29e minor clean up 2013-09-28 17:41:45 -07:00
33e010ebd8 add watchHistory clone 2013-09-28 17:41:02 -07:00
2c9d57a9fe fix conflicts 2013-09-28 17:05:00 -07:00
784d286f37 merge from master 2013-09-28 16:58:57 -07:00
da83ee223b clean up from yifan 2013-09-28 16:26:19 -07:00
8a7e5fc227 Merge pull request #187 from sakana/master
Switch to coreos/go-log
2013-09-28 13:24:14 -07:00
c565ac23a7 Merge pull request #192 from xiangli-cmu/master
fix timeout
2013-09-28 13:20:02 -07:00
266519c8d2 fix typo 2013-09-27 21:56:42 -07:00
6f32b2d576 fix timeout 2013-09-27 21:24:33 -07:00
1d31b574ed Merge pull request #191 from philips/fixup-spelling-error-stats
fix(raft_stats): spelling followers not follwers
2013-09-27 15:58:30 -07:00
6fb1d8a377 fix(raft_stats): spelling followers not follwers 2013-09-27 15:57:13 -07:00
8fc1abd9b1 Merge pull request #184 from xiangli-cmu/master
Fix restart from snapshot.
2013-09-26 22:27:50 -07:00
cc722a413f change peer to follower 2013-09-26 20:00:12 -07:00
2eb0625f15 mrege and change peerstats to followersstats 2013-09-26 19:58:48 -07:00
9825976e06 Merge upstream 2013-09-26 13:05:09 -07:00
21f6b50607 Merge pull request #189 from philips/cleanup-stats-further
cleanup the stats json a bit
2013-09-26 13:00:39 -07:00
da01fe6027 fix(command): make Latency and Counts objects
instead of suffixing everything make a latency object
2013-09-26 12:17:54 -07:00
cbd8a4fb9c feat(scripts/test-cluster): add a cluster test command
this uses tmux to setup a test cluster that you can easily kill and
start for debugging.
2013-09-26 10:40:33 -07:00
20488b498a Merge pull request #168 from xiangli-cmu/cleanupStats
cleanup
2013-09-26 06:40:59 -07:00
0ef9d944f6 fix(gitignore): ignore the actual binary 2013-09-25 17:04:34 -07:00
aff4af1d0b fix(build): use /bin/sh
it seems to work with bash -o posix. Ship it.
2013-09-25 17:04:05 -07:00
0b37c808dd Fix nil logger in inits
Move the logger initialization out of init in util.go and into the
variable initializer.  This ensures that it will be run before any of
the other init functions.
2013-09-25 15:39:25 -07:00
a121cbb721 Switch from golang log to coreos/go-log 2013-09-25 13:43:16 -07:00
951d467917 Swith to coreos/go-log from ccding/go-logging
bump(github.com/coreos/go-etcd): 57864cf81c66b8605816fafab3ab142e1c5f5b29
bump(github.com/coreos/go-log/log):
bump(github.com/coreos/go-systemd): 52f153170a52158deffce83502a9b6aed3744802
2013-09-25 13:32:51 -07:00
a568c6dc75 add some basic stats, and test case 2013-09-23 01:55:22 -04:00
a8ff1b27d4 init peerStats in transportation.go; avoid nil pointer due to restart from snapshot(we do not keep stats in persistentlayer yet) 2013-09-22 11:20:08 -04:00
3a0a8c89e8 Merge pull request #183 from xiangli-cmu/master
bump 3rd party
2013-09-21 22:33:17 -07:00
24b34d0a1e bump 3rd party 2013-09-22 01:32:49 -04:00
c5c3604471 Merge pull request #182 from xiangli-cmu/master
bump 3rd party
2013-09-21 21:17:40 -07:00
d3fbf6d997 bump 3rd party 2013-09-21 23:09:20 -04:00
940294d1cd README: add jdarcy/etcd-api, a C library 2013-09-19 10:57:17 -05:00
48d234c836 Merge pull request #179 from jplana/patch-1
Added new python client
2013-09-18 06:18:45 -07:00
ca84d11f8c Added new python client
Hi! I just published my own take on a python client for etcd.
2013-09-18 13:28:02 +02:00
fba31a8461 README: add binocarlos/yoda 2013-09-17 10:21:33 -07:00
11f94d4720 Merge pull request #175 from AndyPook/master
Build on Windows
2013-09-17 10:04:06 -07:00
f03481f733 add equivalent Powershell scripts to ./build so that etcd can be built on Windows 2013-09-17 09:15:23 +01:00
2022c4bce6 fix wait_index 2013-09-16 09:16:22 -04:00
1caf2a3364 remove old store 2013-09-15 22:28:42 -04:00
e71dad9d32 Merge branch 'fileSystem' of https://github.com/xiangli-cmu/etcd into fileSystem 2013-09-15 20:50:52 -04:00
cd0201df06 fix import 2013-09-15 20:50:35 -04:00
36329e9c6a Merge pull request #13 from evan-gu/fileSystem
fix bug of deleting the root
2013-09-15 16:01:41 -07:00
09f31af88a Merge pull request #173 from derekchiang/patch-1
Update README.md
2013-09-15 16:00:56 -07:00
cd6ed3d15b gofmt 2013-09-15 18:51:25 -04:00
62b8b7a6a8 Update README.md
Add my project to `Projects using etcd`
2013-09-15 18:48:41 -04:00
09414016c2 fix bug of deleteing the root 2013-09-15 18:47:53 -04:00
7588f2da47 Merge branch 'fileSystem' of https://github.com/xiangli-cmu/etcd into fileSystem 2013-09-15 18:37:17 -04:00
232f83f99a fix bug of deleting the root
modified:   etcd_handlers.go
	modified:   file_system/file_system.go
	modified:   file_system/node.go
	deleted:    transporter_test.go
2013-09-15 18:36:56 -04:00
e41ef9b733 refactor dispatch 2013-09-15 17:46:38 -04:00
a3545a7ffa support consistent get 2013-09-15 16:42:34 -04:00
eff09adf2e feat(README): add coderanger/etcd-chef 2013-09-14 16:34:48 -07:00
2d7c1be164 merge 2013-09-14 15:22:37 -04:00
3ff100321c use new store system 2013-09-14 15:13:33 -04:00
2c9c278e4d refactor; add save and recover 2013-09-13 17:10:40 -04:00
9caca30c8d Merge pull request #171 from ithinkihaveacat/mv-testAndSet-foo
Change key name "testAndSet" -> "foo" for clarity
2013-09-13 06:08:52 -07:00
f923548182 Change key "testAndSet" -> "foo" for clarity 2013-09-13 09:33:44 +01:00
8d245b546f cleanup 2013-09-12 13:17:19 -04:00
23e99b57a6 Merge pull request #135 from xiangli-cmu/moreStats
WIP More stats
2013-09-10 09:29:12 -07:00
86e03d2298 format 2013-09-10 12:28:58 -04:00
a7eb09a557 Merge pull request #10 from evan-gu/fileSystem
added sorting, changed the interface, modified the documents, added some test case
2013-09-08 20:16:30 -07:00
643a92a490 now it will sort recursively, and the sorting test case is better.... 2013-09-08 23:13:28 -04:00
38489bd846 add documentation about sorting, change the argument name from sorting to sorted 2013-09-08 21:21:57 -04:00
1a7b3e8e08 add sorting and its test case 2013-09-08 21:14:31 -04:00
31aa3dfe82 clear up raft_stats 2013-09-08 21:12:26 -04:00
43cb2a353f only leader will return peer stats 2013-09-08 20:48:33 -04:00
7ad523270d Merge pull request #9 from fengjingchao/fileSystem
New error-system for Etcd with docs
2013-09-08 16:25:47 -07:00
effc8285f2 New error-system for Etcd with docs 2013-09-08 18:46:16 -04:00
bd7c09e9c0 Merge pull request #8 from evan-gu/fileSystem
add testcase, fix update dir ttl bug
2013-09-08 13:38:42 -07:00
9a632351a6 gofmt 2013-09-08 16:37:24 -04:00
9065c2e4f0 fix update dir ttl bug, add some test case 2013-09-08 16:36:24 -04:00
b7358ccd98 Merge pull request #7 from fengjingchao/fileSystem
add acl doc after merge
2013-09-08 07:05:54 -07:00
f41a9b9703 modify name. simplify test case. 2013-09-08 09:55:54 -04:00
44e8c234ed merge master 2013-09-07 14:47:55 -04:00
db534fde3b Merge pull request #161 from philips/add-faq-section
feat(README): add note about cluster size
2013-09-07 10:27:14 -07:00
380326b5d1 feat(README): add note about cluster size
Cluster size keeps coming up on IRC and the mailing list. Add an FAQ
section.
2013-09-07 09:05:24 -07:00
8ab6684bf5 Merge branch 'fileSystem' of github.com:xiangli-cmu/etcd into fileSystem 2013-09-07 10:40:43 -04:00
4f7011fc2b add acl doc 2013-09-07 10:40:19 -04:00
08057fa642 remove todo 2013-09-07 09:14:27 -04:00
f50cf0497d add comments; event.go: add Create and Update const 2013-09-07 08:54:58 -04:00
bd8ec6d67b support watch delete 2013-09-07 01:05:11 -04:00
948044093b support create directory 2013-09-06 23:36:11 -04:00
4f99b60291 update test 2013-09-06 23:24:01 -04:00
907e39edec update operation 2013-09-06 23:01:11 -04:00
8cf87921ff Merge pull request #160 from diwakergupta/patch-1
Add another Java library for etcd
2013-09-06 19:41:00 -07:00
a623effaf1 Add another Java library for etcd
https://github.com/diwakergupta/jetcd
2013-09-06 19:34:22 -07:00
d95485d511 Merge branch 'fileSystem' of https://github.com/xiangli-cmu/etcd into fileSystem 2013-09-06 22:05:27 -04:00
ea4ab2a429 recursive watch 2013-09-06 22:05:11 -04:00
9138a75df4 Merge pull request #6 from fengjingchao/fileSystem
refine doc
2013-09-06 11:32:31 -07:00
9b80e1cd64 refine doc 2013-09-06 14:28:11 -04:00
f50ea7d971 Merge pull request #159 from hayesgm/master
Blank prevValue should be TestAndSet with blank prevValue, not Set
2013-09-05 21:29:54 -07:00
b366f10446 Blank prevValue in POST should be interpreted as a blank test-and-set, not a normal set 2013-09-05 21:08:43 -07:00
450d0eb0da support recursive get 2013-09-05 23:10:41 -04:00
6d27afd1c9 more testandset test cases 2013-09-05 15:48:53 -04:00
227d79e2bf support testandset 2013-09-05 15:38:22 -04:00
adbcbefe92 feat(README): add python library transitorykris/etcd-py 2013-09-05 08:42:30 -07:00
4c286fde23 change key_path to keyPath 2013-09-05 11:00:53 -04:00
cc77613fd9 update file 2013-09-04 23:57:19 -04:00
621cf57761 event.go: remove extra logic in addEvent() 2013-09-04 23:36:14 -04:00
197b9106f9 init file system spec 2013-09-04 22:40:33 -04:00
7ce8389d83 Merge pull request #5 from fengjingchao/fileSystem
change filepath to path and fix path namespace collision
2013-09-04 17:51:11 -07:00
03af286b03 change filepath to path and fix path namespace collision 2013-09-04 20:50:04 -04:00
b300d2877e README: add justinsb/jetcd project 2013-09-04 17:31:27 -07:00
4e2f9b4991 Merge pull request #4 from fengjingchao/fileSystem
node.go: fix defer and add doc
2013-09-04 15:24:10 -07:00
aed76d0e08 gofmt 2013-09-04 18:23:44 -04:00
90f691fc2a node.go: fix defer and add doc 2013-09-04 18:22:07 -04:00
c56312f09f refactor 2013-09-03 23:21:26 -04:00
23775dc776 add hidden test 2013-09-03 23:10:33 -04:00
b8967bc7d1 support hidden node 2013-09-03 22:35:25 -04:00
45c9ec9f29 basic get 2013-09-03 21:27:46 -04:00
dee496b5ae Merge pull request #153 from philips/add-cors
feat(etcd_handlers): enable CORS
2013-09-03 16:10:03 -07:00
2f5015552e feat(etcd_handlers): enable CORS
When developing or using web frontends for etcd it will be necessary to
enable Cross-Origin Resource Sharing. Add a flag that lets the user
enable this feature via a whitelist.
2013-09-03 15:12:46 -07:00
45ab5238fe Merge https://github.com/coreos/etcd into fileSystem 2013-09-03 14:33:21 -04:00
329f8c4fa3 init filesystem 2013-09-03 14:30:42 -04:00
40dcde42aa Merge pull request #152 from evan-gu/tranWithTimeout
Transporter with timeout
2013-09-02 17:09:24 -07:00
90d7ebec47 gofmt 2013-09-02 19:58:45 -04:00
8eaa9500e9 change heartbeattimeout to electiontimeout 2013-09-02 19:54:46 -04:00
fec65d8717 change DefaultHeartbeat to DefaultElectionTimeout
modified:   raft_server.go
	modified:   transporter_test.go
2013-09-02 17:05:35 -04:00
0c39971363 change default heart beat to electionTimtout 2013-09-02 16:50:53 -04:00
51941fa613 add timeout for transportation layer 2013-09-01 21:41:57 -04:00
946f9eaedc merge 2013-09-01 21:37:54 -04:00
a90bb85bb3 modified: README.md 2013-09-01 17:48:29 -04:00
43f808fa60 Merge pull request #150 from evan-gu/master
add README version
2013-09-01 14:39:06 -07:00
a22bd2b8b2 full version for readme 2013-09-01 17:38:41 -04:00
d56d79018e Merge pull request #151 from philips/listening-ip-cleanups
Listening ip cleanups
2013-09-01 03:08:14 -07:00
de0a8c60ac feat(README): document -cl flag 2013-08-31 22:28:25 -07:00
e28fd7cc2b fix(README): use 127.0.0.1 everywhere
0.0.0.0 used to be the default advertised ip, fix this everywhere.
2013-08-31 22:28:25 -07:00
bfeed190ea feat(etcd): Default server listen and client listen to advertised IPs
Map the advertised IP to the listening IP by default. This will make
things nicer for the user.
2013-08-31 22:28:25 -07:00
59599dc519 Update README.md
add README version
change -F to -d for consistence
add -v to show SSL handshake message
2013-08-30 23:52:37 -04:00
0166edce77 Merge pull request #147 from iconara/patch-3
Change leader and machine result examples in readme
2013-08-27 07:50:40 -07:00
b8d85e627e Change leader and machine result examples in readme 2013-08-27 16:30:25 +02:00
32cf8ddfde Merge pull request #145 from philips/add-listen-host
feat(etcd): add listen host parameter
2013-08-23 13:08:01 -07:00
351e84aece feat(etcd): add listen host parameter
this separates out the listening IP from the advertised IP. This is
necessary so that we can hit etcd on 127.0.0.1 but also advertise the
right IP to the rest of the cluster.
2013-08-23 13:07:15 -07:00
197689fcb5 Merge branch 'master' into moreStats 2013-08-23 13:45:51 -04:00
8264156ce9 Merge pull request #143 from xiangli-cmu/master
add testandset test
2013-08-23 10:16:54 -07:00
6108f8536f add testandset test 2013-08-23 01:37:20 -04:00
808eb64bd7 tmp commit 2013-08-23 01:25:35 -04:00
4a617979a9 Merge pull request #142 from Mistobaan/master
invert logic to have less nesting
2013-08-22 22:11:20 -07:00
a543d644b4 Split raw get into rawGetNode and rawGetNodeList 2013-08-22 22:02:50 -07:00
6345e02d20 test and set creates the key if key does not exists. fixes #96 2013-08-22 22:02:50 -07:00
91aed9e232 Fix error code in README.md
There is no error code with number 404. It returns
100 when no key exist.
2013-08-22 21:59:10 -07:00
50d53f3ae0 fix(README): add cd etcd on build instructions
thanks to edw in #coreos for the fix
2013-08-22 13:13:41 -07:00
29b7aab5fc Merge pull request #141 from Hoverbear/patch-1
Added a PUT handler that copies the behavior of the POST handler.
2013-08-21 14:50:30 -07:00
4f436ae70a Added a PUT handler that copies the behavior of the POST handler. Fixes #139. 2013-08-21 14:43:25 -07:00
23995ffc59 add recvQueue 2013-08-21 14:34:52 -07:00
4adc17eb01 Merge pull request #140 from marineam/quote
fix(build): If you quote in shell you're going to have a bad time.
2013-08-21 14:32:29 -07:00
e856acf05e fix(build): If you quote in shell you're going to have a bad time. 2013-08-21 17:25:38 -04:00
6ef18b1ae3 thread-saft queue 2013-08-21 13:35:15 -07:00
9b7109b466 Merge pull request #137 from fatih/patch-1
Fix error code in README.md
2013-08-21 11:26:15 -07:00
8eca7b2ca8 Merge pull request #138 from fatih/patch-2
Fix api urls in examples
2013-08-21 06:05:16 -07:00
800c4718c1 Fix api urls in examples
They don't work without the v1
2013-08-21 14:43:43 +03:00
7563a13621 Fix error code in README.md
There is no error code with number 404. It returns 
100 when no key exist.
2013-08-21 14:21:17 +03:00
10cdaea059 make a better array cyc-queue 2013-08-20 16:48:41 -07:00
f75c309d26 sampling sending rate 2013-08-20 16:33:54 -07:00
896c944c7e add serverStats 2013-08-20 14:05:23 -07:00
2b66641b55 bump deps 2013-08-19 20:36:13 -07:00
9a63723bbe add sdv 2013-08-19 20:35:56 -07:00
d8cd744f2f fix remove node 2013-08-19 19:07:18 -07:00
e4b164c324 add avg 2013-08-19 17:40:13 -07:00
7a9fae9530 better warn on restart the entire cluster 2013-08-19 17:22:33 -07:00
41b2175fe0 Merge pull request #134 from xiangli-cmu/removePeer
add remove peer
2013-08-19 17:22:02 -07:00
a97590ff50 basic stats 2013-08-19 17:19:45 -07:00
dd2f856d63 if the whole cluster dies, should not panic 2013-08-19 16:26:09 -07:00
798d52e695 simplify remove/join process; add tests 2013-08-19 15:28:01 -07:00
fb9f09d240 use commandname 2013-08-19 13:43:12 -07:00
49c160b50c change getMachines 2013-08-19 13:42:00 -07:00
64e6d54758 add remove peer 2013-08-19 12:10:11 -07:00
e7caa1475e Merge pull request #133 from xiangli-cmu/master
add killAllAndRecovery test
2013-08-19 10:51:18 -07:00
57ef6e9f5a add killallAndReocery test 2013-08-19 10:46:16 -07:00
7b289043c7 Merge pull request #130 from philips/add-version-to-join2
add versioning to cluster join
2013-08-19 09:45:49 -07:00
b430a07e1b chore(name_url_map): rename version to raftVersion
make it more clear that we are referring to the raftVersion.
2013-08-19 09:37:34 -07:00
52cbc89607 Merge pull request #132 from philips/add-new-projects2
feat(README): add etcdenv project
2013-08-19 09:22:53 -07:00
e848659db6 feat(README): add etcdenv project 2013-08-19 09:21:36 -07:00
9683bd37a7 Merge pull request #131 from philips/add-new-projects
feat(README): add some new projects
2013-08-19 09:20:06 -07:00
2991bf58e1 feat(README): add etcd-vim 2013-08-19 09:17:06 -07:00
e0731233c2 feat(README): add some new projects 2013-08-19 09:12:14 -07:00
bfc68e8e37 fix(raft_server): rename getLeaderVersion to getVersion 2013-08-19 08:53:15 -07:00
3fff0a3c2b fix(version): add raftVersion to the version file 2013-08-19 08:45:58 -07:00
fc776f2ad6 fix(raft_server): add comment on version field
explain what the version field is for and why it is set to
releaseVersion
2013-08-18 21:54:07 -07:00
e79f6842bb fix(command): change Version to RaftVersion
clear up confusion on what this field is used for: it is for the
internal raft protocol version only.
2013-08-18 21:54:07 -07:00
2c9e90d6ad feat(raft_server): do not allow mixed versions
fail to join if there is an internal version mismatch.
2013-08-18 21:54:07 -07:00
53b2038d2e feat(command): add version to join command
Add a version to the join command. Add a versioning document to discuss
some of the design decisions.
2013-08-18 21:54:07 -07:00
e091923311 Merge pull request #128 from xiangli-cmu/bump
Bump
2013-08-18 21:35:55 -07:00
f813017f1b fix raft api 2013-08-18 21:12:36 -07:00
111888adea bump(code.google.com/p/goprotobuf): 1141ccae4b85 2013-08-18 19:43:26 -07:00
ea28b1cdf3 bump(code.google.com/p/go.net): bc411e2ac33f 2013-08-18 19:43:24 -07:00
2662b3c559 bump(github.com/ccding/go-config-reader): 8b6c2b50197f20da3b1c5944c274c173634dc056 2013-08-18 19:43:20 -07:00
7ec0ee2a19 bump(github.com/ccding/go-logging): 4f3650d51969cc425c1940efa31fcb7c0bba86b3 2013-08-18 19:43:19 -07:00
13afdb0825 bump(github.com/coreos/go-etcd): 460022c1238ee0913013936e3486f41a3c7c1d7a 2013-08-18 19:43:14 -07:00
449cad4658 bump(github.com/coreos/go-raft): bb7f7ec92e4cb6d98241cea83f55d0e85e624189 2013-08-18 19:43:13 -07:00
393ed439b1 Merge pull request #127 from xiangli-cmu/master
clean error handling
2013-08-18 19:03:51 -07:00
1527b7008c fix test 2013-08-17 21:21:18 -07:00
5357fb431e Pull deeply nested logic into functions 2013-08-17 20:55:52 -07:00
cf2d6888c2 add error package 2013-08-17 20:41:15 -07:00
8ed67bedbb clean error handling 2013-08-17 15:06:21 -07:00
ef4aef950e Merge pull request #126 from philips/fix-missing-info-file
fix(config): use IsNotExist to test missing file
2013-08-17 14:07:50 -07:00
bcc77db8a9 fix(config): use IsNotExist to test missing file
Fixes #125 where a config file never gets created
2013-08-17 13:41:01 -07:00
f1786b8083 Merge pull request #122 from philips/fix-nip-in-transporter
chore(trasnsporter): delete unused variables
2013-08-17 09:06:16 -07:00
ec6a7be63a Merge pull request #124 from philips/xiangli-cleanup
Cleanups from #112
2013-08-17 08:36:46 -07:00
e50871cc36 remove unused struct 2013-08-17 08:30:32 -07:00
5bd24d8271 wait for exit and release resource 2013-08-17 08:30:32 -07:00
c459b4bda7 go flavour 2013-08-17 08:30:31 -07:00
981351c9d9 use type inheritance 2013-08-17 08:30:31 -07:00
012e747f18 make ttl test not so strict. testing server is not fast 2013-08-17 08:30:31 -07:00
e0ca8f20d2 add newJoinCommand func(). 2013-08-17 08:30:31 -07:00
ca4b5815f7 make raft and etcd server 2013-08-17 08:30:31 -07:00
f490fba698 also return API version 2013-08-17 08:30:31 -07:00
6bdb9af7f6 handler version at /version 2013-08-17 08:30:31 -07:00
7004a6bcc1 fix travis 2013-08-17 08:30:31 -07:00
177854c3e1 add test package. do not compile test codes with etcd 2013-08-17 08:30:31 -07:00
ee66f231b6 clean getMachines 2013-08-17 08:30:31 -07:00
c7e7e13aa4 handle readInfo error 2013-08-17 08:30:31 -07:00
9240258dc9 use var() 2013-08-17 08:30:31 -07:00
fb00d335c0 cleanup print 2013-08-17 08:30:31 -07:00
c3533d6ac2 fix test 2013-08-17 08:30:30 -07:00
cb33641f5f clean up 2013-08-17 08:30:30 -07:00
2c09cd7d1a chore(trasnsporter): delete unused variables
just return directly instead of creating intermediate variables
2013-08-17 07:57:09 -07:00
f8764df6ad Merge pull request #121 from philips/alternative-go-version-check
feat(go_version): check go version at build time
2013-08-16 15:35:37 -07:00
70f2590127 feat(go_version): check go version at build time
```
$ ./build
can't load package: package github.com/coreos/etcd:
src/github.com/coreos/etcd/go_version.go:3:1: expected 'package', found
'STRING' "etcd requires go 1.1 or greater to build"
```
2013-08-16 15:14:19 -07:00
0cb5eef40a Merge pull request #118 from philips/fix-test-and-set
fix(command): be consistent will all CommandNames
2013-08-15 21:40:34 -07:00
3e59badf1a fix(command): be consistent will all CommandNames
testAndSet was missing the etcd: prefix. Make it consistent and have a
helper function.
2013-08-15 21:38:15 -07:00
22b943e35c Merge pull request #117 from mairbek/locking
Concurrent GET requests should not block.
2013-08-15 13:27:55 -07:00
ac9801f570 Concurrent GET requests should not block. 2013-08-15 23:06:08 +03:00
b17a2e2bf1 Merge pull request #114 from zefhemel/dockerfile
Added dockerfile
2013-08-15 07:06:50 -07:00
9ede78d75f Added dockerfile 2013-08-15 10:00:37 +02:00
fe2d1c1b0e Merge pull request #109 from xiangli-cmu/fmilo
split raft server logic into separate module
2013-08-13 12:37:46 -07:00
915266d5f5 move tslconf to conf.go 2013-08-13 12:28:50 -07:00
3940196de0 move trans related func to trans.go 2013-08-13 12:23:35 -07:00
f7dc48ad00 gofmt 2013-08-13 12:17:33 -07:00
b71811375b fix race 2013-08-13 12:17:19 -07:00
82fe001c65 move etcdMux to etcd_handlers.go (better proximity code) 2013-08-13 11:52:55 -07:00
0aebf3757d use check utl 2013-08-13 11:52:55 -07:00
6299f316f1 use check util 2013-08-13 11:52:55 -07:00
3102420542 use infof instead of fmt.Printf 2013-08-13 11:52:55 -07:00
e7d15b6488 split config 2013-08-13 11:52:55 -07:00
339d8b435d move to util 2013-08-13 11:52:55 -07:00
e6d8d4046d split raft server logic into separate module 2013-08-13 11:52:55 -07:00
ad55b4236b Update README.md 2013-08-13 10:36:25 -07:00
7afbbb294d Merge pull request #102 from Mistobaan/master
minor go idiomatic fixes
2013-08-12 17:23:05 -07:00
d88bfc084b fix doc 2013-08-12 17:18:05 -07:00
ddc53c6584 use filepath 2013-08-12 17:18:05 -07:00
21c658b151 Merge pull request #86 from xiangli-cmu/master
Change snapshot to clientside
2013-08-12 10:46:34 -07:00
58e9e0c557 add comments in snapshot.go 2013-08-12 10:41:44 -07:00
969c8ba8ca log remoteAddr in etcdHttpHandler 2013-08-12 10:29:50 -07:00
32d1681b6b change name to url in http handlers 2013-08-12 10:16:30 -07:00
6ac6dfcc52 Merge pull request #100 from xiangli-cmu/fix95
fixes #95
2013-08-12 09:30:48 -07:00
928781aaa3 fix #95 2013-08-12 09:24:33 -07:00
1107f1d7ab Merge pull request #98 from philips/node-library
feat(README): add node library
2013-08-12 09:06:51 -07:00
1bf4e656a8 feat(README): add node library
Thanks for @stianeikeland for starting a node-etcd library.
2013-08-12 08:59:40 -07:00
aad1626dc9 typo(README): thanks asbjorn 2013-08-12 00:03:06 -07:00
2b14fbebde Merge pull request #94 from philips/fixup-readme
feat(README): point people at etcdctl
2013-08-11 19:36:56 -07:00
e8a284d295 feat(README): point people at etcdctl
etcdctl is included in the releases so point people at it.
2013-08-11 19:10:35 -07:00
0e26d96791 Merge pull request #93 from philips/fixup-readme
README fixups
2013-08-11 19:05:54 -07:00
b3654e68d9 fix(README): fixup a grammar bug 2013-08-11 19:05:06 -07:00
9d85c741d9 fix(README): use -n everywhere 2013-08-11 19:03:43 -07:00
47babce767 feat(README): add the active-proxy project 2013-08-11 17:40:19 -07:00
408d0caafc fix(README): remove url highlight
```url isn't a thing. delete it.
2013-08-11 17:19:57 -07:00
8e48a20c85 clean up trans.go 2013-08-11 11:56:18 -07:00
8f3e6f340f remove duplicate codes 2013-08-11 11:42:38 -07:00
6120fa634e remove duplicate codes 2013-08-11 11:40:45 -07:00
fa6c8f4f18 fix naming in long_test.go 2013-08-11 11:04:15 -07:00
1124fe21a0 cleaning up 2013-08-11 10:18:40 -07:00
e3dae8fcf9 do not print out debug info when testing 2013-08-11 09:53:02 -07:00
d3649d3254 gofmt 2013-08-11 09:48:12 -07:00
434b0045db add snapshot 2013-08-11 09:47:23 -07:00
64eeca3941 add snpshot 2013-08-11 09:47:10 -07:00
788 changed files with 72151 additions and 82598 deletions

9
.gitignore vendored
View File

@ -1,4 +1,5 @@
src/
pkg/
./etcd
release_version.go
/pkg
/go-bindata
/machine*
/bin
/src

20
.header Normal file
View File

@ -0,0 +1,20 @@
/*
Copyright 2013 CoreOS Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package x
import (
)

View File

@ -1,8 +0,0 @@
language: go
go: 1.1
install:
- echo "Skip install"
script:
- ./test

44
CHANGELOG Normal file
View File

@ -0,0 +1,44 @@
v0.3.0
* Add Compare-and-Delete support.
* Added prevNode to response objects.
* Added Discovery API.
* Add tracing and debug endpoints (Documentation/debugging.md).
* Improved logging of cluster events.
* go get github.com/coreos/etcd works.
* info file is no longer used.
* Snapshots are on by default.
* Statistics APIs documented.
v0.2.0
* Support directory creation and removal.
* Add Compare-and-Swap (CAS) support.
* Support recursive GETs.
* Support fully consistent GETs.
* Allow clients to watch specific paths.
* Allow clients to watch for key expiration.
* Unique key generation.
* Support hidden paths.
* Refactor low-level data store.
* Modularize store, server and API code.
* Integrate Gorilla Web Toolkit.
* Add tiered configuration (command line args, env variables, config file).
* Add peer protocol versioning.
* Add rolling upgrade support for future versions.
* Sync key expiration across cluster.
* Significantly improve test coverage.
* Improve migration testing.
* Configurable snapshot count.
* Reduce TCP connection count.
* Fix TCP connection leak.
* Bug Fixes: https://github.com/coreos/etcd/issues?milestone=1&state=closed
Contributors:
* Xiang Li (@xiangli-cmu)
* Ben Johnson (@benbjohnson)
* Brandon Philips (@philips)
* Yifan (@yifan-gu)
* Rob Szumski
* Hongchao Deng (@fengjingchao)
* Kelsey Hightower (@kelseyhightower)
* Adrián (@adrianlzt)
* Antonio Terreno (@aterreno)

75
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,75 @@
# How to contribute
etcd is open source, Apache 2.0 licensed and accepts contributions via Github pull requests.
This document outlines some of the conventions on commit message formatting, contact points for developers and other resources to make getting your contribution into etcd easier.
# Email and chat
For simplicity etcd discussions happen on coreos-dev and in #coreos-dev.
As the community grows we will move to a dedicated mailing list and IRC channel.
- Email: [coreos-dev](https://groups.google.com/forum/#!forum/coreos-dev)
- IRC: #[coreos](irc://irc.freenode.org:6667/#coreos) IRC channel on freenode.org
## Getting Started
- Fork the repository on GitHub
- Read the README.md for build instructions
## Contribution flow
This is a rough outline of what a contributor's workflow looks like:
- Create a topic branch from where you want to base your work. This is usually master.
- Make commits of logical units.
- Make sure your commit messages are in the proper format, see below
- Push your changes to a topic branch in your fork of the repository.
- Submit a pull request to coreos/etcd
Thanks for you contributions!
### Format of the commit message
etcd follow a rough convention for commit messages borrowed from Angularjs.
This is an example of a commit:
```
feat(scripts/test-cluster): add a cluster test command
this uses tmux to setup a test cluster that you can easily kill and
start for debugging.
```
To make it more formal it looks something like this:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The first line is the subject and should not be longer than 70 characters, the second line is always blank and other lines should be wrapped at 80 characters.
This allows the message to be easier to read on github as well as in various git tools.
### Subject line
The subject line contains succinct description of the change.
### Allowed <type>
- feat (feature)
- fix (bug fix)
- docs (documentation)
- style (formatting, missing semi colons, …)
- refactor
- test (when adding missing tests)
- chore (maintain)
### Allowed <scope>
Scopes could be anything specifying place of the commit change. For example store, api, etc.
### More details on commits
For more details see the [angularjs commit style guide](https://docs.google.com/a/coreos.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit#).

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM ubuntu:12.04
# Let's install go just like Docker (from source).
RUN apt-get update -q
RUN apt-get install -qy build-essential curl git
RUN curl -s https://go.googlecode.com/files/go1.2.src.tar.gz | tar -v -C /usr/local -xz
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
ENV PATH /usr/local/go/bin:$PATH
ADD . /opt/etcd
RUN cd /opt/etcd && ./build
EXPOSE 4001 7001
ENTRYPOINT ["/opt/etcd/bin/etcd"]

1062
Documentation/api.md Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
# Client libraries support matrix for etcd
As etcd features support is really uneven between client libraries, a compatibility matrix can be important.
We will consider in detail only the features of clients supporting the v2 API. Clients still supporting the v1 API *only* are listed below.
## v1-only clients
Clients supporting only the API version 1
- [justinsb/jetcd](https://github.com/justinsb/jetcd) Java
- [transitorykris/etcd-py](https://github.com/transitorykris/etcd-py) Python
- [russellhaering/txetcd](https://github.com/russellhaering/txetcd) Python
- [iconara/etcd-rb](https://github.com/iconara/etcd-rb) Ruby
- [jpfuentes2/etcd-ruby](https://github.com/jpfuentes2/etcd-ruby) Ruby
- [aterreno/etcd-clojure](https://github.com/aterreno/etcd-clojure) Clojure
- [marshall-lee/etcd.erl](https://github.com/marshall-lee/etcd.erl) Erlang
## v2 clients
The v2 API has a lot of features, we will categorize them in a few categories:
- **HTTPS Auth**: Support for SSL-certificate based authentication
- **Reconnect**: If the client is able to reconnect automatically to another server if one fails.
- **Mod/Lock**: Support for the locking module
- **Mod/Leader**: Support for the leader election module
- **GET,PUT,POST,DEL Features**: Support for all the modifiers when calling the etcd server with said HTTP method.
### Supported features matrix
| Client| [go-etcd](https://github.com/coreos/go-etcd) | [jetcd](https://github.com/diwakergupta/jetcd) | [python-etcd](https://github.com/jplana/python-etcd) | [python-etcd-client](https://github.com/dsoprea/PythonEtcdClient) | [node-etcd](https://github.com/stianeikeland/node-etcd) | [nodejs-etcd](https://github.com/lavagetto/nodejs-etcd) | [etcd-ruby](https://github.com/ranjib/etcd-ruby) | [etcd-api](https://github.com/jdarcy/etcd-api) | [cetcd](https://github.com/dwwoelfel/cetcd) | [clj-etcd](https://github.com/rthomas/clj-etcd) | [etcetera](https://github.com/drusellers/etcetera)|
| --- | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| **HTTPS Auth** | Y | Y | Y | Y | Y | Y | - | - | - | - | - |
| **Reconnect** | Y | - | Y | Y | - | - | - | Y | - | - | - |
| **Mod/Lock** | Y | - | Y | Y | - | - | - | - | - | - | - |
| **Mod/Leader** | Y | - | - | Y | - | - | - | - | - | - | - |
| **GET Features** | F | B | F | F | F | F | F | B | F | G | F |
| **PUT Features** | F | B | F | F | F | F | F | G | F | G | F |
| **POST Features** | F | - | F | F | - | F | F | - | - | - | F |
| **DEL Features** | F | B | F | F | F | F | F | B | G | B | F |
**Legend**
**F**: Full support **G**: Good support **B**: Basic support
**Y**: Feature supported **-**: Feature not supported

View File

@ -0,0 +1,45 @@
# Cluster Discovery
## Overview
Starting an etcd cluster can be painful since each node needs to know of another node in the cluster to get started. If you are trying to bring up a cluster all at once, say using a cloud formation, you also need to coordinate who will be the initial cluster leader. The discovery protocol helps you by providing an automated way to discover other existing peers in a cluster.
## Using discovery.etcd.io
### Create a Token
To use the discovery API, you must first create a token for your etcd cluster. Visit [https://discovery.etcd.io/new](https://discovery.etcd.io/new) to create a new token.
You can inspect the list of peers by viewing `https://discovery.etcd.io/<token>`.
### Start etcd With the Discovery Flag
Specify the `-discovery` flag when you start each etcd instance. The list of existing peers in the cluster will be downloaded and configured. If the instance is the first peer, it will start as the leader of the cluster.
Here's a full example:
```
TOKEN=$(curl https://discovery.etcd.io/new)
./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery https://discovery.etcd.io/$TOKEN
./etcd -name instance2 -peer-addr 10.1.2.4:7002 -addr 10.1.2.4:4002 -discovery https://discovery.etcd.io/$TOKEN
```
## Running Your Own Discovery Endpoint
The discovery API communicates with a separate etcd cluster to store and retrieve the list of peers. CoreOS provides [https://discovery.etcd.io](https://discovery.etcd.io) as a free service, but you can easily run your own etcd cluster for this purpose. Here's an example using an etcd cluster located at `10.10.10.10:4001`:
```
TOKEN="testcluster"
./etcd -name instance1 -peer-addr 10.1.2.3:7001 -addr 10.1.2.3:4001 -discovery http://10.10.10.10:4001/v2/keys/$TOKEN
./etcd -name instance2 -peer-addr 10.1.2.4:7002 -addr 10.1.2.4:4002 -discovery http://10.10.10.10:4001/v2/keys/$TOKEN
```
If you're interested in how to discovery API works behind the scenes, read about the [Discovery Protocol](https://github.com/coreos/etcd/blob/master/Documentation/discovery-protocol.md).
## Setting Peer Addresses Correctly
The Discovery API submits the `-peer-addr` of each etcd instance to the configured Discovery endpoint. It's important to select an address that *all* peers in the cluster can communicate with. For example, if you're located in two regions of a cloud provider, configuring a private `10.x` address will not work between the two regions, and communication will not be possible between all peers.
## Stale Peers
The discovery API will automatically clean up the address of a stale peer that is no longer part of the cluster. The TTL for this process is a week, which should be long enough to handle any extremely long outage you may encounter. There is no harm in having stale peers in the list until they are cleaned up, since an etcd instance only needs to connect to one valid peer in the cluster to join.

174
Documentation/clustering.md Normal file
View File

@ -0,0 +1,174 @@
## Clustering
### Example cluster of three machines
Let's explore the use of etcd clustering.
We use Raft as the underlying distributed protocol which provides consistency and persistence of the data across all of the etcd instances.
Let start by creating 3 new etcd instances.
We use `-peer-addr` to specify server port and `-addr` to specify client port and `-data-dir` to specify the directory to store the log and info of the machine in the cluster:
```sh
./etcd -peer-addr 127.0.0.1:7001 -addr 127.0.0.1:4001 -data-dir machines/machine1 -name machine1
```
**Note:** If you want to run etcd on an external IP address and still have access locally, you'll need to add `-bind-addr 0.0.0.0` so that it will listen on both external and localhost addresses.
A similar argument `-peer-bind-addr` is used to setup the listening address for the server port.
Let's join two more machines to this cluster using the `-peers` argument. A single connection to any peer will allow a new machine to join, but multiple can be specified for greater resiliency.
```sh
./etcd -peer-addr 127.0.0.1:7002 -addr 127.0.0.1:4002 -peers 127.0.0.1:7001,127.0.0.1:7003 -data-dir machines/machine2 -name machine2
./etcd -peer-addr 127.0.0.1:7003 -addr 127.0.0.1:4003 -peers 127.0.0.1:7001,127.0.0.1:7002 -data-dir machines/machine3 -name machine3
```
We can retrieve a list of machines in the cluster using the HTTP API:
```sh
curl -L http://127.0.0.1:4001/v2/machines
```
We should see there are three machines in the cluster
```
http://127.0.0.1:4001, http://127.0.0.1:4002, http://127.0.0.1:4003
```
The machine list is also available via the main key API:
```sh
curl -L http://127.0.0.1:4001/v2/keys/_etcd/machines
```
```json
{
"action": "get",
"node": {
"createdIndex": 1,
"dir": true,
"key": "/_etcd/machines",
"modifiedIndex": 1,
"nodes": [
{
"createdIndex": 1,
"key": "/_etcd/machines/machine1",
"modifiedIndex": 1,
"value": "raft=http://127.0.0.1:7001&etcd=http://127.0.0.1:4001"
},
{
"createdIndex": 2,
"key": "/_etcd/machines/machine2",
"modifiedIndex": 2,
"value": "raft=http://127.0.0.1:7002&etcd=http://127.0.0.1:4002"
},
{
"createdIndex": 3,
"key": "/_etcd/machines/machine3",
"modifiedIndex": 3,
"value": "raft=http://127.0.0.1:7003&etcd=http://127.0.0.1:4003"
}
]
}
}
```
We can also get the current leader in the cluster:
```
curl -L http://127.0.0.1:4001/v2/leader
```
The first server we set up should still be the leader unless it has died during these commands.
```
http://127.0.0.1:7001
```
Now we can do normal SET and GET operations on keys as we explored earlier.
```sh
curl -L http://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar
```
```json
{
"action": "set",
"node": {
"createdIndex": 4,
"key": "/foo",
"modifiedIndex": 4,
"value": "bar"
}
}
```
### Killing Nodes in the Cluster
Now if we kill the leader of the cluster, we can get the value from one of the other two machines:
```sh
curl -L http://127.0.0.1:4002/v2/keys/foo
```
We can also see that a new leader has been elected:
```
curl -L http://127.0.0.1:4002/v2/leader
```
```
http://127.0.0.1:7002
```
or
```
http://127.0.0.1:7003
```
### Testing Persistence
Next we'll kill all the machines to test persistence.
Type `CTRL-C` on each terminal and then rerun the same command you used to start each machine.
Your request for the `foo` key will return the correct value:
```sh
curl -L http://127.0.0.1:4002/v2/keys/foo
```
```json
{
"action": "get",
"node": {
"createdIndex": 4,
"key": "/foo",
"modifiedIndex": 4,
"value": "bar"
}
}
```
### Using HTTPS between servers
In the previous example we showed how to use SSL client certs for client-to-server communication.
Etcd can also do internal server-to-server communication using SSL client certs.
To do this just change the `-*-file` flags to `-peer-*-file`.
If you are using SSL for server-to-server communication, you must use it on all instances of etcd.
### What size cluster should I use?
Every command the client sends to the master is broadcast to all of the followers.
The command is not committed until the majority of the cluster peers receive that command.
Because of this majority voting property, the ideal cluster should be kept small to keep speed up and be made up of an odd number of peers.
Odd numbers are good because if you have 8 peers the majority will be 5 and if you have 9 peers the majority will still be 5.
The result is that an 8 peer cluster can tolerate 3 peer failures and a 9 peer cluster can tolerate 4 machine failures.
And in the best case when all 9 peers are responding the cluster will perform at the speed of the fastest 5 machines.

View File

@ -0,0 +1,102 @@
# Etcd Configuration
Configuration options can be set in three places:
1. Command line flags
2. Environment variables
3. Configuration file
Options set on the command line take precedence over all other sources.
Options set in environment variables take precedence over options set in
configuration files.
## Command Line Flags
### Required
* `-name` - The node name. Defaults to the hostname.
### Optional
* `-addr` - The advertised public hostname:port for client communication. Defaults to `127.0.0.1:4001`.
* `-discovery` - A URL to use for discovering the peer list. (i.e `"https://discovery.etcd.io/your-unique-key"`).
* `-bind-addr` - The listening hostname for client communication. Defaults to advertised ip.
* `-peers` - A comma separated list of peers in the cluster (i.e `"203.0.113.101:7001,203.0.113.102:7001"`).
* `-peers-file` - The file path containing a comma separated list of peers in the cluster.
* `-ca-file` - The path of the client CAFile. Enables client cert authentication when present.
* `-cert-file` - The cert file of the client.
* `-key-file` - The key file of the client.
* `-config` - The path of the etcd config file. Defaults to `/etc/etcd/etcd.conf`.
* `-cors` - A comma separated white list of origins for cross-origin resource sharing.
* `-cpuprofile` - The path to a file to output cpu profile data. Enables cpu profiling when present.
* `-data-dir` - The directory to store log and snapshot. Defaults to the current working directory.
* `-max-result-buffer` - The max size of result buffer. Defaults to `1024`.
* `-max-cluster-size` - The max size of the cluster. Defaults to `9`.
* `-max-retry-attempts` - The max retry attempts when trying to join a cluster. Defaults to `3`.
* `-peer-addr` - The advertised public hostname:port for server communication. Defaults to `127.0.0.1:7001`.
* `-peer-bind-addr` - The listening hostname for server communication. Defaults to advertised ip.
* `-peer-ca-file` - The path of the CAFile. Enables client/peer cert authentication when present.
* `-peer-cert-file` - The cert file of the server.
* `-peer-key-file` - The key file of the server.
* `-snapshot=false` - Disable log snapshots. Defaults to `true`.
* `-v` - Enable verbose logging. Defaults to `false`.
* `-vv` - Enable very verbose logging. Defaults to `false`.
* `-version` - Print the version and exit.
## Configuration File
The etcd configuration file is written in [TOML](https://github.com/mojombo/toml)
and read from `/etc/etcd/etcd.conf` by default.
```TOML
addr = "127.0.0.1:4001"
bind_addr = "127.0.0.1:4001"
ca_file = ""
cert_file = ""
cors = []
cpu_profile_file = ""
data_dir = "."
key_file = ""
peers = []
peers_file = ""
max_cluster_size = 9
max_result_buffer = 1024
max_retry_attempts = 3
name = "default-name"
snapshot = false
verbose = false
very_verbose = false
[peer]
addr = "127.0.0.1:7001"
bind_addr = "127.0.0.1:7001"
ca_file = ""
cert_file = ""
key_file = ""
```
## Environment Variables
* `ETCD_ADDR`
* `ETCD_BIND_ADDR`
* `ETCD_CA_FILE`
* `ETCD_CERT_FILE`
* `ETCD_CORS_ORIGINS`
* `ETCD_CONFIG`
* `ETCD_CPU_PROFILE_FILE`
* `ETCD_DATA_DIR`
* `ETCD_KEY_FILE`
* `ETCD_PEERS`
* `ETCD_PEERS_FILE`
* `ETCD_MAX_CLUSTER_SIZE`
* `ETCD_MAX_RESULT_BUFFER`
* `ETCD_MAX_RETRY_ATTEMPTS`
* `ETCD_NAME`
* `ETCD_SNAPSHOT`
* `ETCD_VERBOSE`
* `ETCD_VERY_VERBOSE`
* `ETCD_PEER_ADDR`
* `ETCD_PEER_BIND_ADDR`
* `ETCD_PEER_CA_FILE`
* `ETCD_PEER_CERT_FILE`
* `ETCD_PEER_KEY_FILE`

View File

@ -0,0 +1,69 @@
# Debugging etcd
Diagnosing issues in a distributed application is hard.
etcd will help as much as it can - just enable these debug features using the CLI flag `-trace=*` or the config option `trace=*`.
## Logging
Log verbosity can be increased to the max using either the `-vvv` CLI flag or the `very_very_verbose=true` config option.
The only supported logging mode is to stdout.
## Metrics
etcd itself can generate a set of metrics.
These metrics represent many different internal data points that can be helpful when debugging etcd servers.
#### Metrics reference
Each individual metric name is prefixed with `etcd.<NAME>`, where \<NAME\> is the configured name of the etcd server.
* `timer.appendentries.handle`: amount of time a peer takes to process an AppendEntriesRequest from the POV of the peer itself
* `timer.peer.<PEER>.heartbeat`: amount of time a peer heartbeat operation takes from the POV of the leader that initiated that operation for peer \<PEER\>
* `timer.command.<COMMAND>`: amount of time a given command took to be processed through the local server's raft state machine. This does not include time waiting on locks.
#### Fetching metrics over HTTP
Once tracing has been enabled on a given etcd server, all metric data is available at the server's `/debug/metrics` HTTP endpoint (i.e. `http://127.0.0.1:4001/debug/metrics`).
Executing a GET HTTP command against the metrics endpoint will yield the current state of all metrics in the etcd server.
#### Sending metrics to Graphite
etcd supports [Graphite's Carbon plaintext protocol](https://graphite.readthedocs.org/en/latest/feeding-carbon.html#the-plaintext-protocol) - a TCP wire protocol designed for shipping metric data to an aggregator.
To send metrics to a Graphite endpoint using this protocol, use of the `-graphite-host` CLI flag or the `graphite_host` config option (i.e. `graphite_host=172.17.0.19:2003`).
See an [example graphite deploy script](https://github.com/coreos/etcd/contrib/graphite).
#### Generating additional metrics with Collectd
[Collectd](http://collectd.org/documentation.shtml) gathers metrics from the host running etcd.
While these aren't metrics generated by etcd itself, it can be invaluable to compare etcd's view of the world to that of a separate process running next to etcd.
See an [example collectd deploy script](https://github.com/coreos/etcd/contrib/collectd).
## Profiling
etcd exposes profiling information from the Go pprof package over HTTP.
The basic browseable interface is served by etcd at the `/debug/pprof` HTTP endpoint (i.e. `http://127.0.0.1:4001/debug/pprof`).
For more information on using profiling tools, see http://blog.golang.org/profiling-go-programs.
**NOTE**: In the following examples you need to ensure that the `./bin/etcd` is identical to the `./bin/etcd` that you are targetting (same git hash, arch, platform, etc).
#### Heap memory profile
```
go tool pprof ./bin/etcd http://127.0.0.1:4001/debug/pprof/heap
```
#### CPU profile
```
go tool pprof ./bin/etcd http://127.0.0.1:4001/debug/pprof/profile
```
#### Blocked goroutine profile
```
go tool pprof ./bin/etcd http://127.0.0.1:4001/debug/pprof/block
```

View File

@ -0,0 +1,87 @@
# Discovery Protocol
Starting a new etcd cluster can be painful since each machine needs to know of at least one live machine in the cluster. If you are trying to bring up a new cluster all at once, say using an AWS cloud formation, you also need to coordinate who will be the initial cluster leader. The discovery protocol uses an existing running etcd cluster to start a second etcd cluster.
To use this feature you add the command line flag `-discovery` to your etcd args. In this example we will use `http://example.com/v2/keys/_etcd/registry` as the URL prefix.
## The Protocol
By convention the etcd discovery protocol uses the key prefix `_etcd/registry`. A full URL to the keyspace will be `http://example.com/v2/keys/_etcd/registry`.
### Creating a New Cluster
Generate a unique token that will identify the new cluster. This will be used as a key prefix in the following steps. An easy way to do this is to use uuidgen:
```
UUID=$(uuidgen)
```
### Bringing up Machines
Now that you have your cluster ID you can start bringing up machines. Every machine will follow this protocol internally in etcd if given a `-discovery`.
### Registering your Machine
The first thing etcd must do is register your machine. This is done by using the machine name (from the `-name` arg) and posting it with a long TTL to the given key.
```
curl -X PUT "http://example.com/v2/keys/_etcd/registry/${UUID}/${etcd_machine_name}?ttl=604800" -d value=${peer_addr}
```
### Discovering Peers
Now that this etcd machine is registered it must discover its peers.
But, the tricky bit of starting a new cluster is that one machine needs to assume the initial role of leader and will have no peers. To figure out if another machine has already started the cluster etcd needs to create the `_state` key and set its value to "started":
```
curl -X PUT "http://example.com/v2/keys/_etcd/registry/${UUID}/_state?prevExist=false" -d value=started
```
If this returns a `200 OK` response then this machine is the initial leader and should start with no peers configured. If, however, this returns a `412 Precondition Failed` then you need to find all of the registered peers:
```
curl -X GET "http://example.com/v2/keys/_etcd/registry/${UUID}?recursive=true"
```
```
{
"action": "get",
"node": {
"createdIndex": 11,
"dir": true,
"key": "/_etcd/registry/9D4258A5-A1D3-4074-8837-31C1E091131D",
"modifiedIndex": 11,
"nodes": [
{
"createdIndex": 16,
"expiration": "2014-02-03T13:19:57.631253589-08:00",
"key": "/_etcd/registry/9D4258A5-A1D3-4074-8837-31C1E091131D/peer1",
"modifiedIndex": 16,
"ttl": 604765,
"value": "127.0.0.1:7001"
},
{
"createdIndex": 17,
"expiration": "2014-02-03T13:19:57.631253589-08:00",
"key": "/_etcd/registry/9D4258A5-A1D3-4074-8837-31C1E091131D/peer2",
"modifiedIndex": 17,
"ttl": 604765,
"value": "127.0.0.1:7002"
}
]
}
}
```
Using this information you can connect to the rest of the peers in the cluster.
### Heartbeating
At this point etcd will start heart beating to your registration URL. The
protocol uses a heartbeat so permanently deleted nodes get slowly removed from
the discovery information cluster.
The heartbeat interval is about once per day and the TTL is one week. This
should give a sufficiently wide window to protect against a discovery service
taking a temporary outage yet provide adequate cleanup.

View File

@ -0,0 +1,58 @@
Error Code
======
This document describes the error code in **Etcd** project.
It's categorized into four groups:
- Command Related Error
- Post Form Related Error
- Raft Related Error
- Etcd Related Error
Error code corresponding strerror
------
const (
EcodeKeyNotFound = 100
EcodeTestFailed = 101
EcodeNotFile = 102
EcodeNoMorePeer = 103
EcodeNotDir = 104
EcodeNodeExist = 105
EcodeKeyIsPreserved = 106
EcodeValueRequired = 200
EcodePrevValueRequired = 201
EcodeTTLNaN = 202
EcodeIndexNaN = 203
EcodeRaftInternal = 300
EcodeLeaderElect = 301
EcodeWatcherCleared = 400
EcodeEventIndexCleared = 401
)
// command related errors
errors[100] = "Key Not Found"
errors[101] = "Test Failed" //test and set
errors[102] = "Not A File"
errors[103] = "Reached the max number of peers in the cluster"
errors[104] = "Not A Directory"
errors[105] = "Already exists" // create
errors[106] = "The prefix of given key is a keyword in etcd"
// Post form related errors
errors[200] = "Value is Required in POST form"
errors[201] = "PrevValue is Required in POST form"
errors[202] = "The given TTL in POST form is not a number"
errors[203] = "The given index in POST form is not a number"
// raft related errors
errors[300] = "Raft Internal Error"
errors[301] = "During Leader Election"
// etcd related errors
errors[400] = "watcher is cleared due to etcd recovery"
errors[401] = "The event in requested index is outdated and cleared"

View File

@ -0,0 +1,101 @@
#Etcd File System
## Structure
[TODO]
![alt text](./img/etcd_fs_structure.jpg "etcd file system structure")
## Node
In **etcd**, the **node** is the base from which the filesystem is constructed.
**etcd**'s file system is Unix-like with two kinds of nodes: file and directories.
- A **file node** has data associated with it.
- A **directory node** has child nodes associated with it.
All nodes, regardless of type, have the following attributes and operations:
### Attributes:
- **Expiration Time** [optional]
The node will be deleted when it expires.
- **ACL**
The path to the node's access control list.
### Operation:
- **Get** (path, recursive, sorted)
Get the content of the node
- If the node is a file, the data of the file will be returned.
- If the node is a directory, the child nodes of the directory will be returned.
- If recursive is true, it will recursively get the nodes of the directory.
- If sorted is true, the result will be sorted based on the path.
- **Create** (path, value[optional], ttl [optional])
Create a file. Create operation will help to create intermediate directories with no expiration time.
- If the file already exists, create will fail.
- If the value is given, set will create a file.
- If the value is not given, set will crate a directory.
- If ttl is given, the node will be deleted when it expires.
- **Update** (path, value[optional], ttl [optional])
Update the content of the node.
- If the value is given, the value of the key will be updated.
- If ttl is given, the expiration time of the node will be updated.
- **Delete** (path, recursive)
Delete the node of given path.
- If the node is a directory:
- If recursive is true, the operation will delete all nodes under the directory.
- If recursive is false, error will be returned.
- **TestAndSet** (path, prevValue [prevIndex], value, ttl)
Atomic *test and set* value to a file. If test succeeds, this operation will change the previous value of the file to the given value.
- If the prevValue is given, it will test against previous value of
the node.
- If the prevValue is empty, it will test if the node is not existing.
- If the prevValue is not empty, it will test if the prevValue is equal to the current value of the file.
- If the prevIndex is given, it will test if the create/last modified index of the node is equal to prevIndex.
- **Renew** (path, ttl)
Set the node's expiration time to (current time + ttl)
## ACL
### Theory
Etcd exports a Unix-like file system interface consisting of files and directories, collectively called nodes.
Each node has various meta-data, including three names of the access control lists used to control reading, writing and changing (change ACL names for the node).
We are storing the ACL names for nodes under a special *ACL* directory.
Each node has ACL name corresponding to one file within *ACL* dir.
Unless overridden, a node naturally inherits the ACL names of its parent directory on creation.
For each ACL name, it has three children: *R (Reading)*, *W (Writing)*, *C (Changing)*
Each permission is also a node. Under the node it contains the users who have this permission for the file refering to this ACL name.
### Example
[TODO]
### Diagram
[TODO]
### Interface
Testing permissions:
- (node *Node) get_perm()
- (node *Node) has_perm(perm string, user string)
Setting/Changing permissions:
- (node *Node) set_perm(perm string)
- (node *Node) change_ACLname(aclname string)
## User Group
[TODO]

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -0,0 +1,61 @@
# Versioning
Goal: We want to be able to upgrade an individual peer in an etcd cluster to a newer version of etcd.
The process will take the form of individual followers upgrading to the latest version until the entire cluster is on the new version.
Immediate need: etcd is moving too fast to version the internal API right now.
But, we need to keep mixed version clusters from being started by a rolling upgrade process (e.g. the CoreOS developer alpha).
Longer term need: Having a mixed version cluster where all peers are not running the exact same version of etcd itself but are able to speak one version of the internal protocol.
Solution: The internal protocol needs to be versioned just as the client protocol is.
Initially during the 0.\*.\* series of etcd releases we won't allow mixed versions at all.
## Join Control
We will add a version field to the join command.
But, who decides whether a newly upgraded follower should be able to join a cluster?
### Leader Controlled
If the leader controls the version of followers joining the cluster then it compares its version to the version number presented by the follower in the JoinCommand and rejects the join if the number is less than the leader's version number.
Advantages
- Leader controls all cluster decisions still
Disadvantages
- Follower knows better what versions of the interal protocol it can talk than the leader
### Follower Controlled
A newly upgraded follower should be able to figure out the leaders internal version from a defined internal backwards compatible API endpoint and figure out if it can join the cluster.
If it cannot join the cluster then it simply exits.
Advantages
- The follower is running newer code and knows better if it can talk older protocols
Disadvantages
- This cluster decision isn't made by the leader
## Recommendation
To solve the immediate need and to plan for the future lets do the following:
- Add Version field to JoinCommand
- Have a joining follower read the Version field of the leader and if its own version doesn't match the leader then sleep for some random interval and retry later to see if the leader has upgraded.
# Research
## Zookeeper versioning
Zookeeper very recently added versioning into the protocol and it doesn't seem to have seen any use yet.
https://issues.apache.org/jira/browse/ZOOKEEPER-1633
## doozerd
doozerd stores the version number of the peers in the datastore for other clients to check, no decisions are made off of this number currently.

View File

@ -0,0 +1,79 @@
## Libraries and Tools
**Tools**
- [etcdctl](https://github.com/coreos/etcdctl) - A command line client for etcd
- [etcd-dump](https://npmjs.org/package/etcd-dump) - Command line utility for dumping/restoring etcd.
**Go libraries**
- [go-etcd](https://github.com/coreos/go-etcd) - Supports v2
**Java libraries**
- [justinsb/jetcd](https://github.com/justinsb/jetcd)
- [diwakergupta/jetcd](https://github.com/diwakergupta/jetcd) - Supports v2
**Python libraries**
- [transitorykris/etcd-py](https://github.com/transitorykris/etcd-py)
- [jplana/python-etcd](https://github.com/jplana/python-etcd) - Supports v2
- [russellhaering/txetcd](https://github.com/russellhaering/txetcd) - a Twisted Python library
**Node libraries**
- [stianeikeland/node-etcd](https://github.com/stianeikeland/node-etcd) - Supports v2 (w Coffeescript)
- [lavagetto/nodejs-etcd](https://github.com/lavagetto/nodejs-etcd) - Supports v2
**Ruby libraries**
- [iconara/etcd-rb](https://github.com/iconara/etcd-rb)
- [jpfuentes2/etcd-ruby](https://github.com/jpfuentes2/etcd-ruby)
- [ranjib/etcd-ruby](https://github.com/ranjib/etcd-ruby) - Supports v2
**C libraries**
- [jdarcy/etcd-api](https://github.com/jdarcy/etcd-api) - Supports v2
**Clojure libraries**
- [aterreno/etcd-clojure](https://github.com/aterreno/etcd-clojure)
- [dwwoelfel/cetcd](https://github.com/dwwoelfel/cetcd) - Supports v2
- [rthomas/clj-etcd](https://github.com/rthomas/clj-etcd) - Supports v2
**Erlang libraries**
- [marshall-lee/etcd.erl](https://github.com/marshall-lee/etcd.erl)
**.Net Libraries**
-[drusellers/etcetera](https://github.com/drusellers/etcetera)
A detailed recap of client functionalities can be found in the [clients compatibility matrix][clients-matrix.md].
[clients-matrix.md]: https://github.com/coreos/etcd/blob/master/Documentation/clients-matrix.md
**Chef Integration**
- [coderanger/etcd-chef](https://github.com/coderanger/etcd-chef)
**Chef Cookbook**
- [spheromak/etcd-cookbook](https://github.com/spheromak/etcd-cookbook)
**BOSH Releases**
- [cloudfoundry-community/etcd-boshrelease](https://github.com/cloudfoundry-community/etcd-boshrelease)
- [cloudfoundry/cf-release](https://github.com/cloudfoundry/cf-release/tree/master/jobs/etcd)
**Projects using etcd**
- [binocarlos/yoda](https://github.com/binocarlos/yoda) - etcd + ZeroMQ
- [calavera/active-proxy](https://github.com/calavera/active-proxy) - HTTP Proxy configured with etcd
- [derekchiang/etcdplus](https://github.com/derekchiang/etcdplus) - A set of distributed synchronization primitives built upon etcd
- [go-discover](https://github.com/flynn/go-discover) - service discovery in Go
- [gleicon/goreman](https://github.com/gleicon/goreman/tree/etcd) - Branch of the Go Foreman clone with etcd support
- [garethr/hiera-etcd](https://github.com/garethr/hiera-etcd) - Puppet hiera backend using etcd
- [mattn/etcd-vim](https://github.com/mattn/etcd-vim) - SET and GET keys from inside vim
- [mattn/etcdenv](https://github.com/mattn/etcdenv) - "env" shebang with etcd integration
- [kelseyhightower/confd](https://github.com/kelseyhightower/confd) - Manage local app config files using templates and data from etcd
- [configdb](https://git.autistici.org/ai/configdb/tree/master) - A REST relational abstraction on top of arbitrary database backends, aimed at storing configs and inventories.

105
Documentation/modules.md Normal file
View File

@ -0,0 +1,105 @@
## Modules
etcd has a number of modules that are built on top of the core etcd API.
These modules provide things like dashboards, locks and leader election.
### Dashboard
An HTML dashboard can be found at `http://127.0.0.1:4001/mod/dashboard/`.
This dashboard is compiled into the etcd binary and uses the same API as regular etcd clients.
Use the `-cors='*'` flag to allow your browser to request information from the current master as it changes.
### Lock
The Lock module implements a fair lock that can be used when lots of clients want access to a single resource.
A lock can be associated with a value.
The value is unique so if a lock tries to request a value that is already queued for a lock then it will find it and watch until that value obtains the lock.
If you lock the same value on a key from two separate curl sessions they'll both return at the same time.
Here's the API:
**Acquire a lock (with no value) for "customer1"**
```sh
curl -X POST http://127.0.0.1:4001/mod/v2/lock/customer1?ttl=60
```
**Acquire a lock for "customer1" that is associated with the value "bar"**
```sh
curl -X POST http://127.0.0.1:4001/mod/v2/lock/customer1?ttl=60 -d value=bar
```
**Renew the TTL on the "customer1" lock for index 2**
```sh
curl -X PUT http://127.0.0.1:4001/mod/v2/lock/customer1?ttl=60 -d index=2
```
**Renew the TTL on the "customer1" lock for value "customer1"**
```sh
curl -X PUT http://127.0.0.1:4001/mod/v2/lock/customer1?ttl=60 -d value=bar
```
**Retrieve the current value for the "customer1" lock.**
```sh
curl http://127.0.0.1:4001/mod/v2/lock/customer1
```
**Retrieve the current index for the "customer1" lock**
```sh
curl http://127.0.0.1:4001/mod/v2/lock/customer1?field=index
```
**Delete the "customer1" lock with the index 2**
```sh
curl -X DELETE http://127.0.0.1:4001/mod/v2/lock/customer1?index=2
```
**Delete the "customer1" lock with the value "bar"**
```sh
curl -X DELETE http://127.0.0.1:4001/mod/v2/lock/customer1?value=bar
```
### Leader Election
The Leader Election module wraps the Lock module to allow clients to come to consensus on a single value.
This is useful when you want one server to process at a time but allow other servers to fail over.
The API is similar to the Lock module but is limited to simple strings values.
Here's the API:
**Attempt to set a value for the "order_processing" leader key:**
```sh
curl -X PUT http://127.0.0.1:4001/mod/v2/leader/order_processing?ttl=60 -d name=myserver1.foo.com
```
**Retrieve the current value for the "order_processing" leader key:**
```sh
curl http://127.0.0.1:4001/mod/v2/leader/order_processing
myserver1.foo.com
```
**Remove a value from the "order_processing" leader key:**
```sh
curl -X DELETE http://127.0.0.1:4001/mod/v2/leader/order_processing?name=myserver1.foo.com
```
If multiple clients attempt to set the value for a key then only one will succeed.
The other clients will hang until the current value is removed because of TTL or because of a `DELETE` operation.
Multiple clients can submit the same value and will all be notified when that value succeeds.
To update the TTL of a value simply reissue the same `PUT` command that you used to set the value.

View File

@ -0,0 +1,30 @@
# Optimal etcd Cluster Size
etcd's Raft consensus algorithm is most efficient in small clusters between 3 and 9 peers. Let's briefly explore how etcd works internally to understand why.
## Writing to etcd
Writes to an etcd peer are always redirected to the leader of the cluster and distributed to all of the peers immediately. A write is only considered successful when a majority of the peers acknowledge the write.
For example, in a 5 node cluster, a write operation is only as fast as the 3rd fastest machine. This is the main reason for keeping your etcd cluster below 9 nodes. In practice, you only need to worry about write performance in high latency environments such as a cluster spanning multiple data centers.
## Leader Election
The leader election process is similar to writing a key &mdash; a majority of the cluster must acknowledge the new leader before cluster operations can continue. The longer each node takes to elect a new leader means you have to wait longer before you can write to the cluster again. In low latency environments this process takes milliseconds.
## Odd Cluster Size
The other important cluster optimization is to always have an odd cluster size. Adding an odd node to the cluster doesn't change the size of the majority and therefore doesn't increase the total latency of the majority as described above. But you do gain a higher tolerance for peer failure by adding the extra machine. You can see this in practice when comparing two even and odd sized clusters:
| Cluster Size | Majority | Failure Tolerance |
|--------------|------------|-------------------|
| 8 machines | 5 machines | 3 machines |
| 9 machines | 5 machines | **4 machines** |
As you can see, adding another node to bring the cluster up to an odd size is always worth it. During a network partition, an odd cluster size also guarantees that there will almost always be a majority of the cluster that can continue to operate and be the source of truth when the partition ends.
## Cluster Management
Currently, each CoreOS machine is an etcd peer &mdash; if you have 30 CoreOS machines, you have 30 etcd peers and end up with a cluster size that is way too large. If desired, you may manually stop some of these etcd instances to increase cluster performance.
Functionality is being developed to expose two different types of followers: active and benched followers. Active followers will influence operations within the cluster. Benched followers will not participate, but will transparently proxy etcd traffic to an active follower. This allows every CoreOS machine to expose etcd on port 4001 for ease of use. Benched followers will have the ability to transition into an active follower if needed.

View File

@ -0,0 +1,62 @@
# FreeBSD
Starting with version 0.1.2 both etcd and etcdctl have been ported to FreeBSD and can
be installed either via packages or ports system. Their versions have been recently
updated to 0.2.0 so now you can enjoy using etcd and etcdctl on FreeBSD 10.0 (RC4 as
of now) and 9.x where they have been tested. They might also work when installed from
ports on earlier versions of FreeBSD, but your mileage may vary.
## Installation
### Using pkgng package system
1. If you do not have pkg­ng installed, install it with command `pkg` and answering 'Y'
when asked
2. Update your repository data with `pkg update`
3. Install etcd with `pkg install coreos­etcd coreos­etcdctl`
4. Verify successful installation with `pkg info | grep etcd` and you should get:
```
r@fbsd­10:/ # pkg info | grep etcd
coreos­etcd­0.2.0              Highly­available key value store and service discovery
coreos­etcdctl­0.2.0           Simple commandline client for etcd
r@fbsd­10:/ #
```
5. Youre ready to use etcd and etcdctl! For more information about using pkgng, plese
see: http://www.freebsd.org/doc/handbook/pkgng­intro.html
 
### Using ports system
1. If you do not have ports installed, install with with `portsnap fetch extract` (it
may take some time depending on your hardware and network connection)
2. Build etcd with `cd /usr/ports/devel/etcd && make install clean`, you
will get an option to build and install documentation and etcdctl with it.
3. If you havent install it with etcdctl, and you would like to install it later, you can build it
with `cd /usr/ports/devel/etcdctl && make install clean`
4. Verify successful installation with `pkg info | grep etcd` and you should get:
 
```
r@fbsd­10:/ # pkg info | grep etcd
coreos­etcd­0.2.0              Highly­available key value store and service discovery
coreos­etcdctl­0.2.0           Simple commandline client for etcd
r@fbsd­10:/ #
```
5. Youre ready to use etcd and etcdctl! For more information about using ports system,
please see: https://www.freebsd.org/doc/handbook/ports­using.html
## Issues
If you find any issues with the build/install procedure or youve found a problem that
youve verified is local to FreeBSD version only (for example, by not being able to
reproduce it on any other platform, like OSX or Linux), please sent a
problem report using this page for more
information: http://www.freebsd.org/send­pr.html

130
Documentation/security.md Normal file
View File

@ -0,0 +1,130 @@
# Reading and Writing over HTTPS
## Transport Security with HTTPS
Etcd supports SSL/TLS and client cert authentication for clients to server, as well as server to server communication.
First, you need to have a CA cert `clientCA.crt` and signed key pair `client.crt`, `client.key`.
This site has a good reference for how to generate self-signed key pairs:
http://www.g-loaded.eu/2005/11/10/be-your-own-ca/
For testing you can use the certificates in the `fixtures/ca` directory.
Let's configure etcd to use this keypair:
```sh
./etcd -f -name machine0 -data-dir machine0 -cert-file=./fixtures/ca/server.crt -key-file=./fixtures/ca/server.key.insecure
```
There are a few new options we're using:
* `-f` - forces a new machine configuration, even if an existing configuration is found. (WARNING: data loss!)
* `-cert-file` and `-key-file` specify the location of the cert and key files to be used for for transport layer security between the client and server.
You can now test the configuration using HTTPS:
```sh
curl --cacert ./fixtures/ca/server-chain.pem https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```
You should be able to see the handshake succeed.
**OSX 10.9+ Users**: curl 7.30.0 on OSX 10.9+ doesn't understand certificates passed in on the command line.
Instead you must import the dummy ca.crt directly into the keychain or add the `-k` flag to curl to ignore errors.
If you want to test without the `-k` flag run `open ./fixtures/ca/ca.crt` and follow the prompts.
Please remove this certificate after you are done testing!
If you know of a workaround let us know.
```
...
SSLv3, TLS handshake, Finished (20):
...
```
And also the response from the etcd server:
```json
{
"action": "set",
"key": "/foo",
"modifiedIndex": 3,
"value": "bar"
}
```
## Authentication with HTTPS Client Certificates
We can also do authentication using CA certs.
The clients will provide their cert to the server and the server will check whether the cert is signed by the CA and decide whether to serve the request.
```sh
./etcd -f -name machine0 -data-dir machine0 -ca-file=./fixtures/ca/ca.crt -cert-file=./fixtures/ca/server.crt -key-file=./fixtures/ca/server.key.insecure
```
```-ca-file``` is the path to the CA cert.
Try the same request to this server:
```sh
curl --cacert ./fixtures/ca/server-chain.pem https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```
The request should be rejected by the server.
```
...
routines:SSL3_READ_BYTES:sslv3 alert bad certificate
...
```
We need to give the CA signed cert to the server.
```sh
curl --key ./fixtures/ca/server2.key.insecure --cert ./fixtures/ca/server2.crt --cacert ./fixtures/ca/server-chain.pem -L https://127.0.0.1:4001/v2/keys/foo -XPUT -d value=bar -v
```
You should able to see:
```
...
SSLv3, TLS handshake, CERT verify (15):
...
TLS handshake, Finished (20)
```
And also the response from the server:
```json
{
"action": "set",
"node": {
"createdIndex": 12,
"key": "/foo",
"modifiedIndex": 12,
"value": "bar"
}
}
```
### Why SSLv3 alert handshake failure when using SSL client auth?
The `crypto/tls` package of `golang` checks the key usage of the certificate public key before using it.
To use the certificate public key to do client auth, we need to add `clientAuth` to `Extended Key Usage` when creating the certificate public key.
Here is how to do it:
Add the following section to your openssl.cnf:
```
[ ssl_client ]
...
extendedKeyUsage = clientAuth
...
```
When creating the cert be sure to reference it in the `-extensions` flag:
```
openssl ca -config openssl.cnf -policy policy_anything -extensions ssl_client -out certs/machine.crt -infiles machine.csr
```

93
Documentation/tuning.md Normal file
View File

@ -0,0 +1,93 @@
## Tuning
The default settings in etcd should work well for installations on a local network where the average network latency is low.
However, when using etcd across multiple data centers or over networks with high latency you may need to tweak the heartbeat and election timeout settings.
### Timeouts
The underlying distributed consensus protocol relies on two separate timeouts to ensure that nodes can handoff leadership if one stalls or goes offline.
The first timeout is called the *Heartbeat Timeout*.
This is the frequency with which the leader will notify followers that it is still the leader.
etcd batches commands together for higher throughput so this heartbeat timeout is also a delay for how long it takes for commands to be committed.
By default, etcd uses a `50ms` heartbeat timeout.
The second timeout is the *Election Timeout*.
This timeout is how long a follower node will go without hearing a heartbeat before attempting to become leader itself.
By default, etcd uses a `200ms` election timeout.
Adjusting these values is a trade off.
Lowering the heartbeat timeout will cause individual commands to be committed faster but it will lower the overall throughput of etcd.
If your etcd instances have low utilization then lowering the heartbeat timeout can improve your command response time.
The election timeout should be set based on the heartbeat timeout and your network ping time between nodes.
Election timeouts should be at least 10 times your ping time so it can account for variance in your network.
For example, if the ping time between your nodes is 10ms then you should have at least a 100ms election timeout.
You should also set your election timeout to at least 4 to 5 times your heartbeat timeout to account for variance in leader replication.
For a heartbeat timeout of 50ms you should set your election timeout to at least 200ms - 250ms.
You can override the default values on the command line:
```sh
# Command line arguments:
$ etcd -peer-heartbeat-timeout=100 -peer-election-timeout=500
# Environment variables:
$ ETCD_PEER_HEARTBEAT_TIMEOUT=100 ETCD_PEER_ELECTION_TIMEOUT=500 etcd
```
Or you can set the values within the configuration file:
```toml
[peer]
heartbeat_timeout = 100
election_timeout = 100
```
The values are specified in milliseconds.
### Snapshots
etcd appends all key changes to a log file.
This log grows forever and is a complete linear history of every change made to the keys.
A complete history works well for lightly used clusters but clusters that are heavily used would carry around a large log.
To avoid having a huge log etcd makes periodic snapshots.
These snapshots provide a way for etcd to compact the log by saving the current state of the system and removing old logs.
### Snapshot Tuning
Creating snapshots can be expensive so they're only created after a given number of changes to etcd.
By default, snapshots will be made after every 10,000 changes.
If etcd's memory usage and disk usage are too high, you can lower the snapshot threshold by setting the following on the command line:
```sh
# Command line arguments:
$ etcd -snapshot-count=5000
# Environment variables:
$ ETCD_SNAPSHOT_COUNT=5000 etcd
```
Or you can change the setting in the configuration file:
```toml
snapshot_count = 5000
```
You can also disable snapshotting by adding the following to your command line:
```sh
# Command line arguments:
$ etcd -snapshot false
# Environment variables:
$ ETCD_SNAPSHOT=false etcd
```
You can also enable snapshotting within the configuration file:
```toml
snapshot = false
```

492
README.md
View File

@ -1,478 +1,126 @@
# etcd
[![Build Status](https://travis-ci.org/coreos/etcd.png)](https://travis-ci.org/coreos/etcd)
README version 0.2.0
A highly-available key value store for shared configuration and service discovery. etcd is inspired by zookeeper and doozer, with a focus on:
[![Build Status](https://drone.io/github.com/coreos/etcd/status.png)](https://drone.io/github.com/coreos/etcd/latest)
A highly-available key value store for shared configuration and service discovery.
etcd is inspired by zookeeper and doozer, with a focus on:
* Simple: curl'able user facing API (HTTP+JSON)
* Secure: optional SSL client cert authentication
* Fast: benchmarked 1000s of writes/s per instance
* Reliable: Properly distributed using Raft
Etcd is written in Go and uses the [raft][raft] consensus algorithm to manage a highly availably replicated log.
Etcd is written in Go and uses the [Raft][raft] consensus algorithm to manage a highly-available replicated log.
See [go-etcd][go-etcd] for a native Go client. Or feel free to just use curl, as in the examples below.
See [etcdctl][etcdctl] for a simple command line client.
Or feel free to just use curl, as in the examples below.
[raft]: https://github.com/coreos/go-raft
[go-etcd]: https://github.com/coreos/go-etcd
[etcdctl]: http://github.com/coreos/etcdctl/
## Contact
- Mailing list: http://coreos.com/lists/etcd-dev/
- IRC: #coreos on irc.freenode.net
- Planning/Roadmap: https://trello.com/b/OiEbU547/etcd
- Bugs: https://github.com/coreos/etcd/issues
## Getting Started
### Getting etcd
The latest release is available as a binary at [Github][github-release].
The latest release and setup instructions are available at [Github][github-release].
[github-release]: https://github.com/coreos/etcd/releases/
You can also buildi etcd from source:
### Building
You can build etcd from source:
```sh
git clone https://github.com/coreos/etcd
cd etcd
./build
```
### Running a single node
This will generate a binary called `./bin/etcd`.
These examples will use a single node cluster to show you the basics of the etcd REST API. Lets start etcd:
_NOTE_: you need go 1.2+. Please check your installation with
```
go version
```
### Running
First start a single machine cluster of etcd:
```sh
./etcd -d node0
./bin/etcd
```
This will bring up an etcd node listening on port 4001 for client communication and on port 7001 for server-to-server communication. The `-d node0` argument tells etcd to write node configuration, logs and snapshots to the `./node0/` directory.
This will bring up etcd listening on port 4001 for client communication and on port 7001 for server-to-server communication.
## Usage
### Setting the value to a key
Lets set the first key-value pair to the node. In this case the key is `/message` and the value is `Hello world`.
```sh
curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello world"
```
```json
{"action":"SET","key":"/message","value":"Hello world","newKey":true,"index":3}
```
This response contains five fields. We will introduce three more fields as we try more commands.
1. The action of the request; we set the value via a POST request, thus the action is `SET`.
2. The key of the request; we set `/message` to `Hello world!`, so the key field is `/message`.
Notice we use a file system like structure to represent the key-value pairs. So each key starts with `/`.
3. The current value of the key; we set the value to`Hello world`.
4. If we set a new key; `/message` did not exist before, so this is a new key.
5. Index is the unique internal log index of the set request. Requests that change the log index include `SET`, `DELETE` and `TESTANDSET`. The `GET`, `LIST` and `WATCH` commands do not change state in the store and so they do not change the index. You may notice that in this example the index is 3, although it is the first request you sent to the server. This is because there are internal commands that also change the state like adding and syncing servers.
### Get the value of a key
Get the value that we just set in `/message` by issuing a GET:
```sh
curl -L http://127.0.0.1:4001/v1/keys/message
```
```json
{"action":"GET","key":"/message","value":"Hello world","index":3}
```
### Change the value of a key
Change the value of `/message` from `Hello world` to `Hello etcd` with another POST to the key:
```sh
curl -L http://127.0.0.1:4001/v1/keys/message -d value="Hello etcd"
```
```json
{"action":"SET","key":"/message","prevValue":"Hello world","value":"Hello etcd","index":4}
```
Notice that the `prevValue` is set to `Hello world`.
### Delete a key
Remove the `/message` key with a DELETE:
```sh
curl -L http://127.0.0.1:4001/v1/keys/message -X DELETE
```
```json
{"action":"DELETE","key":"/message","prevValue":"Hello etcd","index":5}
```
### Using key TTL
Keys in etcd can be set to expire after a specified number of seconds. That is done by setting a TTL (time to live) on the key when you POST:
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo -d value=bar -d ttl=5
```
```json
{"action":"SET","key":"/foo","value":"bar","newKey":true,"expiration":"2013-07-11T20:31:12.156146039-07:00","ttl":4,"index":6}
```
Note the last two new fields in response:
1. The expiration is the time that this key will expire and be deleted.
2. The ttl is the time to live of the key.
Now you can try to get the key by sending:
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo
```
If the TTL has expired, the key will be deleted, and you will be returned a 404.
```json
{"errorCode":100,"message":"Key Not Found","cause":"/foo"}
```
### Watching a prefix
We can watch a path prefix and get notifications if any key change under that prefix.
In one terminal, we send a watch request:
```sh
curl -L http://127.0.0.1:4001/v1/watch/foo
```
Now, we are watching at the path prefix `/foo` and wait for any changes under this path.
In another terminal, we set a key `/foo/foo` to `barbar` to see what will happen:
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo/foo -d value=barbar
```
The first terminal should get the notification and return with the same response as the set request.
```json
{"action":"SET","key":"/foo/foo","value":"barbar","newKey":true,"index":7}
```
However, the watch command can do more than this. Using the the index we can watch for commands that has happened in the past. This is useful for ensuring you don't miss events between watch commands.
Let's try to watch for the set command of index 6 again:
```sh
curl -L http://127.0.0.1:4001/v1/watch/foo -d index=7
```
The watch command returns immediately with the same response as previous.
### Atomic Test and Set
Etcd can be used as a centralized coordination service in a cluster and `TestAndSet` is the most basic operation to build distributed lock service. This command will set the value only if the client provided `prevValue` is equal the current key value.
Here is a simple example. Let's create a key-value pair first: `testAndSet=one`.
```sh
curl -L http://127.0.0.1:4001/v1/keys/testAndSet -d value=one
```
Let's try an invaild `TestAndSet` command.
We can give another parameter prevValue to set command to make it a TestAndSet command.
```sh
curl -L http://127.0.0.1:4001/v1/keys/testAndSet -d prevValue=two -d value=three
```
This will try to test if the previous of the key is two, it is change it to three.
```json
{"errorCode":101,"message":"The given PrevValue is not equal to the value of the key","cause":"TestAndSet: one!=two"}
```
which means `testAndSet` failed.
Let us try a vaild one.
```sh
curl -L http://127.0.0.1:4001/v1/keys/testAndSet -d prevValue=one -d value=two
```
The response should be
```json
{"action":"SET","key":"/testAndSet","prevValue":"one","value":"two","index":10}
```
We successfully changed the value from “one” to “two”, since we give the correct previous value.
### Listing a directory
Last we provide a simple List command to list all the keys under a prefix path.
Let us create some keys first.
We already have `/foo/foo=barbar`
We create another one `/foo/foo_dir/foo=barbarbar`
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo/foo_dir/bar -d value=barbarbar
```
Now list the keys under `/foo`
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo/
```
We should see the response as an array of items
```json
[{"action":"GET","key":"/foo/foo","value":"barbar","index":10},{"action":"GET","key":"/foo/foo_dir","dir":true,"index":10}]
```
which meas `foo=barbar` is a key-value pair under `/foo` and `foo_dir` is a directory.
## Advanced Usage
### Transport security with HTTPS
Etcd supports SSL/TLS and client cert authentication for clients to server, as well as server to server communication
First, you need to have a CA cert `clientCA.crt` and signed key pair `client.crt`, `client.key`. This site has a good reference for how to generate self-signed key pairs:
```url
http://www.g-loaded.eu/2005/11/10/be-your-own-ca/
```
For testing you can use the certificates in the `fixtures/ca` directory.
Next, lets configure etcd to use this keypair:
```sh
./etcd -n node0 -d node0 -clientCert=./fixtures/ca/server.crt -clientKey=./fixtures/ca/server.key.insecure -f
```
`-f` forces new node configuration if existing configuration is found (WARNING: data loss!)
`-clientCert` and `-clientKey` are the key and cert for transport layer security between client and server
You can now test the configuration using https:
```sh
curl --cacert fixtures/ca/ca.crt https://127.0.0.1:4001/v1/keys/foo -F value=bar
```
You should be able to see the handshake succeed.
Next lets set a single key and then retrieve it:
```
...
SSLv3, TLS handshake, Finished (20):
...
curl -L http://127.0.0.1:4001/v2/keys/mykey -XPUT -d value="this is awesome"
curl -L http://127.0.0.1:4001/v2/keys/mykey
```
And also the response from the etcd server.
You have successfully started an etcd on a single machine and written a key to the store. Now it time to dig into the full etcd API and other guides.
```json
{"action":"SET","key":"/foo","value":"bar","newKey":true,"index":3}
```
### Next Steps
### Authentication with HTTPS client certificates
- Explore the full [API][api.md].
- Setup a [multi-machine cluster][clustering.md].
- Learn the [config format, env variables and flags][configuration.md].
- Find [language bindings and tools][libraries-and-tools.md].
- Learn about the dashboard, lock and leader election [modules][modules.md].
- Use TLS to [secure an etcd cluster][security.md].
- [Tune etcd][tuning.md].
We can also do authentication using CA certs. The clients will provide their cert to the server and the server will check whether the cert is signed by the CA and decide whether to serve the request.
[api.md]: https://github.com/coreos/etcd/blob/master/Documentation/api.md
[clustering.md]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md
[configuration.md]: https://github.com/coreos/etcd/blob/master/Documentation/configuration.md
[libraries-and-tools.md]: https://github.com/coreos/etcd/blob/master/Documentation/libraries-and-tools.md
[modules.md]: https://github.com/coreos/etcd/blob/master/Documentation/modules.md
[security.md]: https://github.com/coreos/etcd/blob/master/Documentation/security.md
[tuning.md]: https://github.com/coreos/etcd/blob/master/Documentation/tuning.md
```sh
./etcd -n node0 -d node0 -clientCAFile=./fixtures/ca/ca.crt -clientCert=./fixtures/ca/server.crt -clientKey=./fixtures/ca/server.key.insecure -f
```
## Contributing
```-clientCAFile``` is the path to the CA cert.
Try the same request to this server:
```sh
curl --cacert fixtures/ca/ca.crt https://127.0.0.1:4001/v1/keys/foo -F value=bar
```
The request should be rejected by the server.
```
...
routines:SSL3_READ_BYTES:sslv3 alert bad certificate
...
```
We need to give the CA signed cert to the server.
```sh
curl -L https://127.0.0.1:4001/v1/keys/foo -d value=bar -v --key myclient.key --cert myclient.crt -cacert clientCA.crt
```
You should able to see
```
...
SSLv3, TLS handshake, CERT verify (15):
...
TLS handshake, Finished (20)
```
And also the response from the server:
```json
{"action":"SET","key":"/foo","value":"bar","newKey":true,"index":3}
```
## Clustering
### Example cluster of three machines
Let's explore the use of etcd clustering. We use go-raft as the underlying distributed protocol which provides consistency and persistence of the data across all of the etcd instances.
Let start by creating 3 new etcd instances.
We use -s to specify server port and -c to specify client port and -d to specify the directory to store the log and info of the node in the cluster
```sh
./etcd -s 7001 -c 4001 -d nodes/node1
```
Let the join two more nodes to this cluster using the -C argument:
```sh
./etcd -c 4002 -s 7002 -C 127.0.0.1:7001 -d nodes/node2
./etcd -c 4003 -s 7003 -C 127.0.0.1:7001 -d nodes/node3
```
Get the machines in the cluster:
```sh
curl -L http://127.0.0.1:4001/machines
```
We should see there are three nodes in the cluster
```
0.0.0.0:4001,0.0.0.0:4002,0.0.0.0:4003
```
The machine list is also available via this API:
```sh
curl -L http://127.0.0.1:4001/v1/keys/_etcd/machines
```
```json
[{"action":"GET","key":"/machines/node1","value":"0.0.0.0,7001,4001","index":4},{"action":"GET","key":"/machines/node3","value":"0.0.0.0,7002,4002","index":4},{"action":"GET","key":"/machines/node4","value":"0.0.0.0,7003,4003","index":4}]
```
The key of the machine is based on the ```commit index``` when it was added. The value of the machine is ```hostname```, ```raft port``` and ```client port```.
Also try to get the current leader in the cluster
```
curl -L http://127.0.0.1:4001/leader
```
The first server we set up should be the leader, if it has not dead during these commands.
```
0.0.0.0:7001
```
Now we can do normal SET and GET operations on keys as we explored earlier.
```sh
curl -L http://127.0.0.1:4001/v1/keys/foo -d value=bar
```
```json
{"action":"SET","key":"/foo","value":"bar","newKey":true,"index":5}
```
### Killing Nodes in the Cluster
Let's kill the leader of the cluster and get the value from the other machine:
```sh
curl -L http://127.0.0.1:4002/v1/keys/foo
```
A new leader should have been elected.
```
curl -L http://127.0.0.1:4001/leader
```
```
0.0.0.0:7002 or 0.0.0.0:7003
```
You should be able to see this:
```json
{"action":"GET","key":"/foo","value":"bar","index":5}
```
It succeeded!
### Testing Persistence
OK. Next let us kill all the nodes to test persistence. And restart all the nodes use the same command as before.
Your request for the `foo` key will return the correct value:
```sh
curl -L http://127.0.0.1:4002/v1/keys/foo
```
```json
{"action":"GET","key":"/foo","value":"bar","index":5}
```
### Using HTTPS between servers
In the previous example we showed how to use SSL client certs for client to server communication. Etcd can also do internal server to server communication using SSL client certs. To do this just change the ```-client*``` flags to ```-server*```.
If you are using SSL for server to server communication, you must use it on all instances of etcd.
## Libraries and Tools
**Tools**
- [etcdctl](https://github.com/coreos/etcdctl) - A command line client for etcd
**Go libraries**
- [go-etcd](https://github.com/coreos/go-etcd)
**Ruby libraries**
- [iconara/etcd-rb](https://github.com/iconara/etcd-rb)
- [jpfuentes2/etcd-ruby](https://github.com/jpfuentes2/etcd-ruby)
- [ranjib/etcd-ruby](https://github.com/ranjib/etcd-ruby)
**Chef Cookbook**
- [spheromak/etcd-cookbook](https://github.com/spheromak/etcd-cookbook)
See [CONTRIBUTING](https://github.com/coreos/etcd/blob/master/CONTRIBUTING.md) for details on submitting patches and contacting developers via IRC and mailing lists.
## Project Details
### Versioning
etcd uses [semantic versioning][semver].
When we release v1.0.0 of etcd we will promise not to break the "v1" REST API.
New minor versions may add additional features to the API however.
#### Service Versioning
You can get the version of etcd by requesting the root path of etcd:
etcd uses [semantic versioning][semver].
New minor versions may add additional features to the API.
You can get the version of etcd by issuing a request to /version:
```sh
curl -L http://127.0.0.1:4001
curl -L http://127.0.0.1:4001/version
```
During the v0 series of releases we may break the API as we fix bugs and get feedback.
[semver]: http://semver.org/
#### API Versioning
Clients are encouraged to use the `v2` API. The `v1` API will not change.
The `v2` API responses should not change after the 0.2.0 release but new features will be added over time.
During the pre-v1.0.0 series of releases we may break the API as we fix bugs and get feedback.
### License
etcd is under the Apache 2.0 license. See the [LICENSE][license] file for details.

63
bench/bench.go Normal file
View File

@ -0,0 +1,63 @@
package main
import (
"flag"
"log"
"strconv"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
)
func write(endpoint string, requests int, end chan int) {
client := etcd.NewClient([]string{endpoint})
for i := 0; i < requests; i++ {
key := strconv.Itoa(i)
_, err := client.Set(key, key, 0)
if err != nil {
println(err.Error())
}
}
end <- 1
}
func watch(endpoint string, key string) {
client := etcd.NewClient([]string{endpoint})
receiver := make(chan *etcd.Response)
go client.Watch(key, 0, true, receiver, nil)
log.Printf("watching: %s", key)
received := 0
for {
<-receiver
received++
}
}
func main() {
endpoint := flag.String("endpoint", "http://127.0.0.1:4001", "etcd HTTP endpoint")
rWrites := flag.Int("write-requests", 50000, "number of writes")
cWrites := flag.Int("concurrent-writes", 500, "number of concurrent writes")
watches := flag.Int("watches", 500, "number of writes")
flag.Parse()
for i := 0; i < *watches; i++ {
key := strconv.Itoa(i)
go watch(*endpoint, key)
}
wChan := make(chan int, *cWrites)
for i := 0; i < *cWrites; i++ {
go write(*endpoint, (*rWrites / *cWrites), wChan)
}
for i := 0; i < *cWrites; i++ {
<-wChan
log.Printf("Completed %d writes", (*rWrites / *cWrites))
}
}

31
build
View File

@ -1,25 +1,12 @@
#!/bin/bash
#!/bin/sh -e
ETCD_PACKAGE=github.com/coreos/etcd
if [ ! -h src/github.com/coreos/etcd ]; then
mkdir -p src/github.com/coreos/
ln -s ../../.. src/github.com/coreos/etcd
fi
export GOBIN=${PWD}/bin
export GOPATH=${PWD}
SRC_DIR=$GOPATH/src
ETCD_DIR=$SRC_DIR/$ETCD_PACKAGE
ETCD_BASE=$(dirname ${ETCD_DIR})
if [ ! -d ${ETCD_BASE} ]; then
mkdir -p ${ETCD_BASE}
fi
if [ ! -h ${ETCD_DIR} ]; then
ln -s ../../../ ${ETCD_DIR}
fi
for i in third_party/*; do
if [ $i = "third_party/src" ]; then
continue
fi
cp -R $i src/
done
./scripts/release-version > release_version.go
go build ${ETCD_PACKAGE}
go install github.com/coreos/etcd
go install github.com/coreos/etcd/bench

View File

@ -1,154 +0,0 @@
package main
import (
"encoding/json"
"fmt"
"github.com/coreos/etcd/store"
"github.com/coreos/go-raft"
"path"
"time"
)
// A command represents an action to be taken on the replicated state machine.
type Command interface {
CommandName() string
Apply(server *raft.Server) (interface{}, error)
}
// Set command
type SetCommand struct {
Key string `json:"key"`
Value string `json:"value"`
ExpireTime time.Time `json:"expireTime"`
}
// The name of the set command in the log
func (c *SetCommand) CommandName() string {
return "etcd:set"
}
// Set the key-value pair
func (c *SetCommand) Apply(server *raft.Server) (interface{}, error) {
return etcdStore.Set(c.Key, c.Value, c.ExpireTime, server.CommitIndex())
}
// TestAndSet command
type TestAndSetCommand struct {
Key string `json:"key"`
Value string `json:"value"`
PrevValue string `json: prevValue`
ExpireTime time.Time `json:"expireTime"`
}
// The name of the testAndSet command in the log
func (c *TestAndSetCommand) CommandName() string {
return "testAndSet"
}
// Set the key-value pair if the current value of the key equals to the given prevValue
func (c *TestAndSetCommand) Apply(server *raft.Server) (interface{}, error) {
return etcdStore.TestAndSet(c.Key, c.PrevValue, c.Value, c.ExpireTime, server.CommitIndex())
}
// Get command
type GetCommand struct {
Key string `json:"key"`
}
// The name of the get command in the log
func (c *GetCommand) CommandName() string {
return "etcd:get"
}
// Get the value of key
func (c *GetCommand) Apply(server *raft.Server) (interface{}, error) {
return etcdStore.Get(c.Key)
}
// Delete command
type DeleteCommand struct {
Key string `json:"key"`
}
// The name of the delete command in the log
func (c *DeleteCommand) CommandName() string {
return "etcd:delete"
}
// Delete the key
func (c *DeleteCommand) Apply(server *raft.Server) (interface{}, error) {
return etcdStore.Delete(c.Key, server.CommitIndex())
}
// Watch command
type WatchCommand struct {
Key string `json:"key"`
SinceIndex uint64 `json:"sinceIndex"`
}
// The name of the watch command in the log
func (c *WatchCommand) CommandName() string {
return "etcd:watch"
}
func (c *WatchCommand) Apply(server *raft.Server) (interface{}, error) {
// create a new watcher
watcher := store.NewWatcher()
// add to the watchers list
etcdStore.AddWatcher(c.Key, watcher, c.SinceIndex)
// wait for the notification for any changing
res := <-watcher.C
if res == nil {
return nil, fmt.Errorf("Clearing watch")
}
return json.Marshal(res)
}
// JoinCommand
type JoinCommand struct {
Name string `json:"name"`
RaftURL string `json:"raftURL"`
EtcdURL string `json:"etcdURL"`
}
// The name of the join command in the log
func (c *JoinCommand) CommandName() string {
return "etcd:join"
}
// Join a server to the cluster
func (c *JoinCommand) Apply(raftServer *raft.Server) (interface{}, error) {
// check if the join command is from a previous machine, who lost all its previous log.
response, _ := etcdStore.RawGet(path.Join("_etcd/machines", c.Name))
if response != nil {
return []byte("join success"), nil
}
// check machine number in the cluster
num := machineNum()
if num == maxClusterSize {
return []byte("join fail"), fmt.Errorf(errors[103])
}
addNameToURL(c.Name, c.RaftURL, c.EtcdURL)
// add peer in raft
err := raftServer.AddPeer(c.Name)
// add machine in etcd storage
key := path.Join("_etcd/machines", c.Name)
value := fmt.Sprintf("raft=%s&etcd=%s", c.RaftURL, c.EtcdURL)
etcdStore.Set(key, value, time.Unix(0, 0), raftServer.CommitIndex())
return []byte("join success"), err
}
func (c *JoinCommand) NodeName() string {
return c.Name
}

507
config/config.go Normal file
View File

@ -0,0 +1,507 @@
package config
import (
"flag"
"fmt"
"io/ioutil"
"net"
"net/url"
"os"
"path/filepath"
"reflect"
"strconv"
"strings"
"github.com/coreos/etcd/third_party/github.com/BurntSushi/toml"
"github.com/coreos/etcd/discovery"
"github.com/coreos/etcd/log"
ustrings "github.com/coreos/etcd/pkg/strings"
"github.com/coreos/etcd/server"
)
// The default location for the etcd configuration file.
const DefaultSystemConfigPath = "/etc/etcd/etcd.conf"
// A lookup of deprecated flags to their new flag name.
var newFlagNameLookup = map[string]string{
"C": "peers",
"CF": "peers-file",
"n": "name",
"c": "addr",
"cl": "bind-addr",
"s": "peer-addr",
"sl": "peer-bind-addr",
"d": "data-dir",
"m": "max-result-buffer",
"r": "max-retry-attempts",
"maxsize": "max-cluster-size",
"clientCAFile": "ca-file",
"clientCert": "cert-file",
"clientKey": "key-file",
"serverCAFile": "peer-ca-file",
"serverCert": "peer-cert-file",
"serverKey": "peer-key-file",
"snapshotCount": "snapshot-count",
}
// Config represents the server configuration.
type Config struct {
SystemPath string
Addr string `toml:"addr" env:"ETCD_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_CERT_FILE"`
CPUProfileFile string
CorsOrigins []string `toml:"cors" env:"ETCD_CORS"`
DataDir string `toml:"data_dir" env:"ETCD_DATA_DIR"`
Discovery string `toml:"discovery" env:"ETCD_DISCOVERY"`
Force bool
KeyFile string `toml:"key_file" env:"ETCD_KEY_FILE"`
Peers []string `toml:"peers" env:"ETCD_PEERS"`
PeersFile string `toml:"peers_file" env:"ETCD_PEERS_FILE"`
MaxClusterSize int `toml:"max_cluster_size" env:"ETCD_MAX_CLUSTER_SIZE"`
MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"`
MaxRetryAttempts int `toml:"max_retry_attempts" env:"ETCD_MAX_RETRY_ATTEMPTS"`
RetryInterval float64 `toml:"retry_interval" env:"ETCD_RETRY_INTERVAL"`
Name string `toml:"name" env:"ETCD_NAME"`
Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"`
SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"`
ShowHelp bool
ShowVersion bool
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
VeryVeryVerbose bool `toml:"very_very_verbose" env:"ETCD_VERY_VERY_VERBOSE"`
Peer struct {
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
CAFile string `toml:"ca_file" env:"ETCD_PEER_CA_FILE"`
CertFile string `toml:"cert_file" env:"ETCD_PEER_CERT_FILE"`
KeyFile string `toml:"key_file" env:"ETCD_PEER_KEY_FILE"`
HeartbeatTimeout int `toml:"heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
ElectionTimeout int `toml:"election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
}
strTrace string `toml:"trace" env:"ETCD_TRACE"`
GraphiteHost string `toml:"graphite_host" env:"ETCD_GRAPHITE_HOST"`
}
// New returns a Config initialized with default values.
func New() *Config {
c := new(Config)
c.SystemPath = DefaultSystemConfigPath
c.Addr = "127.0.0.1:4001"
c.MaxClusterSize = 9
c.MaxResultBuffer = 1024
c.MaxRetryAttempts = 3
c.RetryInterval = 10.0
c.Snapshot = true
c.SnapshotCount = 10000
c.Peer.Addr = "127.0.0.1:7001"
c.Peer.HeartbeatTimeout = defaultHeartbeatTimeout
c.Peer.ElectionTimeout = defaultElectionTimeout
return c
}
// Loads the configuration from the system config, command line config,
// environment variables, and finally command line arguments.
func (c *Config) Load(arguments []string) error {
var path string
f := flag.NewFlagSet("etcd", -1)
f.SetOutput(ioutil.Discard)
f.StringVar(&path, "config", "", "path to config file")
f.Parse(arguments)
// Load from system file.
if err := c.LoadSystemFile(); err != nil {
return err
}
// Load from config file specified in arguments.
if path != "" {
if err := c.LoadFile(path); err != nil {
return err
}
}
// Load from the environment variables next.
if err := c.LoadEnv(); err != nil {
return err
}
// Load from command line flags.
if err := c.LoadFlags(arguments); err != nil {
return err
}
// Loads peers if a peer file was specified.
if err := c.LoadPeersFile(); err != nil {
return err
}
// Sanitize all the input fields.
if err := c.Sanitize(); err != nil {
return fmt.Errorf("sanitize: %v", err)
}
// Attempt cluster discovery
if c.Discovery != "" {
if err := c.handleDiscovery(); err != nil {
return err
}
}
// Force remove server configuration if specified.
if c.Force {
c.Reset()
}
return nil
}
// Loads from the system etcd configuration file if it exists.
func (c *Config) LoadSystemFile() error {
if _, err := os.Stat(c.SystemPath); os.IsNotExist(err) {
return nil
}
return c.LoadFile(c.SystemPath)
}
// Loads configuration from a file.
func (c *Config) LoadFile(path string) error {
_, err := toml.DecodeFile(path, &c)
return err
}
// LoadEnv loads the configuration via environment variables.
func (c *Config) LoadEnv() error {
if err := c.loadEnv(c); err != nil {
return err
}
if err := c.loadEnv(&c.Peer); err != nil {
return err
}
return nil
}
func (c *Config) loadEnv(target interface{}) error {
value := reflect.Indirect(reflect.ValueOf(target))
typ := value.Type()
for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
// Retrieve environment variable.
v := strings.TrimSpace(os.Getenv(field.Tag.Get("env")))
if v == "" {
continue
}
// Set the appropriate type.
switch field.Type.Kind() {
case reflect.Bool:
value.Field(i).SetBool(v != "0" && v != "false")
case reflect.Int:
newValue, err := strconv.ParseInt(v, 10, 0)
if err != nil {
return fmt.Errorf("Parse error: %s: %s", field.Tag.Get("env"), err)
}
value.Field(i).SetInt(newValue)
case reflect.String:
value.Field(i).SetString(v)
case reflect.Slice:
value.Field(i).Set(reflect.ValueOf(ustrings.TrimSplit(v, ",")))
}
}
return nil
}
func (c *Config) handleDiscovery() error {
p, err := discovery.Do(c.Discovery, c.Name, c.Peer.Addr)
// This is fatal, discovery encountered an unexpected error
// and we have no peer list.
if err != nil && len(c.Peers) == 0 {
log.Fatalf("Discovery failed and a backup peer list wasn't provided: %v", err)
return err
}
// Warn about errors coming from discovery, this isn't fatal
// since the user might have provided a peer list elsewhere.
if err != nil {
log.Warnf("Discovery encountered an error but a backup peer list (%v) was provided: %v", c.Peers, err)
}
for i := range p {
// Strip the scheme off of the peer if it has one
// TODO(bp): clean this up!
purl, err := url.Parse(p[i])
if err == nil {
p[i] = purl.Host
}
}
c.Peers = p
return nil
}
// Loads configuration from command line flags.
func (c *Config) LoadFlags(arguments []string) error {
var peers, cors, path string
f := flag.NewFlagSet(os.Args[0], flag.ContinueOnError)
f.SetOutput(ioutil.Discard)
f.BoolVar(&c.ShowHelp, "h", false, "")
f.BoolVar(&c.ShowHelp, "help", false, "")
f.BoolVar(&c.ShowVersion, "version", false, "")
f.BoolVar(&c.Force, "f", false, "")
f.BoolVar(&c.Force, "force", false, "")
f.BoolVar(&c.Verbose, "v", c.Verbose, "")
f.BoolVar(&c.VeryVerbose, "vv", c.VeryVerbose, "")
f.BoolVar(&c.VeryVeryVerbose, "vvv", c.VeryVeryVerbose, "")
f.StringVar(&peers, "peers", "", "")
f.StringVar(&c.PeersFile, "peers-file", c.PeersFile, "")
f.StringVar(&c.Name, "name", c.Name, "")
f.StringVar(&c.Addr, "addr", c.Addr, "")
f.StringVar(&c.Discovery, "discovery", c.Discovery, "")
f.StringVar(&c.BindAddr, "bind-addr", c.BindAddr, "")
f.StringVar(&c.Peer.Addr, "peer-addr", c.Peer.Addr, "")
f.StringVar(&c.Peer.BindAddr, "peer-bind-addr", c.Peer.BindAddr, "")
f.StringVar(&c.CAFile, "ca-file", c.CAFile, "")
f.StringVar(&c.CertFile, "cert-file", c.CertFile, "")
f.StringVar(&c.KeyFile, "key-file", c.KeyFile, "")
f.StringVar(&c.Peer.CAFile, "peer-ca-file", c.Peer.CAFile, "")
f.StringVar(&c.Peer.CertFile, "peer-cert-file", c.Peer.CertFile, "")
f.StringVar(&c.Peer.KeyFile, "peer-key-file", c.Peer.KeyFile, "")
f.StringVar(&c.DataDir, "data-dir", c.DataDir, "")
f.IntVar(&c.MaxResultBuffer, "max-result-buffer", c.MaxResultBuffer, "")
f.IntVar(&c.MaxRetryAttempts, "max-retry-attempts", c.MaxRetryAttempts, "")
f.Float64Var(&c.RetryInterval, "retry-interval", c.RetryInterval, "")
f.IntVar(&c.MaxClusterSize, "max-cluster-size", c.MaxClusterSize, "")
f.IntVar(&c.Peer.HeartbeatTimeout, "peer-heartbeat-timeout", c.Peer.HeartbeatTimeout, "")
f.IntVar(&c.Peer.ElectionTimeout, "peer-election-timeout", c.Peer.ElectionTimeout, "")
f.StringVar(&cors, "cors", "", "")
f.BoolVar(&c.Snapshot, "snapshot", c.Snapshot, "")
f.IntVar(&c.SnapshotCount, "snapshot-count", c.SnapshotCount, "")
f.StringVar(&c.CPUProfileFile, "cpuprofile", "", "")
f.StringVar(&c.strTrace, "trace", "", "")
f.StringVar(&c.GraphiteHost, "graphite-host", "", "")
// BEGIN IGNORED FLAGS
f.StringVar(&path, "config", "", "")
// BEGIN IGNORED FLAGS
// BEGIN DEPRECATED FLAGS
f.StringVar(&peers, "C", "", "(deprecated)")
f.StringVar(&c.PeersFile, "CF", c.PeersFile, "(deprecated)")
f.StringVar(&c.Name, "n", c.Name, "(deprecated)")
f.StringVar(&c.Addr, "c", c.Addr, "(deprecated)")
f.StringVar(&c.BindAddr, "cl", c.BindAddr, "(deprecated)")
f.StringVar(&c.Peer.Addr, "s", c.Peer.Addr, "(deprecated)")
f.StringVar(&c.Peer.BindAddr, "sl", c.Peer.BindAddr, "(deprecated)")
f.StringVar(&c.Peer.CAFile, "serverCAFile", c.Peer.CAFile, "(deprecated)")
f.StringVar(&c.Peer.CertFile, "serverCert", c.Peer.CertFile, "(deprecated)")
f.StringVar(&c.Peer.KeyFile, "serverKey", c.Peer.KeyFile, "(deprecated)")
f.StringVar(&c.CAFile, "clientCAFile", c.CAFile, "(deprecated)")
f.StringVar(&c.CertFile, "clientCert", c.CertFile, "(deprecated)")
f.StringVar(&c.KeyFile, "clientKey", c.KeyFile, "(deprecated)")
f.StringVar(&c.DataDir, "d", c.DataDir, "(deprecated)")
f.IntVar(&c.MaxResultBuffer, "m", c.MaxResultBuffer, "(deprecated)")
f.IntVar(&c.MaxRetryAttempts, "r", c.MaxRetryAttempts, "(deprecated)")
f.IntVar(&c.MaxClusterSize, "maxsize", c.MaxClusterSize, "(deprecated)")
f.IntVar(&c.SnapshotCount, "snapshotCount", c.SnapshotCount, "(deprecated)")
// END DEPRECATED FLAGS
if err := f.Parse(arguments); err != nil {
return err
}
// Print deprecation warnings on STDERR.
f.Visit(func(f *flag.Flag) {
if len(newFlagNameLookup[f.Name]) > 0 {
fmt.Fprintf(os.Stderr, "[deprecated] use -%s, not -%s\n", newFlagNameLookup[f.Name], f.Name)
}
})
// Convert some parameters to lists.
if peers != "" {
c.Peers = ustrings.TrimSplit(peers, ",")
}
if cors != "" {
c.CorsOrigins = ustrings.TrimSplit(cors, ",")
}
return nil
}
// LoadPeersFile loads the peers listed in the peers file.
func (c *Config) LoadPeersFile() error {
if c.PeersFile == "" {
return nil
}
b, err := ioutil.ReadFile(c.PeersFile)
if err != nil {
return fmt.Errorf("Peers file error: %s", err)
}
c.Peers = ustrings.TrimSplit(string(b), ",")
return nil
}
// DataDirFromName sets the data dir from a machine name and issue a warning
// that etcd is guessing.
func (c *Config) DataDirFromName() {
c.DataDir = c.Name + ".etcd"
log.Warnf("Using the directory %s as the etcd curation directory because a directory was not specified. ", c.DataDir)
return
}
// NameFromHostname sets the machine name from the hostname. This is to help
// people get started without thinking up a name.
func (c *Config) NameFromHostname() {
host, err := os.Hostname()
if err != nil && host == "" {
log.Fatal("Node name required and hostname not set. e.g. '-name=name'")
}
c.Name = host
}
// Reset removes all server configuration files.
func (c *Config) Reset() error {
if err := os.RemoveAll(filepath.Join(c.DataDir, "log")); err != nil {
return err
}
if err := os.RemoveAll(filepath.Join(c.DataDir, "conf")); err != nil {
return err
}
if err := os.RemoveAll(filepath.Join(c.DataDir, "snapshot")); err != nil {
return err
}
return nil
}
// Sanitize cleans the input fields.
func (c *Config) Sanitize() error {
var err error
// Sanitize the URLs first.
if c.Addr, err = sanitizeURL(c.Addr, c.EtcdTLSInfo().Scheme()); err != nil {
return fmt.Errorf("Advertised URL: %s", err)
}
if c.BindAddr, err = sanitizeBindAddr(c.BindAddr, c.Addr); err != nil {
return fmt.Errorf("Listen Host: %s", err)
}
if c.Peer.Addr, err = sanitizeURL(c.Peer.Addr, c.PeerTLSInfo().Scheme()); err != nil {
return fmt.Errorf("Peer Advertised URL: %s", err)
}
if c.Peer.BindAddr, err = sanitizeBindAddr(c.Peer.BindAddr, c.Peer.Addr); err != nil {
return fmt.Errorf("Peer Listen Host: %s", err)
}
// Only guess the machine name if there is no data dir specified
// because the info file should have our name
if c.Name == "" && c.DataDir == "" {
c.NameFromHostname()
}
if c.DataDir == "" && c.Name != "" && !c.ShowVersion && !c.ShowHelp {
c.DataDirFromName()
}
return nil
}
// EtcdTLSInfo retrieves a TLSInfo object for the etcd server
func (c *Config) EtcdTLSInfo() server.TLSInfo {
return server.TLSInfo{
CAFile: c.CAFile,
CertFile: c.CertFile,
KeyFile: c.KeyFile,
}
}
// PeerRaftInfo retrieves a TLSInfo object for the peer server.
func (c *Config) PeerTLSInfo() server.TLSInfo {
return server.TLSInfo{
CAFile: c.Peer.CAFile,
CertFile: c.Peer.CertFile,
KeyFile: c.Peer.KeyFile,
}
}
// MetricsBucketName generates the name that should be used for a
// corresponding MetricsBucket object
func (c *Config) MetricsBucketName() string {
return fmt.Sprintf("etcd.%s", c.Name)
}
// Trace determines if any trace-level information should be emitted
func (c *Config) Trace() bool {
return c.strTrace == "*"
}
// sanitizeURL will cleanup a host string in the format hostname[:port] and
// attach a schema.
func sanitizeURL(host string, defaultScheme string) (string, error) {
// Blank URLs are fine input, just return it
if len(host) == 0 {
return host, nil
}
p, err := url.Parse(host)
if err != nil {
return "", err
}
// Make sure the host is in Host:Port format
_, _, err = net.SplitHostPort(host)
if err != nil {
return "", err
}
p = &url.URL{Host: host, Scheme: defaultScheme}
return p.String(), nil
}
// sanitizeBindAddr cleans up the BindAddr parameter and appends a port
// if necessary based on the advertised port.
func sanitizeBindAddr(bindAddr string, addr string) (string, error) {
aurl, err := url.Parse(addr)
if err != nil {
return "", err
}
// If it is a valid host:port simply return with no further checks.
bhost, bport, err := net.SplitHostPort(bindAddr)
if err == nil && bhost != "" {
return bindAddr, nil
}
// SplitHostPort makes the host optional, but we don't want that.
if bhost == "" && bport != "" {
return "", fmt.Errorf("IP required can't use a port only")
}
// bindAddr doesn't have a port if we reach here so take the port from the
// advertised URL.
_, aport, err := net.SplitHostPort(aurl.Host)
if err != nil {
return "", err
}
return net.JoinHostPort(bindAddr, aport), nil
}

736
config/config_test.go Normal file
View File

@ -0,0 +1,736 @@
package config
import (
"io/ioutil"
"os"
"testing"
"github.com/coreos/etcd/third_party/github.com/BurntSushi/toml"
"github.com/coreos/etcd/third_party/github.com/stretchr/testify/assert"
)
// Ensures that a configuration can be deserialized from TOML.
func TestConfigTOML(t *testing.T) {
content := `
addr = "127.0.0.1:4002"
ca_file = "/tmp/file.ca"
cert_file = "/tmp/file.cert"
cors = ["*"]
cpu_profile_file = "XXX"
data_dir = "/tmp/data"
discovery = "http://example.com/foobar"
key_file = "/tmp/file.key"
bind_addr = "127.0.0.1:4003"
peers = ["coreos.com:4001", "coreos.com:4002"]
peers_file = "/tmp/peers"
max_cluster_size = 10
max_result_buffer = 512
max_retry_attempts = 5
name = "test-name"
snapshot = true
verbose = true
very_verbose = true
[peer]
addr = "127.0.0.1:7002"
ca_file = "/tmp/peer/file.ca"
cert_file = "/tmp/peer/file.cert"
key_file = "/tmp/peer/file.key"
bind_addr = "127.0.0.1:7003"
`
c := New()
_, err := toml.Decode(content, &c)
assert.Nil(t, err, "")
assert.Equal(t, c.Addr, "127.0.0.1:4002", "")
assert.Equal(t, c.CAFile, "/tmp/file.ca", "")
assert.Equal(t, c.CertFile, "/tmp/file.cert", "")
assert.Equal(t, c.CorsOrigins, []string{"*"}, "")
assert.Equal(t, c.DataDir, "/tmp/data", "")
assert.Equal(t, c.Discovery, "http://example.com/foobar", "")
assert.Equal(t, c.KeyFile, "/tmp/file.key", "")
assert.Equal(t, c.BindAddr, "127.0.0.1:4003", "")
assert.Equal(t, c.Peers, []string{"coreos.com:4001", "coreos.com:4002"}, "")
assert.Equal(t, c.PeersFile, "/tmp/peers", "")
assert.Equal(t, c.MaxClusterSize, 10, "")
assert.Equal(t, c.MaxResultBuffer, 512, "")
assert.Equal(t, c.MaxRetryAttempts, 5, "")
assert.Equal(t, c.Name, "test-name", "")
assert.Equal(t, c.Snapshot, true, "")
assert.Equal(t, c.Verbose, true, "")
assert.Equal(t, c.VeryVerbose, true, "")
assert.Equal(t, c.Peer.Addr, "127.0.0.1:7002", "")
assert.Equal(t, c.Peer.CAFile, "/tmp/peer/file.ca", "")
assert.Equal(t, c.Peer.CertFile, "/tmp/peer/file.cert", "")
assert.Equal(t, c.Peer.KeyFile, "/tmp/peer/file.key", "")
assert.Equal(t, c.Peer.BindAddr, "127.0.0.1:7003", "")
}
// Ensures that a configuration can be retrieved from environment variables.
func TestConfigEnv(t *testing.T) {
os.Setenv("ETCD_CA_FILE", "/tmp/file.ca")
os.Setenv("ETCD_CERT_FILE", "/tmp/file.cert")
os.Setenv("ETCD_CPU_PROFILE_FILE", "XXX")
os.Setenv("ETCD_CORS", "localhost:4001,localhost:4002")
os.Setenv("ETCD_DATA_DIR", "/tmp/data")
os.Setenv("ETCD_DISCOVERY", "http://example.com/foobar")
os.Setenv("ETCD_KEY_FILE", "/tmp/file.key")
os.Setenv("ETCD_BIND_ADDR", "127.0.0.1:4003")
os.Setenv("ETCD_PEERS", "coreos.com:4001,coreos.com:4002")
os.Setenv("ETCD_PEERS_FILE", "/tmp/peers")
os.Setenv("ETCD_MAX_CLUSTER_SIZE", "10")
os.Setenv("ETCD_MAX_RESULT_BUFFER", "512")
os.Setenv("ETCD_MAX_RETRY_ATTEMPTS", "5")
os.Setenv("ETCD_NAME", "test-name")
os.Setenv("ETCD_SNAPSHOT", "true")
os.Setenv("ETCD_VERBOSE", "1")
os.Setenv("ETCD_VERY_VERBOSE", "yes")
os.Setenv("ETCD_PEER_ADDR", "127.0.0.1:7002")
os.Setenv("ETCD_PEER_CA_FILE", "/tmp/peer/file.ca")
os.Setenv("ETCD_PEER_CERT_FILE", "/tmp/peer/file.cert")
os.Setenv("ETCD_PEER_KEY_FILE", "/tmp/peer/file.key")
os.Setenv("ETCD_PEER_BIND_ADDR", "127.0.0.1:7003")
c := New()
c.LoadEnv()
assert.Equal(t, c.CAFile, "/tmp/file.ca", "")
assert.Equal(t, c.CertFile, "/tmp/file.cert", "")
assert.Equal(t, c.CorsOrigins, []string{"localhost:4001", "localhost:4002"}, "")
assert.Equal(t, c.DataDir, "/tmp/data", "")
assert.Equal(t, c.Discovery, "http://example.com/foobar", "")
assert.Equal(t, c.KeyFile, "/tmp/file.key", "")
assert.Equal(t, c.BindAddr, "127.0.0.1:4003", "")
assert.Equal(t, c.Peers, []string{"coreos.com:4001", "coreos.com:4002"}, "")
assert.Equal(t, c.PeersFile, "/tmp/peers", "")
assert.Equal(t, c.MaxClusterSize, 10, "")
assert.Equal(t, c.MaxResultBuffer, 512, "")
assert.Equal(t, c.MaxRetryAttempts, 5, "")
assert.Equal(t, c.Name, "test-name", "")
assert.Equal(t, c.Snapshot, true, "")
assert.Equal(t, c.Verbose, true, "")
assert.Equal(t, c.VeryVerbose, true, "")
assert.Equal(t, c.Peer.Addr, "127.0.0.1:7002", "")
assert.Equal(t, c.Peer.CAFile, "/tmp/peer/file.ca", "")
assert.Equal(t, c.Peer.CertFile, "/tmp/peer/file.cert", "")
assert.Equal(t, c.Peer.KeyFile, "/tmp/peer/file.key", "")
assert.Equal(t, c.Peer.BindAddr, "127.0.0.1:7003", "")
// Clear this as it will mess up other tests
os.Setenv("ETCD_DISCOVERY", "")
}
// Ensures that the "help" flag can be parsed.
func TestConfigHelpFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-help"}), "")
assert.True(t, c.ShowHelp)
}
// Ensures that the abbreviated "help" flag can be parsed.
func TestConfigAbbreviatedHelpFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-h"}), "")
assert.True(t, c.ShowHelp)
}
// Ensures that the "version" flag can be parsed.
func TestConfigVersionFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-version"}), "")
assert.True(t, c.ShowVersion)
}
// Ensures that the "force config" flag can be parsed.
func TestConfigForceFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-force"}), "")
assert.True(t, c.Force)
}
// Ensures that the abbreviated "force config" flag can be parsed.
func TestConfigAbbreviatedForceFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-f"}), "")
assert.True(t, c.Force)
}
// Ensures that a the advertised url can be parsed from the environment.
func TestConfigAddrEnv(t *testing.T) {
withEnv("ETCD_ADDR", "127.0.0.1:4002", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Addr, "127.0.0.1:4002", "")
})
}
// Ensures that a the advertised flag can be parsed.
func TestConfigAddrFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-addr", "127.0.0.1:4002"}), "")
assert.Equal(t, c.Addr, "127.0.0.1:4002", "")
}
// Ensures that a the CA file can be parsed from the environment.
func TestConfigCAFileEnv(t *testing.T) {
withEnv("ETCD_CA_FILE", "/tmp/file.ca", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.CAFile, "/tmp/file.ca", "")
})
}
// Ensures that a the CA file flag can be parsed.
func TestConfigCAFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-ca-file", "/tmp/file.ca"}), "")
assert.Equal(t, c.CAFile, "/tmp/file.ca", "")
}
// Ensures that a the CA file can be parsed from the environment.
func TestConfigCertFileEnv(t *testing.T) {
withEnv("ETCD_CERT_FILE", "/tmp/file.cert", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.CertFile, "/tmp/file.cert", "")
})
}
// Ensures that a the Cert file flag can be parsed.
func TestConfigCertFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-cert-file", "/tmp/file.cert"}), "")
assert.Equal(t, c.CertFile, "/tmp/file.cert", "")
}
// Ensures that a the Key file can be parsed from the environment.
func TestConfigKeyFileEnv(t *testing.T) {
withEnv("ETCD_KEY_FILE", "/tmp/file.key", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.KeyFile, "/tmp/file.key", "")
})
}
// Ensures that a the Key file flag can be parsed.
func TestConfigKeyFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-key-file", "/tmp/file.key"}), "")
assert.Equal(t, c.KeyFile, "/tmp/file.key", "")
}
// Ensures that a the Listen Host can be parsed from the environment.
func TestConfigBindAddrEnv(t *testing.T) {
withEnv("ETCD_BIND_ADDR", "127.0.0.1:4003", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.BindAddr, "127.0.0.1:4003", "")
})
}
// Ensures that a the Listen Host file flag can be parsed.
func TestConfigBindAddrFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-bind-addr", "127.0.0.1:4003"}), "")
assert.Equal(t, c.BindAddr, "127.0.0.1:4003", "")
}
// Ensures that a the Listen Host port overrides the advertised port
func TestConfigBindAddrOverride(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-addr", "127.0.0.1:4009", "-bind-addr", "127.0.0.1:4010"}), "")
assert.Nil(t, c.Sanitize())
assert.Equal(t, c.BindAddr, "127.0.0.1:4010", "")
}
// Ensures that a the Listen Host inherits its port from the advertised addr
func TestConfigBindAddrInheritPort(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-addr", "127.0.0.1:4009", "-bind-addr", "127.0.0.1"}), "")
assert.Nil(t, c.Sanitize())
assert.Equal(t, c.BindAddr, "127.0.0.1:4009", "")
}
// Ensures that a port only argument errors out
func TestConfigBindAddrErrorOnNoHost(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-addr", "127.0.0.1:4009", "-bind-addr", ":4010"}), "")
assert.Error(t, c.Sanitize())
}
// Ensures that the peers can be parsed from the environment.
func TestConfigPeersEnv(t *testing.T) {
withEnv("ETCD_PEERS", "coreos.com:4001,coreos.com:4002", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peers, []string{"coreos.com:4001", "coreos.com:4002"}, "")
})
}
// Ensures that a the Peers flag can be parsed.
func TestConfigPeersFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peers", "coreos.com:4001,coreos.com:4002"}), "")
assert.Equal(t, c.Peers, []string{"coreos.com:4001", "coreos.com:4002"}, "")
}
// Ensures that the Peers File can be parsed from the environment.
func TestConfigPeersFileEnv(t *testing.T) {
withEnv("ETCD_PEERS_FILE", "/tmp/peers", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.PeersFile, "/tmp/peers", "")
})
}
// Ensures that a the Peers File flag can be parsed.
func TestConfigPeersFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peers-file", "/tmp/peers"}), "")
assert.Equal(t, c.PeersFile, "/tmp/peers", "")
}
// Ensures that the Max Cluster Size can be parsed from the environment.
func TestConfigMaxClusterSizeEnv(t *testing.T) {
withEnv("ETCD_MAX_CLUSTER_SIZE", "5", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.MaxClusterSize, 5, "")
})
}
// Ensures that a the Max Cluster Size flag can be parsed.
func TestConfigMaxClusterSizeFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-max-cluster-size", "5"}), "")
assert.Equal(t, c.MaxClusterSize, 5, "")
}
// Ensures that the Max Result Buffer can be parsed from the environment.
func TestConfigMaxResultBufferEnv(t *testing.T) {
withEnv("ETCD_MAX_RESULT_BUFFER", "512", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.MaxResultBuffer, 512, "")
})
}
// Ensures that a the Max Result Buffer flag can be parsed.
func TestConfigMaxResultBufferFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-max-result-buffer", "512"}), "")
assert.Equal(t, c.MaxResultBuffer, 512, "")
}
// Ensures that the Max Retry Attempts can be parsed from the environment.
func TestConfigMaxRetryAttemptsEnv(t *testing.T) {
withEnv("ETCD_MAX_RETRY_ATTEMPTS", "10", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.MaxRetryAttempts, 10, "")
})
}
// Ensures that a the Max Retry Attempts flag can be parsed.
func TestConfigMaxRetryAttemptsFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-max-retry-attempts", "10"}), "")
assert.Equal(t, c.MaxRetryAttempts, 10, "")
}
// Ensures that the Name can be parsed from the environment.
func TestConfigNameEnv(t *testing.T) {
withEnv("ETCD_NAME", "test-name", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Name, "test-name", "")
})
}
// Ensures that a the Name flag can be parsed.
func TestConfigNameFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-name", "test-name"}), "")
assert.Equal(t, c.Name, "test-name", "")
}
// Ensures that a Name gets guessed if not specified
func TestConfigNameGuess(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{}), "")
assert.Nil(t, c.Sanitize())
name, _ := os.Hostname()
assert.Equal(t, c.Name, name, "")
}
// Ensures that a DataDir gets guessed if not specified
func TestConfigDataDirGuess(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{}), "")
assert.Nil(t, c.Sanitize())
name, _ := os.Hostname()
assert.Equal(t, c.DataDir, name+".etcd", "")
}
// Ensures that Snapshot can be parsed from the environment.
func TestConfigSnapshotEnv(t *testing.T) {
withEnv("ETCD_SNAPSHOT", "1", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Snapshot, true, "")
})
}
// Ensures that a the Snapshot flag can be parsed.
func TestConfigSnapshotFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-snapshot"}), "")
assert.Equal(t, c.Snapshot, true, "")
}
// Ensures that Verbose can be parsed from the environment.
func TestConfigVerboseEnv(t *testing.T) {
withEnv("ETCD_VERBOSE", "true", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Verbose, true, "")
})
}
// Ensures that a the Verbose flag can be parsed.
func TestConfigVerboseFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-v"}), "")
assert.Equal(t, c.Verbose, true, "")
}
// Ensures that Very Verbose can be parsed from the environment.
func TestConfigVeryVerboseEnv(t *testing.T) {
withEnv("ETCD_VERY_VERBOSE", "true", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.VeryVerbose, true, "")
})
}
// Ensures that a the Very Verbose flag can be parsed.
func TestConfigVeryVerboseFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-vv"}), "")
assert.Equal(t, c.VeryVerbose, true, "")
}
// Ensures that the Peer Advertised URL can be parsed from the environment.
func TestConfigPeerAddrEnv(t *testing.T) {
withEnv("ETCD_PEER_ADDR", "localhost:7002", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peer.Addr, "localhost:7002", "")
})
}
// Ensures that a the Peer Advertised URL flag can be parsed.
func TestConfigPeerAddrFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peer-addr", "localhost:7002"}), "")
assert.Equal(t, c.Peer.Addr, "localhost:7002", "")
}
// Ensures that the Peer CA File can be parsed from the environment.
func TestConfigPeerCAFileEnv(t *testing.T) {
withEnv("ETCD_PEER_CA_FILE", "/tmp/peer/file.ca", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peer.CAFile, "/tmp/peer/file.ca", "")
})
}
// Ensures that a the Peer CA file flag can be parsed.
func TestConfigPeerCAFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peer-ca-file", "/tmp/peer/file.ca"}), "")
assert.Equal(t, c.Peer.CAFile, "/tmp/peer/file.ca", "")
}
// Ensures that the Peer Cert File can be parsed from the environment.
func TestConfigPeerCertFileEnv(t *testing.T) {
withEnv("ETCD_PEER_CERT_FILE", "/tmp/peer/file.cert", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peer.CertFile, "/tmp/peer/file.cert", "")
})
}
// Ensures that a the Cert file flag can be parsed.
func TestConfigPeerCertFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peer-cert-file", "/tmp/peer/file.cert"}), "")
assert.Equal(t, c.Peer.CertFile, "/tmp/peer/file.cert", "")
}
// Ensures that the Peer Key File can be parsed from the environment.
func TestConfigPeerKeyFileEnv(t *testing.T) {
withEnv("ETCD_PEER_KEY_FILE", "/tmp/peer/file.key", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peer.KeyFile, "/tmp/peer/file.key", "")
})
}
// Ensures that a the Peer Key file flag can be parsed.
func TestConfigPeerKeyFileFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peer-key-file", "/tmp/peer/file.key"}), "")
assert.Equal(t, c.Peer.KeyFile, "/tmp/peer/file.key", "")
}
// Ensures that the Peer Listen Host can be parsed from the environment.
func TestConfigPeerBindAddrEnv(t *testing.T) {
withEnv("ETCD_PEER_BIND_ADDR", "localhost:7004", func(c *Config) {
assert.Nil(t, c.LoadEnv(), "")
assert.Equal(t, c.Peer.BindAddr, "localhost:7004", "")
})
}
// Ensures that a bad flag returns an error.
func TestConfigBadFlag(t *testing.T) {
c := New()
err := c.LoadFlags([]string{"-no-such-flag"})
assert.Error(t, err)
assert.Equal(t, err.Error(), `flag provided but not defined: -no-such-flag`)
}
// Ensures that a the Peer Listen Host file flag can be parsed.
func TestConfigPeerBindAddrFlag(t *testing.T) {
c := New()
assert.Nil(t, c.LoadFlags([]string{"-peer-bind-addr", "127.0.0.1:4003"}), "")
assert.Equal(t, c.Peer.BindAddr, "127.0.0.1:4003", "")
}
// Ensures that a system config field is overridden by a custom config field.
func TestConfigCustomConfigOverrideSystemConfig(t *testing.T) {
system := `addr = "127.0.0.1:5000"`
custom := `addr = "127.0.0.1:6000"`
withTempFile(system, func(p1 string) {
withTempFile(custom, func(p2 string) {
c := New()
c.SystemPath = p1
assert.Nil(t, c.Load([]string{"-config", p2}), "")
assert.Equal(t, c.Addr, "http://127.0.0.1:6000", "")
})
})
}
// Ensures that a custom config field is overridden by an environment variable.
func TestConfigEnvVarOverrideCustomConfig(t *testing.T) {
os.Setenv("ETCD_PEER_ADDR", "127.0.0.1:8000")
defer os.Setenv("ETCD_PEER_ADDR", "")
custom := `[peer]` + "\n" + `advertised_url = "127.0.0.1:9000"`
withTempFile(custom, func(path string) {
c := New()
c.SystemPath = ""
assert.Nil(t, c.Load([]string{"-config", path}), "")
assert.Equal(t, c.Peer.Addr, "http://127.0.0.1:8000", "")
})
}
// Ensures that an environment variable field is overridden by a command line argument.
func TestConfigCLIArgsOverrideEnvVar(t *testing.T) {
os.Setenv("ETCD_ADDR", "127.0.0.1:1000")
defer os.Setenv("ETCD_ADDR", "")
c := New()
c.SystemPath = ""
assert.Nil(t, c.Load([]string{"-addr", "127.0.0.1:2000"}), "")
assert.Equal(t, c.Addr, "http://127.0.0.1:2000", "")
}
//--------------------------------------
// DEPRECATED (v1)
//--------------------------------------
func TestConfigDeprecatedAddrFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-c", "127.0.0.1:4002"})
assert.NoError(t, err)
assert.Equal(t, c.Addr, "127.0.0.1:4002")
})
assert.Equal(t, stderr, "[deprecated] use -addr, not -c\n")
}
func TestConfigDeprecatedBindAddrFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-cl", "127.0.0.1:4003"})
assert.NoError(t, err)
assert.Equal(t, c.BindAddr, "127.0.0.1:4003", "")
})
assert.Equal(t, stderr, "[deprecated] use -bind-addr, not -cl\n", "")
}
func TestConfigDeprecatedCAFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-clientCAFile", "/tmp/file.ca"})
assert.NoError(t, err)
assert.Equal(t, c.CAFile, "/tmp/file.ca", "")
})
assert.Equal(t, stderr, "[deprecated] use -ca-file, not -clientCAFile\n", "")
}
func TestConfigDeprecatedCertFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-clientCert", "/tmp/file.cert"})
assert.NoError(t, err)
assert.Equal(t, c.CertFile, "/tmp/file.cert", "")
})
assert.Equal(t, stderr, "[deprecated] use -cert-file, not -clientCert\n", "")
}
func TestConfigDeprecatedKeyFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-clientKey", "/tmp/file.key"})
assert.NoError(t, err)
assert.Equal(t, c.KeyFile, "/tmp/file.key", "")
})
assert.Equal(t, stderr, "[deprecated] use -key-file, not -clientKey\n", "")
}
func TestConfigDeprecatedPeersFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-C", "coreos.com:4001,coreos.com:4002"})
assert.NoError(t, err)
assert.Equal(t, c.Peers, []string{"coreos.com:4001", "coreos.com:4002"}, "")
})
assert.Equal(t, stderr, "[deprecated] use -peers, not -C\n", "")
}
func TestConfigDeprecatedPeersFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-CF", "/tmp/machines"})
assert.NoError(t, err)
assert.Equal(t, c.PeersFile, "/tmp/machines", "")
})
assert.Equal(t, stderr, "[deprecated] use -peers-file, not -CF\n", "")
}
func TestConfigDeprecatedMaxClusterSizeFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-maxsize", "5"})
assert.NoError(t, err)
assert.Equal(t, c.MaxClusterSize, 5, "")
})
assert.Equal(t, stderr, "[deprecated] use -max-cluster-size, not -maxsize\n", "")
}
func TestConfigDeprecatedMaxResultBufferFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-m", "512"})
assert.NoError(t, err)
assert.Equal(t, c.MaxResultBuffer, 512, "")
})
assert.Equal(t, stderr, "[deprecated] use -max-result-buffer, not -m\n", "")
}
func TestConfigDeprecatedMaxRetryAttemptsFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-r", "10"})
assert.NoError(t, err)
assert.Equal(t, c.MaxRetryAttempts, 10, "")
})
assert.Equal(t, stderr, "[deprecated] use -max-retry-attempts, not -r\n", "")
}
func TestConfigDeprecatedNameFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-n", "test-name"})
assert.NoError(t, err)
assert.Equal(t, c.Name, "test-name", "")
})
assert.Equal(t, stderr, "[deprecated] use -name, not -n\n", "")
}
func TestConfigDeprecatedPeerAddrFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-s", "localhost:7002"})
assert.NoError(t, err)
assert.Equal(t, c.Peer.Addr, "localhost:7002", "")
})
assert.Equal(t, stderr, "[deprecated] use -peer-addr, not -s\n", "")
}
func TestConfigDeprecatedPeerBindAddrFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-sl", "127.0.0.1:4003"})
assert.NoError(t, err)
assert.Equal(t, c.Peer.BindAddr, "127.0.0.1:4003", "")
})
assert.Equal(t, stderr, "[deprecated] use -peer-bind-addr, not -sl\n", "")
}
func TestConfigDeprecatedPeerCAFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-serverCAFile", "/tmp/peer/file.ca"})
assert.NoError(t, err)
assert.Equal(t, c.Peer.CAFile, "/tmp/peer/file.ca", "")
})
assert.Equal(t, stderr, "[deprecated] use -peer-ca-file, not -serverCAFile\n", "")
}
func TestConfigDeprecatedPeerCertFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-serverCert", "/tmp/peer/file.cert"})
assert.NoError(t, err)
assert.Equal(t, c.Peer.CertFile, "/tmp/peer/file.cert", "")
})
assert.Equal(t, stderr, "[deprecated] use -peer-cert-file, not -serverCert\n", "")
}
func TestConfigDeprecatedPeerKeyFileFlag(t *testing.T) {
_, stderr := capture(func() {
c := New()
err := c.LoadFlags([]string{"-serverKey", "/tmp/peer/file.key"})
assert.NoError(t, err)
assert.Equal(t, c.Peer.KeyFile, "/tmp/peer/file.key", "")
})
assert.Equal(t, stderr, "[deprecated] use -peer-key-file, not -serverKey\n", "")
}
//--------------------------------------
// Helpers
//--------------------------------------
// Sets up the environment with a given environment variable set.
func withEnv(key, value string, f func(c *Config)) {
os.Setenv(key, value)
defer os.Setenv(key, "")
c := New()
f(c)
}
// Creates a temp file and calls a function with the context.
func withTempFile(content string, fn func(string)) {
f, _ := ioutil.TempFile("", "")
f.WriteString(content)
f.Close()
defer os.Remove(f.Name())
fn(f.Name())
}
// Captures STDOUT & STDERR and returns the output as strings.
func capture(fn func()) (string, string) {
// Create temp files.
tmpout, _ := ioutil.TempFile("", "")
defer os.Remove(tmpout.Name())
tmperr, _ := ioutil.TempFile("", "")
defer os.Remove(tmperr.Name())
stdout, stderr := os.Stdout, os.Stderr
os.Stdout, os.Stderr = tmpout, tmperr
// Execute function argument and then reassign stdout/stderr.
fn()
os.Stdout, os.Stderr = stdout, stderr
// Close temp files and read them.
tmpout.Close()
bout, _ := ioutil.ReadFile(tmpout.Name())
tmperr.Close()
berr, _ := ioutil.ReadFile(tmperr.Name())
return string(bout), string(berr)
}

9
config/timeout.go Normal file
View File

@ -0,0 +1,9 @@
package config
const (
// The amount of time (in ms) to elapse without a heartbeat before becoming a candidate
defaultElectionTimeout = 200
// The frequency (in ms) by which heartbeats are sent to followers.
defaultHeartbeatTimeout = 50
)

View File

@ -0,0 +1,9 @@
FROM stackbrew/ubuntu:raring
RUN apt-get update && apt-get install -y collectd
RUN adduser --system --group --no-create-home collectd
ADD collectd.conf /etc/collectd/collectd.conf.tmpl
ADD collectd-wrapper /bin/collectd-wrapper
RUN chown -R collectd:collectd /etc/collectd
CMD ["collectd-wrapper"]

20
contrib/collectd/README Normal file
View File

@ -0,0 +1,20 @@
We're going to use Docker to build a chroot env that can be run with systemd-nspawn since I cannot figure out how to run
a container using docker in the global network namespace.
1. Build the collectd image using docker
docker build -t collectd .
2. Run the container (since we have to run it to export it...)
COLLECTD_CONTAINER=`docker run -name collectd-tmp -d collectd`
3. Export then kill the container
docker export collectd-tmp > /tmp/collectd.tar
4. Kill the temporary container
docker kill $COLLECTD_CONTAINER
5. Unpack the tar archive
mkdir -p /tmp/collectd && tar -xvf /tmp/collectd.tar -C /tmp/collectd/
6. Run collectd with systemd-nspawn - replace the COLLECTD_* env vars with your parameters!
sudo systemd-run --unit collectd systemd-nspawn -D /tmp/collectd /bin/bash -c "COLLECTD_GRAPHITE_HOSTNAME=172.31.13.241 COLLECTD_LOCAL_HOSTNAME=node1 /bin/collectd-wrapper"

View File

@ -0,0 +1,16 @@
#!/bin/bash
cat /etc/collectd/collectd.conf.tmpl > /etc/collectd/collectd.conf
cat << EOF >> /etc/collectd/collectd.conf
Hostname "${COLLECTD_LOCAL_HOSTNAME}"
<Plugin write_graphite>
<Carbon>
Host "${COLLECTD_GRAPHITE_HOSTNAME}"
Port "2003"
</Carbon>
</Plugin>
EOF
collectd -C /etc/collectd/collectd.conf -f

View File

@ -0,0 +1,898 @@
# Config file for collectd(1).
#
# Some plugins need additional configuration and are disabled by default.
# Please read collectd.conf(5) for details.
#
# You should also read /usr/share/doc/collectd-core/README.Debian.plugins
# before enabling any more plugins.
#Hostname "localhost"
#FQDNLookup true
#BaseDir "/var/lib/collectd"
#PluginDir "/usr/lib/collectd"
#TypesDB "/usr/share/collectd/types.db" "/etc/collectd/my_types.db"
#Interval 10
#Timeout 2
#ReadThreads 5
LoadPlugin logfile
#LoadPlugin syslog
<Plugin logfile>
LogLevel "info"
File STDOUT
Timestamp true
PrintSeverity false
</Plugin>
#<Plugin syslog>
# LogLevel info
#</Plugin>
#LoadPlugin amqp
#LoadPlugin apache
#LoadPlugin apcups
#LoadPlugin ascent
#LoadPlugin battery
#LoadPlugin bind
#LoadPlugin conntrack
#LoadPlugin contextswitch
LoadPlugin cpu
#LoadPlugin cpufreq
#LoadPlugin csv
#LoadPlugin curl
#LoadPlugin curl_json
#LoadPlugin curl_xml
#LoadPlugin dbi
LoadPlugin df
#LoadPlugin disk
#LoadPlugin dns
#LoadPlugin email
#LoadPlugin entropy
#LoadPlugin ethstat
#LoadPlugin exec
#LoadPlugin filecount
#LoadPlugin fscache
#LoadPlugin gmond
#LoadPlugin hddtemp
#LoadPlugin interface
#LoadPlugin ipmi
#LoadPlugin iptables
#LoadPlugin ipvs
#LoadPlugin irq
#LoadPlugin java
#LoadPlugin libvirt
#LoadPlugin load
#LoadPlugin madwifi
#LoadPlugin mbmon
#LoadPlugin md
#LoadPlugin memcachec
#LoadPlugin memcached
LoadPlugin memory
#LoadPlugin multimeter
#LoadPlugin mysql
#LoadPlugin netlink
#LoadPlugin network
#LoadPlugin nfs
#LoadPlugin nginx
#LoadPlugin notify_desktop
#LoadPlugin notify_email
#LoadPlugin ntpd
#LoadPlugin numa
#LoadPlugin nut
#LoadPlugin olsrd
#LoadPlugin openvpn
#<LoadPlugin perl>
# Globals true
#</LoadPlugin>
#LoadPlugin pinba
#LoadPlugin ping
#LoadPlugin postgresql
#LoadPlugin powerdns
#LoadPlugin processes
#LoadPlugin protocols
#<LoadPlugin python>
# Globals true
#</LoadPlugin>
#LoadPlugin rrdcached
#LoadPlugin rrdtool
#LoadPlugin sensors
#LoadPlugin serial
#LoadPlugin snmp
#LoadPlugin swap
#LoadPlugin table
#LoadPlugin tail
LoadPlugin tcpconns
#LoadPlugin teamspeak2
#LoadPlugin ted
#LoadPlugin thermal
#LoadPlugin tokyotyrant
#LoadPlugin unixsock
#LoadPlugin uptime
#LoadPlugin users
#LoadPlugin uuid
#LoadPlugin varnish
#LoadPlugin vmem
#LoadPlugin vserver
#LoadPlugin wireless
LoadPlugin write_graphite
#LoadPlugin write_http
#LoadPlugin write_mongodb
#<Plugin amqp>
# <Publish "name">
# Host "localhost"
# Port "5672"
# VHost "/"
# User "guest"
# Password "guest"
# Exchange "amq.fanout"
# RoutingKey "collectd"
# Persistent false
# StoreRates false
# </Publish>
#</Plugin>
#<Plugin apache>
# <Instance "foo">
# URL "http://localhost/server-status?auto"
# User "www-user"
# Password "secret"
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
# Server "apache"
# </Instance>
#
# <Instance "bar">
# URL "http://some.domain.tld/status?auto"
# Host "some.domain.tld"
# Server "lighttpd"
# </Instance>
#</Plugin>
#<Plugin apcups>
# Host "localhost"
# Port "3551"
#</Plugin>
#<Plugin ascent>
# URL "http://localhost/ascent/status/"
# User "www-user"
# Password "secret"
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
#</Plugin>
#<Plugin "bind">
# URL "http://localhost:8053/"
#
# ParseTime false
#
# OpCodes true
# QTypes true
# ServerStats true
# ZoneMaintStats true
# ResolverStats false
# MemoryStats true
#
# <View "_default">
# QTypes true
# ResolverStats true
# CacheRRSets true
#
# Zone "127.in-addr.arpa/IN"
# </View>
#</Plugin>
#<Plugin csv>
# DataDir "/var/lib/collectd/csv"
# StoreRates false
#</Plugin>
#<Plugin curl>
# <Page "stock_quotes">
# URL "http://finance.google.com/finance?q=NYSE%3AAMD"
# User "foo"
# Password "bar"
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
# MeasureResponseTime false
# <Match>
# Regex "<span +class=\"pr\"[^>]*> *([0-9]*\\.[0-9]+) *</span>"
# DSType "GaugeAverage"
# Type "stock_value"
# Instance "AMD"
# </Match>
# </Page>
#</Plugin>
#<Plugin curl_json>
## See: http://wiki.apache.org/couchdb/Runtime_Statistics
# <URL "http://localhost:5984/_stats">
# Instance "httpd"
# <Key "httpd/requests/count">
# Type "http_requests"
# </Key>
#
# <Key "httpd_request_methods/*/count">
# Type "http_request_methods"
# </Key>
#
# <Key "httpd_status_codes/*/count">
# Type "http_response_codes"
# </Key>
# </URL>
## Database status metrics:
# <URL "http://localhost:5984/_all_dbs">
# Instance "dbs"
# <Key "*/doc_count">
# Type "gauge"
# </Key>
# <Key "*/doc_del_count">
# Type "counter"
# </Key>
# <Key "*/disk_size">
# Type "bytes"
# </Key>
# </URL>
#</Plugin>
#<Plugin "curl_xml">
# <URL "http://localhost/stats.xml">
# Host "my_host"
# Instance "some_instance"
# User "collectd"
# Password "thaiNg0I"
# VerifyPeer true
# VerifyHost true
# CACert "/path/to/ca.crt"
#
# <XPath "table[@id=\"magic_level\"]/tr">
# Type "magic_level"
# InstancePrefix "prefix-"
# InstanceFrom "td[1]"
# ValuesFrom "td[2]/span[@class=\"level\"]"
# </XPath>
# </URL>
#</Plugin>
#<Plugin dbi>
# <Query "num_of_customers">
# Statement "SELECT 'customers' AS c_key, COUNT(*) AS c_value \
# FROM customers_tbl"
# MinVersion 40102
# MaxVersion 50042
# <Result>
# Type "gauge"
# InstancePrefix "customer"
# InstancesFrom "c_key"
# ValuesFrom "c_value"
# </Result>
# </Query>
#
# <Database "customers_db">
# Driver "mysql"
# DriverOption "host" "localhost"
# DriverOption "username" "collectd"
# DriverOption "password" "secret"
# DriverOption "dbname" "custdb0"
# SelectDB "custdb0"
# Query "num_of_customers"
# Query "..."
# </Database>
#</Plugin>
#<Plugin df>
# Device "/dev/sda1"
# Device "192.168.0.2:/mnt/nfs"
# MountPoint "/home"
# FSType "ext3"
# IgnoreSelected false
# ReportByDevice false
# ReportReserved false
# ReportInodes false
#</Plugin>
#<Plugin disk>
# Disk "hda"
# Disk "/sda[23]/"
# IgnoreSelected false
#</Plugin>
#<Plugin dns>
# Interface "eth0"
# IgnoreSource "192.168.0.1"
# SelectNumericQueryTypes false
#</Plugin>
#<Plugin email>
# SocketFile "/var/run/collectd-email"
# SocketGroup "collectd"
# SocketPerms "0770"
# MaxConns 5
#</Plugin>
#<Plugin ethstat>
# Interface "eth0"
# Map "rx_csum_offload_errors" "if_rx_errors" "checksum_offload"
# Map "multicast" "if_multicast"
# MappedOnly false
#</Plugin>
#<Plugin exec>
# Exec user "/path/to/exec"
# Exec "user:group" "/path/to/exec"
# NotificationExec user "/path/to/exec"
#</Plugin>
#<Plugin filecount>
# <Directory "/path/to/dir">
# Instance "foodir"
# Name "*.conf"
# MTime "-5m"
# Size "+10k"
# Recursive true
# IncludeHidden false
# </Directory>
#</Plugin>
#<Plugin gmond>
# MCReceiveFrom "239.2.11.71" "8649"
#
# <Metric "swap_total">
# Type "swap"
# TypeInstance "total"
# DataSource "value"
# </Metric>
#
# <Metric "swap_free">
# Type "swap"
# TypeInstance "free"
# DataSource "value"
# </Metric>
#</Plugin>
#<Plugin hddtemp>
# Host "127.0.0.1"
# Port 7634
#</Plugin>
#<Plugin interface>
# Interface "eth0"
# IgnoreSelected false
#</Plugin>
#<Plugin ipmi>
# Sensor "some_sensor"
# Sensor "another_one"
# IgnoreSelected false
# NotifySensorAdd false
# NotifySensorRemove true
# NotifySensorNotPresent false
#</Plugin>
#<Plugin iptables>
# Chain "table" "chain"
#</Plugin>
#<Plugin irq>
# Irq 7
# Irq 8
# Irq 9
# IgnoreSelected true
#</Plugin>
#<Plugin java>
# JVMArg "-verbose:jni"
# JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar"
#
# LoadPlugin "org.collectd.java.GenericJMX"
# <Plugin "GenericJMX">
# # See /usr/share/doc/collectd/examples/GenericJMX.conf
# # for an example config.
# </Plugin>
#</Plugin>
#<Plugin libvirt>
# Connection "xen:///"
# RefreshInterval 60
# Domain "name"
# BlockDevice "name:device"
# InterfaceDevice "name:device"
# IgnoreSelected false
# HostnameFormat name
# InterfaceFormat name
#</Plugin>
#<Plugin madwifi>
# Interface "wlan0"
# IgnoreSelected false
# Source "SysFS"
# WatchSet "None"
# WatchAdd "node_octets"
# WatchAdd "node_rssi"
# WatchAdd "is_rx_acl"
# WatchAdd "is_scan_active"
#</Plugin>
#<Plugin mbmon>
# Host "127.0.0.1"
# Port 411
#</Plugin>
#<Plugin md>
# Device "/dev/md0"
# IgnoreSelected false
#</Plugin>
#<Plugin memcachec>
# <Page "plugin_instance">
# Server "localhost"
# Key "page_key"
# <Match>
# Regex "(\\d+) bytes sent"
# ExcludeRegex "<lines to be excluded>"
# DSType CounterAdd
# Type "ipt_octets"
# Instance "type_instance"
# </Match>
# </Page>
#</Plugin>
#<Plugin memcached>
# Socket "/var/run/memcached.sock"
# or:
# Host "127.0.0.1"
# Port "11211"
#</Plugin>
#<Plugin mysql>
# <Database db_name>
# Host "database.serv.er"
# Port "3306"
# User "db_user"
# Password "secret"
# Database "db_name"
# MasterStats true
# </Database>
#
# <Database db_name2>
# Host "localhost"
# Socket "/var/run/mysql/mysqld.sock"
# SlaveStats true
# SlaveNotifications true
# </Database>
#</Plugin>
#<Plugin netlink>
# Interface "All"
# VerboseInterface "All"
# QDisc "eth0" "pfifo_fast-1:0"
# Class "ppp0" "htb-1:10"
# Filter "ppp0" "u32-1:0"
# IgnoreSelected false
#</Plugin>
#<Plugin network>
# # client setup:
# Server "ff18::efc0:4a42" "25826"
# <Server "239.192.74.66" "25826">
# SecurityLevel Encrypt
# Username "user"
# Password "secret"
# Interface "eth0"
# </Server>
# TimeToLive "128"
#
# # server setup:
# Listen "0.0.0.0" "25826"
# <Listen "239.192.74.66" "25826">
# SecurityLevel Sign
# AuthFile "/etc/collectd/passwd"
# Interface "eth0"
# </Listen>
# MaxPacketSize 1024
#
# # proxy setup (client and server as above):
# Forward true
#
# # statistics about the network plugin itself
# ReportStats false
#
# # "garbage collection"
# CacheFlush 1800
#</Plugin>
#<Plugin nginx>
# URL "http://localhost/status?auto"
# User "www-user"
# Password "secret"
# VerifyPeer false
# VerifyHost false
# CACert "/etc/ssl/ca.crt"
#</Plugin>
#<Plugin notify_desktop>
# OkayTimeout 1000
# WarningTimeout 5000
# FailureTimeout 0
#</Plugin>
#<Plugin notify_email>
# SMTPServer "localhost"
# SMTPPort 25
# SMTPUser "my-username"
# SMTPPassword "my-password"
# From "collectd@main0server.com"
# # <WARNING/FAILURE/OK> on <hostname>.
# # Beware! Do not use not more than two placeholders (%)!
# Subject "[collectd] %s on %s!"
# Recipient "email1@domain1.net"
# Recipient "email2@domain2.com"
#</Plugin>
#<Plugin ntpd>
# Host "localhost"
# Port 123
# ReverseLookups false
#</Plugin>
#<Plugin nut>
# UPS "upsname@hostname:port"
#</Plugin>
#<Plugin olsrd>
# Host "127.0.0.1"
# Port "2006"
# CollectLinks "Summary"
# CollectRoutes "Summary"
# CollectTopology "Summary"
#</Plugin>
#<Plugin openvpn>
# StatusFile "/etc/openvpn/openvpn-status.log"
# ImprovedNamingSchema false
# CollectCompression true
# CollectIndividualUsers true
# CollectUserCount false
#</Plugin>
#<Plugin perl>
# IncludeDir "/my/include/path"
# BaseName "Collectd::Plugins"
# EnableDebugger ""
# LoadPlugin Monitorus
# LoadPlugin OpenVZ
#
# <Plugin foo>
# Foo "Bar"
# Qux "Baz"
# </Plugin>
#</Plugin>
#<Plugin pinba>
# Address "::0"
# Port "30002"
# <View "name">
# Host "host name"
# Server "server name"
# Script "script name"
# <View>
#</Plugin>
#<Plugin ping>
# Host "host.foo.bar"
# Host "host.baz.qux"
# Interval 1.0
# Timeout 0.9
# TTL 255
# SourceAddress "1.2.3.4"
# Device "eth0"
# MaxMissed -1
#</Plugin>
#<Plugin postgresql>
# <Query magic>
# Statement "SELECT magic FROM wizard WHERE host = $1;"
# Param hostname
#
# <Result>
# Type gauge
# InstancePrefix "magic"
# ValuesFrom "magic"
# </Result>
# </Query>
#
# <Query rt36_tickets>
# Statement "SELECT COUNT(type) AS count, type \
# FROM (SELECT CASE \
# WHEN resolved = 'epoch' THEN 'open' \
# ELSE 'resolved' END AS type \
# FROM tickets) type \
# GROUP BY type;"
#
# <Result>
# Type counter
# InstancePrefix "rt36_tickets"
# InstancesFrom "type"
# ValuesFrom "count"
# </Result>
# </Query>
#
# <Database foo>
# Host "hostname"
# Port 5432
# User "username"
# Password "secret"
#
# SSLMode "prefer"
# KRBSrvName "kerberos_service_name"
#
# Query magic
# </Database>
#
# <Database bar>
# Interval 60
# Service "service_name"
#
# Query backend # predefined
# Query rt36_tickets
# </Database>
#</Plugin>
#<Plugin powerdns>
# <Server "server_name">
# Collect "latency"
# Collect "udp-answers" "udp-queries"
# Socket "/var/run/pdns.controlsocket"
# </Server>
# <Recursor "recursor_name">
# Collect "questions"
# Collect "cache-hits" "cache-misses"
# Socket "/var/run/pdns_recursor.controlsocket"
# </Recursor>
# LocalSocket "/opt/collectd/var/run/collectd-powerdns"
#</Plugin>
#<Plugin processes>
# Process "name"
# ProcessMatch "foobar" "/usr/bin/perl foobar\\.pl.*"
#</Plugin>
#<Plugin protocols>
# Value "/^Tcp:/"
# IgnoreSelected false
#</Plugin>
#<Plugin python>
# ModulePath "/path/to/your/python/modules"
# LogTraces true
# Interactive true
# Import "spam"
#
# <Module spam>
# spam "wonderful" "lovely"
# </Module>
#</Plugin>
#<Plugin rrdcached>
# DaemonAddress "unix:/var/run/rrdcached.sock"
# DataDir "/var/lib/rrdcached/db/collectd"
# CreateFiles true
# CollectStatistics true
#</Plugin>
<Plugin rrdtool>
DataDir "/var/lib/collectd/rrd"
# CacheTimeout 120
# CacheFlush 900
# WritesPerSecond 30
# RandomTimeout 0
#
# The following settings are rather advanced
# and should usually not be touched:
# StepSize 10
# HeartBeat 20
# RRARows 1200
# RRATimespan 158112000
# XFF 0.1
</Plugin>
#<Plugin sensors>
# SensorConfigFile "/etc/sensors3.conf"
# Sensor "it8712-isa-0290/temperature-temp1"
# Sensor "it8712-isa-0290/fanspeed-fan3"
# Sensor "it8712-isa-0290/voltage-in8"
# IgnoreSelected false
#</Plugin>
# See /usr/share/doc/collectd/examples/snmp-data.conf.gz for a
# comprehensive sample configuration.
#<Plugin snmp>
# <Data "powerplus_voltge_input">
# Type "voltage"
# Table false
# Instance "input_line1"
# Scale 0.1
# Values "SNMPv2-SMI::enterprises.6050.5.4.1.1.2.1"
# </Data>
# <Data "hr_users">
# Type "users"
# Table false
# Instance ""
# Shift -1
# Values "HOST-RESOURCES-MIB::hrSystemNumUsers.0"
# </Data>
# <Data "std_traffic">
# Type "if_octets"
# Table true
# InstancePrefix "traffic"
# Instance "IF-MIB::ifDescr"
# Values "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets"
# </Data>
#
# <Host "some.switch.mydomain.org">
# Address "192.168.0.2"
# Version 1
# Community "community_string"
# Collect "std_traffic"
# Inverval 120
# </Host>
# <Host "some.server.mydomain.org">
# Address "192.168.0.42"
# Version 2
# Community "another_string"
# Collect "std_traffic" "hr_users"
# </Host>
# <Host "some.ups.mydomain.org">
# Address "192.168.0.3"
# Version 1
# Community "more_communities"
# Collect "powerplus_voltge_input"
# Interval 300
# </Host>
#</Plugin>
#<Plugin swap>
# ReportByDevice false
#</Plugin>
#<Plugin table>
# <Table "/proc/slabinfo">
# Instance "slabinfo"
# Separator " "
# <Result>
# Type gauge
# InstancePrefix "active_objs"
# InstancesFrom 0
# ValuesFrom 1
# </Result>
# <Result>
# Type gauge
# InstancePrefix "objperslab"
# InstancesFrom 0
# ValuesFrom 4
# </Result>
# </Table>
#</Plugin>
#<Plugin "tail">
# <File "/var/log/exim4/mainlog">
# Instance "exim"
# <Match>
# Regex "S=([1-9][0-9]*)"
# DSType "CounterAdd"
# Type "ipt_bytes"
# Instance "total"
# </Match>
# <Match>
# Regex "\\<R=local_user\\>"
# ExcludeRegex "\\<R=local_user\\>.*mail_spool defer"
# DSType "CounterInc"
# Type "counter"
# Instance "local_user"
# </Match>
# </File>
#</Plugin>
<Plugin tcpconns>
LocalPort "4001"
LocalPort "7001"
</Plugin>
#<Plugin teamspeak2>
# Host "127.0.0.1"
# Port "51234"
# Server "8767"
#</Plugin>
#<Plugin ted>
# Device "/dev/ttyUSB0"
# Retries 0
#</Plugin>
#<Plugin thermal>
# ForceUseProcfs false
# Device "THRM"
# IgnoreSelected false
#</Plugin>
#<Plugin tokyotyrant>
# Host "localhost"
# Port "1978"
#</Plugin>
#<Plugin unixsock>
# SocketFile "/var/run/collectd-unixsock"
# SocketGroup "collectd"
# SocketPerms "0660"
# DeleteSocket false
#</Plugin>
#<Plugin uuid>
# UUIDFile "/etc/uuid"
#</Plugin>
#<Plugin varnish>
# <Instance>
# CollectCache true
# CollectBackend true
# CollectConnections true
# CollectSHM true
# CollectESI false
# CollectFetch false
# CollectHCB false
# CollectSMA false
# CollectSMS false
# CollectSM false
# CollectTotals false
# CollectWorkers false
# </Instance>
#
# <Instance "myinstance">
# CollectCache true
# </Instance>
#</Plugin>
#<Plugin vmem>
# Verbose false
#</Plugin>
#<Plugin write_graphite>
# <Carbon>
# Host "127.0.01"
# Port "2003"
# Prefix "collectd"
# Postfix "collectd"
# StoreRates false
# AlwaysAppendDS false
# EscapeCharacter "_"
# </Carbon>
#</Plugin>
#<Plugin write_http>
# <URL "http://example.com/collectd-post">
# User "collectd"
# Password "secret"
# VerifyPeer true
# VerifyHost true
# CACert "/etc/ssl/ca.crt"
# Format "Command"
# StoreRates false
# </URL>
#</Plugin>
#<Plugin write_mongodb>
# <Node "example">
# Host "localhost"
# Port "27017"
# Timeout 1000
# StoreRates false
# <Node>
#</Plugin>
Include "/etc/collectd/filters.conf"
Include "/etc/collectd/thresholds.conf"

View File

@ -0,0 +1,31 @@
from stackbrew/ubuntu:precise
run echo 'deb http://us.archive.ubuntu.com/ubuntu/ precise universe' >> /etc/apt/sources.list
run apt-get -y update
# Install required packages
run apt-get -y install python-cairo python-django python-twisted python-django-tagging python-simplejson python-pysqlite2 python-support python-pip gunicorn supervisor nginx-light
run pip install whisper
run pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" carbon
run pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/webapp" graphite-web
# Add system service config
add ./nginx.conf /etc/nginx/nginx.conf
add ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Add graphite config
add ./initial_data.json /var/lib/graphite/webapp/graphite/initial_data.json
add ./local_settings.py /var/lib/graphite/webapp/graphite/local_settings.py
add ./carbon.conf /var/lib/graphite/conf/carbon.conf
add ./storage-schemas.conf /var/lib/graphite/conf/storage-schemas.conf
run mkdir -p /var/lib/graphite/storage/whisper
run touch /var/lib/graphite/storage/graphite.db /var/lib/graphite/storage/index
run chown -R www-data /var/lib/graphite/storage
run chmod 0775 /var/lib/graphite/storage /var/lib/graphite/storage/whisper
run chmod 0664 /var/lib/graphite/storage/graphite.db
run cd /var/lib/graphite/webapp/graphite && python manage.py syncdb --noinput
expose :80
expose :2003
cmd ["/usr/bin/supervisord"]

7
contrib/graphite/README Normal file
View File

@ -0,0 +1,7 @@
Running graphite under Docker is straightforward:
1. Build the graphite image using Docker
docker build -t graphite .
2. Run a graphite container. Be sure to replace the $IP field with the IP address at which you wish to expose your graphite web service.
docker run -p $IP:8080:80 -p $IP:2003:2003 -d graphite

View File

@ -0,0 +1,62 @@
[cache]
LOCAL_DATA_DIR = /var/lib/graphite/storage/whisper/
# Specify the user to drop privileges to
# If this is blank carbon runs as the user that invokes it
# This user must have write access to the local data directory
USER =
# Limit the size of the cache to avoid swapping or becoming CPU bound.
# Sorts and serving cache queries gets more expensive as the cache grows.
# Use the value "inf" (infinity) for an unlimited cache size.
MAX_CACHE_SIZE = inf
# Limits the number of whisper update_many() calls per second, which effectively
# means the number of write requests sent to the disk. This is intended to
# prevent over-utilizing the disk and thus starving the rest of the system.
# When the rate of required updates exceeds this, then carbon's caching will
# take effect and increase the overall throughput accordingly.
MAX_UPDATES_PER_SECOND = 1000
# Softly limits the number of whisper files that get created each minute.
# Setting this value low (like at 50) is a good way to ensure your graphite
# system will not be adversely impacted when a bunch of new metrics are
# sent to it. The trade off is that it will take much longer for those metrics'
# database files to all get created and thus longer until the data becomes usable.
# Setting this value high (like "inf" for infinity) will cause graphite to create
# the files quickly but at the risk of slowing I/O down considerably for a while.
MAX_CREATES_PER_MINUTE = inf
LINE_RECEIVER_INTERFACE = 0.0.0.0
LINE_RECEIVER_PORT = 2003
#PICKLE_RECEIVER_INTERFACE = 0.0.0.0
#PICKLE_RECEIVER_PORT = 2004
#CACHE_QUERY_INTERFACE = 0.0.0.0
#CACHE_QUERY_PORT = 7002
LOG_UPDATES = False
# Enable AMQP if you want to receve metrics using an amqp broker
# ENABLE_AMQP = False
# Verbose means a line will be logged for every metric received
# useful for testing
# AMQP_VERBOSE = False
# AMQP_HOST = localhost
# AMQP_PORT = 5672
# AMQP_VHOST = /
# AMQP_USER = guest
# AMQP_PASSWORD = guest
# AMQP_EXCHANGE = graphite
# Patterns for all of the metrics this machine will store. Read more at
# http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Bindings
#
# Example: store all sales, linux servers, and utilization metrics
# BIND_PATTERNS = sales.#, servers.linux.#, #.utilization
#
# Example: store everything
# BIND_PATTERNS = #

View File

@ -0,0 +1,20 @@
[
{
"pk": 1,
"model": "auth.user",
"fields": {
"username": "admin",
"first_name": "",
"last_name": "",
"is_active": true,
"is_superuser": true,
"is_staff": true,
"last_login": "2011-09-20 17:02:14",
"groups": [],
"user_permissions": [],
"password": "sha1$1b11b$edeb0a67a9622f1f2cfeabf9188a711f5ac7d236",
"email": "root@example.com",
"date_joined": "2011-09-20 17:02:14"
}
}
]

View File

@ -0,0 +1 @@
TIME_ZONE = 'UTC'

View File

@ -0,0 +1,69 @@
daemon off;
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
server_names_hash_bucket_size 32;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
server {
listen 80 default_server;
server_name _;
open_log_file_cache max=1000 inactive=20s min_uses=2 valid=1m;
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header Host $host;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, OPTIONS";
add_header Access-Control-Allow-Headers "origin, authorization, accept";
location /content {
alias /var/lib/graphite/webapp/content;
}
location /media {
alias /usr/share/pyshared/django/contrib/admin/media;
}
}
}

View File

@ -0,0 +1,7 @@
[carbon]
pattern = ^carbon\..*
retentions = 1m:31d,10m:1y,1h:5y
[default]
pattern = .*
retentions = 10s:8d,1m:31d,10m:1y,1h:5y

View File

@ -0,0 +1,25 @@
[supervisord]
nodaemon = true
environment = GRAPHITE_STORAGE_DIR='/var/lib/graphite/storage',GRAPHITE_CONF_DIR='/var/lib/graphite/conf'
[program:nginx]
command = /usr/sbin/nginx
stdout_logfile = /var/log/supervisor/%(program_name)s.log
stderr_logfile = /var/log/supervisor/%(program_name)s.log
autorestart = true
[program:carbon-cache]
user = www-data
command = /var/lib/graphite/bin/carbon-cache.py --debug start
stdout_logfile = /var/log/supervisor/%(program_name)s.log
stderr_logfile = /var/log/supervisor/%(program_name)s.log
autorestart = true
[program:graphite-webapp]
user = www-data
directory = /var/lib/graphite/webapp
environment = PYTHONPATH='/var/lib/graphite/webapp'
command = /usr/bin/gunicorn_django -b127.0.0.1:8000 -w2 graphite/settings.py
stdout_logfile = /var/log/supervisor/%(program_name)s.log
stderr_logfile = /var/log/supervisor/%(program_name)s.log
autorestart = true

145
discovery/discovery.go Normal file
View File

@ -0,0 +1,145 @@
package discovery
import (
"errors"
"fmt"
"net/url"
"path"
"strings"
"time"
etcdErr "github.com/coreos/etcd/error"
"github.com/coreos/etcd/log"
"github.com/coreos/etcd/third_party/github.com/coreos/go-etcd/etcd"
)
const (
stateKey = "_state"
startedState = "started"
defaultTTL = 604800 // One week TTL
)
type Discoverer struct {
client *etcd.Client
name string
peer string
prefix string
discoveryURL string
}
var defaultDiscoverer *Discoverer
func init() {
defaultDiscoverer = &Discoverer{}
}
func (d *Discoverer) Do(discoveryURL string, name string, peer string) (peers []string, err error) {
d.name = name
d.peer = peer
d.discoveryURL = discoveryURL
u, err := url.Parse(discoveryURL)
if err != nil {
return
}
// prefix is prepended to all keys for this discovery
d.prefix = strings.TrimPrefix(u.Path, "/v2/keys/")
// keep the old path in case we need to set the KeyPrefix below
oldPath := u.Path
u.Path = ""
// Connect to a scheme://host not a full URL with path
log.Infof("Discovery via %s using prefix %s.", u.String(), d.prefix)
d.client = etcd.NewClient([]string{u.String()})
if !strings.HasPrefix(oldPath, "/v2/keys") {
d.client.SetKeyPrefix("")
}
// Register this machine first and announce that we are a member of
// this cluster
err = d.heartbeat()
if err != nil {
return
}
// Start the very slow heartbeat to the cluster now in anticipation
// that everything is going to go alright now
go d.startHeartbeat()
// Attempt to take the leadership role, if there is no error we are it!
resp, err := d.client.Create(path.Join(d.prefix, stateKey), startedState, 0)
// Bail out on unexpected errors
if err != nil {
if clientErr, ok := err.(*etcd.EtcdError); !ok || clientErr.ErrorCode != etcdErr.EcodeNodeExist {
return nil, err
}
}
// If we got a response then the CAS was successful, we are leader
if resp != nil && resp.Node.Value == startedState {
// We are the leader, we have no peers
log.Infof("Discovery _state was empty, so this machine is the initial leader.")
return nil, nil
}
// Fall through to finding the other discovery peers
return d.findPeers()
}
func (d *Discoverer) findPeers() (peers []string, err error) {
resp, err := d.client.Get(path.Join(d.prefix), false, true)
if err != nil {
return nil, err
}
node := resp.Node
if node == nil {
return nil, fmt.Errorf("%s key doesn't exist.", d.prefix)
}
for _, n := range node.Nodes {
// Skip our own entry in the list, there is no point
if strings.HasSuffix(n.Key, "/"+d.name) {
continue
}
peers = append(peers, n.Value)
}
if len(peers) == 0 {
return nil, errors.New("Discovery found an initialized cluster but no peers are registered.")
}
log.Infof("Discovery found peers %v", peers)
return
}
func (d *Discoverer) startHeartbeat() {
// In case of errors we should attempt to heartbeat fairly frequently
heartbeatInterval := defaultTTL / 8
ticker := time.Tick(time.Second * time.Duration(heartbeatInterval))
for {
select {
case <-ticker:
err := d.heartbeat()
if err != nil {
log.Warnf("Discovery heartbeat failed: %v", err)
}
}
}
}
func (d *Discoverer) heartbeat() error {
_, err := d.client.Set(path.Join(d.prefix, d.name), d.peer, defaultTTL)
return err
}
func Do(discoveryURL string, name string, peer string) ([]string, error) {
return defaultDiscoverer.Do(discoveryURL, name, peer)
}

View File

@ -1,49 +0,0 @@
package main
import (
"encoding/json"
)
var errors map[int]string
func init() {
errors = make(map[int]string)
// command related errors
errors[100] = "Key Not Found"
errors[101] = "The given PrevValue is not equal to the value of the key"
errors[102] = "Not A File"
errors[103] = "Reached the max number of machines in the cluster"
// Post form related errors
errors[200] = "Value is Required in POST form"
errors[201] = "PrevValue is Required in POST form"
errors[202] = "The given TTL in POST form is not a number"
errors[203] = "The given index in POST form is not a number"
// raft related errors
errors[300] = "Raft Internal Error"
errors[301] = "During Leader Election"
// keyword
errors[400] = "The prefix of the given key is a keyword in etcd"
// etcd related errors
errors[500] = "watcher is cleared due to etcd recovery"
}
type jsonError struct {
ErrorCode int `json:"errorCode"`
Message string `json:"message"`
Cause string `json:"cause,omitempty"`
}
func newJsonError(errorCode int, cause string) []byte {
b, _ := json.Marshal(jsonError{
ErrorCode: errorCode,
Message: errors[errorCode],
Cause: cause,
})
return b
}

139
error/error.go Normal file
View File

@ -0,0 +1,139 @@
/*
Copyright 2013 CoreOS Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package error
import (
"encoding/json"
"fmt"
"net/http"
)
var errors map[int]string
const (
EcodeKeyNotFound = 100
EcodeTestFailed = 101
EcodeNotFile = 102
EcodeNoMorePeer = 103
EcodeNotDir = 104
EcodeNodeExist = 105
EcodeKeyIsPreserved = 106
EcodeRootROnly = 107
EcodeDirNotEmpty = 108
EcodeValueRequired = 200
EcodePrevValueRequired = 201
EcodeTTLNaN = 202
EcodeIndexNaN = 203
EcodeValueOrTTLRequired = 204
EcodeTimeoutNaN = 205
EcodeNameRequired = 206
EcodeIndexOrValueRequired = 207
EcodeIndexValueMutex = 208
EcodeInvalidField = 209
EcodeRaftInternal = 300
EcodeLeaderElect = 301
EcodeWatcherCleared = 400
EcodeEventIndexCleared = 401
)
func init() {
errors = make(map[int]string)
// command related errors
errors[EcodeKeyNotFound] = "Key not found"
errors[EcodeTestFailed] = "Compare failed" //test and set
errors[EcodeNotFile] = "Not a file"
errors[EcodeNoMorePeer] = "Reached the max number of peers in the cluster"
errors[EcodeNotDir] = "Not a directory"
errors[EcodeNodeExist] = "Key already exists" // create
errors[EcodeRootROnly] = "Root is read only"
errors[EcodeKeyIsPreserved] = "The prefix of given key is a keyword in etcd"
errors[EcodeDirNotEmpty] = "Directory not empty"
// Post form related errors
errors[EcodeValueRequired] = "Value is Required in POST form"
errors[EcodePrevValueRequired] = "PrevValue is Required in POST form"
errors[EcodeTTLNaN] = "The given TTL in POST form is not a number"
errors[EcodeIndexNaN] = "The given index in POST form is not a number"
errors[EcodeValueOrTTLRequired] = "Value or TTL is required in POST form"
errors[EcodeTimeoutNaN] = "The given timeout in POST form is not a number"
errors[EcodeNameRequired] = "Name is required in POST form"
errors[EcodeIndexOrValueRequired] = "Index or value is required"
errors[EcodeIndexValueMutex] = "Index and value cannot both be specified"
errors[EcodeInvalidField] = "Invalid field"
// raft related errors
errors[EcodeRaftInternal] = "Raft Internal Error"
errors[EcodeLeaderElect] = "During Leader Election"
// etcd related errors
errors[EcodeWatcherCleared] = "watcher is cleared due to etcd recovery"
errors[EcodeEventIndexCleared] = "The event in requested index is outdated and cleared"
}
type Error struct {
ErrorCode int `json:"errorCode"`
Message string `json:"message"`
Cause string `json:"cause,omitempty"`
Index uint64 `json:"index"`
}
func NewError(errorCode int, cause string, index uint64) *Error {
return &Error{
ErrorCode: errorCode,
Message: errors[errorCode],
Cause: cause,
Index: index,
}
}
func Message(code int) string {
return errors[code]
}
// Only for error interface
func (e Error) Error() string {
return e.Message
}
func (e Error) toJsonString() string {
b, _ := json.Marshal(e)
return string(b)
}
func (e Error) Write(w http.ResponseWriter) {
w.Header().Add("X-Etcd-Index", fmt.Sprint(e.Index))
// 3xx is raft internal error
status := http.StatusBadRequest
switch e.ErrorCode {
case EcodeKeyNotFound:
status = http.StatusNotFound
case EcodeNotFile, EcodeDirNotEmpty:
status = http.StatusForbidden
case EcodeTestFailed, EcodeNodeExist:
status = http.StatusPreconditionFailed
default:
if e.ErrorCode/100 == 3 {
status = http.StatusInternalServerError
}
}
http.Error(w, e.toJsonString(), status)
}

772
etcd.go
View File

@ -1,639 +1,201 @@
/*
Copyright 2013 CoreOS Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"encoding/json"
"encoding/pem"
"flag"
"fmt"
"github.com/coreos/etcd/store"
"github.com/coreos/etcd/web"
"github.com/coreos/go-raft"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"os/signal"
"runtime/pprof"
"strings"
"path/filepath"
"runtime"
"time"
"github.com/coreos/etcd/third_party/github.com/coreos/raft"
"github.com/coreos/etcd/config"
ehttp "github.com/coreos/etcd/http"
"github.com/coreos/etcd/log"
"github.com/coreos/etcd/metrics"
"github.com/coreos/etcd/server"
"github.com/coreos/etcd/store"
)
//------------------------------------------------------------------------------
//
// Initialization
//
//------------------------------------------------------------------------------
var verbose bool
var veryVerbose bool
var machines string
var machinesFile string
var cluster []string
var argInfo Info
var dirPath string
var force bool
var maxSize int
var snapshot bool
var retryTimes int
var maxClusterSize int
var cpuprofile string
func init() {
flag.BoolVar(&verbose, "v", false, "verbose logging")
flag.BoolVar(&veryVerbose, "vv", false, "very verbose logging")
flag.StringVar(&machines, "C", "", "the ip address and port of a existing machines in the cluster, sepearate by comma")
flag.StringVar(&machinesFile, "CF", "", "the file contains a list of existing machines in the cluster, seperate by comma")
flag.StringVar(&argInfo.Name, "n", "default-name", "the node name (required)")
flag.StringVar(&argInfo.EtcdURL, "c", "127.0.0.1:4001", "the hostname:port for etcd client communication")
flag.StringVar(&argInfo.RaftURL, "s", "127.0.0.1:7001", "the hostname:port for raft server communication")
flag.StringVar(&argInfo.WebURL, "w", "", "the hostname:port of web interface")
flag.StringVar(&argInfo.RaftTLS.CAFile, "serverCAFile", "", "the path of the CAFile")
flag.StringVar(&argInfo.RaftTLS.CertFile, "serverCert", "", "the cert file of the server")
flag.StringVar(&argInfo.RaftTLS.KeyFile, "serverKey", "", "the key file of the server")
flag.StringVar(&argInfo.EtcdTLS.CAFile, "clientCAFile", "", "the path of the client CAFile")
flag.StringVar(&argInfo.EtcdTLS.CertFile, "clientCert", "", "the cert file of the client")
flag.StringVar(&argInfo.EtcdTLS.KeyFile, "clientKey", "", "the key file of the client")
flag.StringVar(&dirPath, "d", ".", "the directory to store log and snapshot")
flag.BoolVar(&force, "f", false, "force new node configuration if existing is found (WARNING: data loss!)")
flag.BoolVar(&snapshot, "snapshot", false, "open or close snapshot")
flag.IntVar(&maxSize, "m", 1024, "the max size of result buffer")
flag.IntVar(&retryTimes, "r", 3, "the max retry attempts when trying to join a cluster")
flag.IntVar(&maxClusterSize, "maxsize", 9, "the max size of the cluster")
flag.StringVar(&cpuprofile, "cpuprofile", "", "write cpu profile to file")
}
const (
ELECTIONTIMEOUT = 200 * time.Millisecond
HEARTBEATTIMEOUT = 50 * time.Millisecond
// Timeout for internal raft http connection
// The original timeout for http is 45 seconds
// which is too long for our usage.
HTTPTIMEOUT = 10 * time.Second
RETRYINTERVAL = 10
)
//------------------------------------------------------------------------------
//
// Typedefs
//
//------------------------------------------------------------------------------
type TLSInfo struct {
CertFile string `json:"CertFile"`
KeyFile string `json:"KeyFile"`
CAFile string `json:"CAFile"`
}
type Info struct {
Name string `json:"name"`
RaftURL string `json:"raftURL"`
EtcdURL string `json:"etcdURL"`
WebURL string `json:"webURL"`
RaftTLS TLSInfo `json:"raftTLS"`
EtcdTLS TLSInfo `json:"etcdTLS"`
}
//------------------------------------------------------------------------------
//
// Variables
//
//------------------------------------------------------------------------------
var raftServer *raft.Server
var raftTransporter transporter
var etcdStore *store.Store
var info *Info
//------------------------------------------------------------------------------
//
// Functions
//
//------------------------------------------------------------------------------
// sanitizeURL will cleanup a host string in the format hostname:port and
// attach a schema.
func sanitizeURL(host string, defaultScheme string) string {
// Blank URLs are fine input, just return it
if len(host) == 0 {
return host
}
p, err := url.Parse(host)
if err != nil {
fatal(err)
}
// Make sure the host is in Host:Port format
_, _, err = net.SplitHostPort(host)
if err != nil {
fatal(err)
}
p = &url.URL{Host: host, Scheme: defaultScheme}
return p.String()
}
//--------------------------------------
// Main
//--------------------------------------
func main() {
flag.Parse()
if cpuprofile != "" {
f, err := os.Create(cpuprofile)
if err != nil {
fatal(err)
}
pprof.StartCPUProfile(f)
defer pprof.StopCPUProfile()
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
for sig := range c {
fmt.Printf("captured %v, stopping profiler and exiting..", sig)
pprof.StopCPUProfile()
os.Exit(1)
}
}()
// Load configuration.
var config = config.New()
if err := config.Load(os.Args[1:]); err != nil {
fmt.Println(server.Usage() + "\n")
fmt.Println(err.Error() + "\n")
os.Exit(1)
} else if config.ShowVersion {
fmt.Println(server.ReleaseVersion)
os.Exit(0)
} else if config.ShowHelp {
fmt.Println(server.Usage() + "\n")
os.Exit(0)
}
if veryVerbose {
verbose = true
// Enable options.
if config.VeryVeryVerbose {
log.Verbose = true
raft.SetLogLevel(raft.Trace)
} else if config.VeryVerbose {
log.Verbose = true
raft.SetLogLevel(raft.Debug)
} else if config.Verbose {
log.Verbose = true
}
if config.CPUProfileFile != "" {
profile(config.CPUProfileFile)
}
if machines != "" {
cluster = strings.Split(machines, ",")
} else if machinesFile != "" {
b, err := ioutil.ReadFile(machinesFile)
if config.DataDir == "" {
log.Fatal("The data dir was not set and could not be guessed from machine name")
}
// Create data directory if it doesn't already exist.
if err := os.MkdirAll(config.DataDir, 0744); err != nil {
log.Fatalf("Unable to create path: %s", err)
}
// Warn people if they have an info file
info := filepath.Join(config.DataDir, "info")
if _, err := os.Stat(info); err == nil {
log.Warnf("All cached configuration is now ignored. The file %s can be removed.", info)
}
var mbName string
if config.Trace() {
mbName = config.MetricsBucketName()
runtime.SetBlockProfileRate(1)
}
mb := metrics.NewBucket(mbName)
if config.GraphiteHost != "" {
err := mb.Publish(config.GraphiteHost)
if err != nil {
fatalf("Unable to read the given machines file: %s", err)
}
cluster = strings.Split(string(b), ",")
}
raftTLSConfig, ok := tlsConfigFromInfo(argInfo.RaftTLS)
if !ok {
fatal("Please specify cert and key file or cert and key file and CAFile or none of the three")
}
etcdTLSConfig, ok := tlsConfigFromInfo(argInfo.EtcdTLS)
if !ok {
fatal("Please specify cert and key file or cert and key file and CAFile or none of the three")
}
argInfo.Name = strings.TrimSpace(argInfo.Name)
if argInfo.Name == "" {
fatal("ERROR: server name required. e.g. '-n=server_name'")
}
argInfo.RaftURL = sanitizeURL(argInfo.RaftURL, raftTLSConfig.Scheme)
argInfo.EtcdURL = sanitizeURL(argInfo.EtcdURL, etcdTLSConfig.Scheme)
argInfo.WebURL = sanitizeURL(argInfo.WebURL, "http")
// Setup commands.
registerCommands()
// Read server info from file or grab it from user.
if err := os.MkdirAll(dirPath, 0744); err != nil {
fatalf("Unable to create path: %s", err)
}
info = getInfo(dirPath)
// Create etcd key-value store
etcdStore = store.CreateStore(maxSize)
startRaft(raftTLSConfig)
if argInfo.WebURL != "" {
// start web
argInfo.WebURL = sanitizeURL(argInfo.WebURL, "http")
go webHelper()
go web.Start(raftServer, argInfo.WebURL)
}
startEtcdTransport(*info, etcdTLSConfig.Scheme, etcdTLSConfig.Server)
}
// Start the raft server
func startRaft(tlsConfig TLSConfig) {
var err error
raftName := info.Name
// Create transporter for raft
raftTransporter = newTransporter(tlsConfig.Scheme, tlsConfig.Client)
// Create raft server
raftServer, err = raft.NewServer(raftName, dirPath, raftTransporter, etcdStore, nil)
if err != nil {
fatal(err)
}
// LoadSnapshot
if snapshot {
err = raftServer.LoadSnapshot()
if err == nil {
debugf("%s finished load snapshot", raftServer.Name())
} else {
debug(err)
panic(err)
}
}
raftServer.SetElectionTimeout(ELECTIONTIMEOUT)
raftServer.SetHeartbeatTimeout(HEARTBEATTIMEOUT)
raftServer.Start()
if raftServer.IsLogEmpty() {
// start as a leader in a new cluster
if len(cluster) == 0 {
time.Sleep(time.Millisecond * 20)
// leader need to join self as a peer
for {
command := &JoinCommand{
Name: raftServer.Name(),
RaftURL: argInfo.RaftURL,
EtcdURL: argInfo.EtcdURL,
}
_, err := raftServer.Do(command)
if err == nil {
break
}
}
debugf("%s start as a leader", raftServer.Name())
// start as a follower in a existing cluster
} else {
time.Sleep(time.Millisecond * 20)
for i := 0; i < retryTimes; i++ {
success := false
for _, machine := range cluster {
if len(machine) == 0 {
continue
}
err = joinCluster(raftServer, machine)
if err != nil {
if err.Error() == errors[103] {
fmt.Println(err)
os.Exit(1)
}
debugf("cannot join to cluster via machine %s %s", machine, err)
} else {
success = true
break
}
}
if success {
break
}
warnf("cannot join to cluster via given machines, retry in %d seconds", RETRYINTERVAL)
time.Sleep(time.Second * RETRYINTERVAL)
}
if err != nil {
fatalf("Cannot join the cluster via given machines after %x retries", retryTimes)
}
debugf("%s success join to the cluster", raftServer.Name())
}
} else {
// rejoin the previous cluster
debugf("%s restart as a follower", raftServer.Name())
}
// open the snapshot
if snapshot {
go raftServer.Snapshot()
}
// start to response to raft requests
go startRaftTransport(*info, tlsConfig.Scheme, tlsConfig.Server)
}
// Create transporter using by raft server
// Create http or https transporter based on
// whether the user give the server cert and key
func newTransporter(scheme string, tlsConf tls.Config) transporter {
t := transporter{}
t.scheme = scheme
tr := &http.Transport{
Dial: dialTimeout,
}
if scheme == "https" {
tr.TLSClientConfig = &tlsConf
tr.DisableCompression = true
}
t.client = &http.Client{Transport: tr}
return t
}
// Dial with timeout
func dialTimeout(network, addr string) (net.Conn, error) {
return net.DialTimeout(network, addr, HTTPTIMEOUT)
}
// Start to listen and response raft command
func startRaftTransport(info Info, scheme string, tlsConf tls.Config) {
u, _ := url.Parse(info.RaftURL)
fmt.Printf("raft server [%s] listening on %s\n", info.Name, u)
raftMux := http.NewServeMux()
server := &http.Server{
Handler: raftMux,
TLSConfig: &tlsConf,
Addr: u.Host,
}
// internal commands
raftMux.HandleFunc("/name", NameHttpHandler)
raftMux.HandleFunc("/join", JoinHttpHandler)
raftMux.HandleFunc("/vote", VoteHttpHandler)
raftMux.HandleFunc("/log", GetLogHttpHandler)
raftMux.HandleFunc("/log/append", AppendEntriesHttpHandler)
raftMux.HandleFunc("/snapshot", SnapshotHttpHandler)
raftMux.HandleFunc("/snapshotRecovery", SnapshotRecoveryHttpHandler)
raftMux.HandleFunc("/etcdURL", EtcdURLHttpHandler)
if scheme == "http" {
fatal(server.ListenAndServe())
} else {
fatal(server.ListenAndServeTLS(info.RaftTLS.CertFile, info.RaftTLS.KeyFile))
}
}
// Start to listen and response client command
func startEtcdTransport(info Info, scheme string, tlsConf tls.Config) {
u, _ := url.Parse(info.EtcdURL)
fmt.Printf("etcd server [%s] listening on %s\n", info.Name, u)
etcdMux := http.NewServeMux()
server := &http.Server{
Handler: etcdMux,
TLSConfig: &tlsConf,
Addr: u.Host,
}
// external commands
etcdMux.HandleFunc("/"+version+"/keys/", Multiplexer)
etcdMux.HandleFunc("/"+version+"/watch/", WatchHttpHandler)
etcdMux.HandleFunc("/leader", LeaderHttpHandler)
etcdMux.HandleFunc("/machines", MachinesHttpHandler)
etcdMux.HandleFunc("/", VersionHttpHandler)
etcdMux.HandleFunc("/stats", StatsHttpHandler)
etcdMux.HandleFunc("/test/", TestHttpHandler)
if scheme == "http" {
fatal(server.ListenAndServe())
} else {
fatal(server.ListenAndServeTLS(info.EtcdTLS.CertFile, info.EtcdTLS.KeyFile))
}
}
//--------------------------------------
// Config
//--------------------------------------
type TLSConfig struct {
Scheme string
Server tls.Config
Client tls.Config
}
func tlsConfigFromInfo(info TLSInfo) (t TLSConfig, ok bool) {
var keyFile, certFile, CAFile string
var tlsCert tls.Certificate
var err error
t.Scheme = "http"
keyFile = info.KeyFile
certFile = info.CertFile
CAFile = info.CAFile
// If the user do not specify key file, cert file and
// CA file, the type will be HTTP
if keyFile == "" && certFile == "" && CAFile == "" {
return t, true
}
// both the key and cert must be present
if keyFile == "" || certFile == "" {
return t, false
}
tlsCert, err = tls.LoadX509KeyPair(certFile, keyFile)
// Retrieve CORS configuration
corsInfo, err := ehttp.NewCORSInfo(config.CorsOrigins)
if err != nil {
fatal(err)
log.Fatal("CORS:", err)
}
t.Scheme = "https"
t.Server.ClientAuth, t.Server.ClientCAs = newCertPool(CAFile)
// Create etcd key-value store and registry.
store := store.New()
registry := server.NewRegistry(store)
// The client should trust the RootCA that the Server uses since
// everyone is a peer in the network.
t.Client.Certificates = []tls.Certificate{tlsCert}
t.Client.RootCAs = t.Server.ClientCAs
// Create stats objects
followersStats := server.NewRaftFollowersStats(config.Name)
serverStats := server.NewRaftServerStats(config.Name)
return t, true
}
// Calculate all of our timeouts
heartbeatTimeout := time.Duration(config.Peer.HeartbeatTimeout) * time.Millisecond
electionTimeout := time.Duration(config.Peer.ElectionTimeout) * time.Millisecond
dialTimeout := (3 * heartbeatTimeout) + electionTimeout
responseHeaderTimeout := (3 * heartbeatTimeout) + electionTimeout
func parseInfo(path string) *Info {
file, err := os.Open(path)
if err != nil {
return nil
// Create peer server
psConfig := server.PeerServerConfig{
Name: config.Name,
Scheme: config.PeerTLSInfo().Scheme(),
URL: config.Peer.Addr,
SnapshotCount: config.SnapshotCount,
MaxClusterSize: config.MaxClusterSize,
RetryTimes: config.MaxRetryAttempts,
RetryInterval: config.RetryInterval,
}
ps := server.NewPeerServer(psConfig, registry, store, &mb, followersStats, serverStats)
info := &Info{}
defer file.Close()
content, err := ioutil.ReadAll(file)
if err != nil {
fatalf("Unable to read info: %v", err)
return nil
}
if err = json.Unmarshal(content, &info); err != nil {
fatalf("Unable to parse info: %v", err)
return nil
}
return info
}
// Get the server info from previous conf file
// or from the user
func getInfo(path string) *Info {
// Read in the server info if available.
infoPath := fmt.Sprintf("%s/info", path)
// Delete the old configuration if exist
if force {
logPath := fmt.Sprintf("%s/log", path)
confPath := fmt.Sprintf("%s/conf", path)
snapshotPath := fmt.Sprintf("%s/snapshot", path)
os.Remove(infoPath)
os.Remove(logPath)
os.Remove(confPath)
os.RemoveAll(snapshotPath)
}
info := parseInfo(infoPath)
if info != nil {
fmt.Printf("Found node configuration in '%s'. Ignoring flags.\n", infoPath)
return info
}
info = &argInfo
// Write to file.
content, _ := json.MarshalIndent(info, "", " ")
content = []byte(string(content) + "\n")
if err := ioutil.WriteFile(infoPath, content, 0644); err != nil {
fatalf("Unable to write info to file: %v", err)
}
fmt.Printf("Wrote node configuration to '%s'.\n", infoPath)
return info
}
// Create client auth certpool
func newCertPool(CAFile string) (tls.ClientAuthType, *x509.CertPool) {
if CAFile == "" {
return tls.NoClientCert, nil
}
pemByte, _ := ioutil.ReadFile(CAFile)
block, pemByte := pem.Decode(pemByte)
cert, err := x509.ParseCertificate(block.Bytes)
if err != nil {
fatal(err)
}
certPool := x509.NewCertPool()
certPool.AddCert(cert)
return tls.RequireAndVerifyClientCert, certPool
}
// Send join requests to the leader.
func joinCluster(s *raft.Server, raftURL string) error {
var b bytes.Buffer
command := &JoinCommand{
Name: s.Name(),
RaftURL: info.RaftURL,
EtcdURL: info.EtcdURL,
}
json.NewEncoder(&b).Encode(command)
// t must be ok
t, ok := raftServer.Transporter().(transporter)
if !ok {
panic("wrong type")
}
joinURL := url.URL{Host: raftURL, Scheme: raftTransporter.scheme, Path: "/join"}
debugf("Send Join Request to %s", raftURL)
resp, err := t.Post(joinURL.String(), &b)
for {
var psListener net.Listener
if psConfig.Scheme == "https" {
peerServerTLSConfig, err := config.PeerTLSInfo().ServerConfig()
if err != nil {
return fmt.Errorf("Unable to join: %v", err)
}
if resp != nil {
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
return nil
}
if resp.StatusCode == http.StatusTemporaryRedirect {
address := resp.Header.Get("Location")
debugf("Send Join Request to %s", address)
json.NewEncoder(&b).Encode(command)
resp, err = t.Post(address, &b)
} else if resp.StatusCode == http.StatusBadRequest {
debug("Reach max number machines in the cluster")
return fmt.Errorf(errors[103])
} else {
return fmt.Errorf("Unable to join")
}
log.Fatal("peer server TLS error: ", err)
}
psListener, err = server.NewTLSListener(config.Peer.BindAddr, peerServerTLSConfig)
if err != nil {
log.Fatal("Failed to create peer listener: ", err)
}
} else {
psListener, err = server.NewListener(config.Peer.BindAddr)
if err != nil {
log.Fatal("Failed to create peer listener: ", err)
}
}
return fmt.Errorf("Unable to join: %v", err)
}
// Register commands to raft server
func registerCommands() {
raft.RegisterCommand(&JoinCommand{})
raft.RegisterCommand(&SetCommand{})
raft.RegisterCommand(&GetCommand{})
raft.RegisterCommand(&DeleteCommand{})
raft.RegisterCommand(&WatchCommand{})
raft.RegisterCommand(&TestAndSetCommand{})
// Create raft transporter and server
raftTransporter := server.NewTransporter(followersStats, serverStats, registry, heartbeatTimeout, dialTimeout, responseHeaderTimeout)
if psConfig.Scheme == "https" {
raftClientTLSConfig, err := config.PeerTLSInfo().ClientConfig()
if err != nil {
log.Fatal("raft client TLS error: ", err)
}
raftTransporter.SetTLSConfig(*raftClientTLSConfig)
}
raftServer, err := raft.NewServer(config.Name, config.DataDir, raftTransporter, store, ps, "")
if err != nil {
log.Fatal(err)
}
raftServer.SetElectionTimeout(electionTimeout)
raftServer.SetHeartbeatInterval(heartbeatTimeout)
ps.SetRaftServer(raftServer)
// Create etcd server
s := server.New(config.Name, config.Addr, ps, registry, store, &mb)
if config.Trace() {
s.EnableTracing()
}
var sListener net.Listener
if config.EtcdTLSInfo().Scheme() == "https" {
etcdServerTLSConfig, err := config.EtcdTLSInfo().ServerConfig()
if err != nil {
log.Fatal("etcd TLS error: ", err)
}
sListener, err = server.NewTLSListener(config.BindAddr, etcdServerTLSConfig)
if err != nil {
log.Fatal("Failed to create TLS etcd listener: ", err)
}
} else {
sListener, err = server.NewListener(config.BindAddr)
if err != nil {
log.Fatal("Failed to create etcd listener: ", err)
}
}
ps.SetServer(s)
ps.Start(config.Snapshot, config.Peers)
go func() {
log.Infof("peer server [name %s, listen on %s, advertised url %s]", ps.Config.Name, psListener.Addr(), ps.Config.URL)
sHTTP := &ehttp.CORSHandler{ps.HTTPHandler(), corsInfo}
log.Fatal(http.Serve(psListener, sHTTP))
}()
log.Infof("etcd server [name %s, listen on %s, advertised url %s]", s.Name, sListener.Addr(), s.URL())
sHTTP := &ehttp.CORSHandler{s.HTTPHandler(), corsInfo}
log.Fatal(http.Serve(sListener, sHTTP))
}

View File

@ -1,355 +0,0 @@
package main
import (
"fmt"
"github.com/coreos/etcd/store"
"net/http"
"strconv"
"time"
)
//-------------------------------------------------------------------
// Handlers to handle etcd-store related request via etcd url
//-------------------------------------------------------------------
// Multiplex GET/POST/DELETE request to corresponding handlers
func Multiplexer(w http.ResponseWriter, req *http.Request) {
switch req.Method {
case "GET":
GetHttpHandler(&w, req)
case "POST":
SetHttpHandler(&w, req)
case "DELETE":
DeleteHttpHandler(&w, req)
default:
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
}
//--------------------------------------
// State sensitive handlers
// Set/Delete will dispatch to leader
//--------------------------------------
// Set Command Handler
func SetHttpHandler(w *http.ResponseWriter, req *http.Request) {
key := req.URL.Path[len("/v1/keys/"):]
if store.CheckKeyword(key) {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(400, "Set"))
return
}
debugf("[recv] POST %v/v1/keys/%s", raftServer.Name(), key)
value := req.FormValue("value")
if len(value) == 0 {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(200, "Set"))
return
}
prevValue := req.FormValue("prevValue")
strDuration := req.FormValue("ttl")
expireTime, err := durationToExpireTime(strDuration)
if err != nil {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(202, "Set"))
return
}
if len(prevValue) != 0 {
command := &TestAndSetCommand{
Key: key,
Value: value,
PrevValue: prevValue,
ExpireTime: expireTime,
}
dispatch(command, w, req, true)
} else {
command := &SetCommand{
Key: key,
Value: value,
ExpireTime: expireTime,
}
dispatch(command, w, req, true)
}
}
// Delete Handler
func DeleteHttpHandler(w *http.ResponseWriter, req *http.Request) {
key := req.URL.Path[len("/v1/keys/"):]
debugf("[recv] DELETE %v/v1/keys/%s", raftServer.Name(), key)
command := &DeleteCommand{
Key: key,
}
dispatch(command, w, req, true)
}
// Dispatch the command to leader
func dispatch(c Command, w *http.ResponseWriter, req *http.Request, etcd bool) {
if raftServer.State() == "leader" {
if body, err := raftServer.Do(c); err != nil {
if _, ok := err.(store.NotFoundError); ok {
(*w).WriteHeader(http.StatusNotFound)
(*w).Write(newJsonError(100, err.Error()))
return
}
if _, ok := err.(store.TestFail); ok {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(101, err.Error()))
return
}
if _, ok := err.(store.NotFile); ok {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(102, err.Error()))
return
}
if err.Error() == errors[103] {
(*w).WriteHeader(http.StatusBadRequest)
(*w).Write(newJsonError(103, ""))
return
}
(*w).WriteHeader(http.StatusInternalServerError)
(*w).Write(newJsonError(300, err.Error()))
return
} else {
if body == nil {
(*w).WriteHeader(http.StatusNotFound)
(*w).Write(newJsonError(300, "Empty result from raft"))
} else {
body, ok := body.([]byte)
// this should not happen
if !ok {
panic("wrong type")
}
(*w).WriteHeader(http.StatusOK)
(*w).Write(body)
}
return
}
} else {
// current no leader
if raftServer.Leader() == "" {
(*w).WriteHeader(http.StatusInternalServerError)
(*w).Write(newJsonError(300, ""))
return
}
// tell the client where is the leader
path := req.URL.Path
var scheme string
if scheme = req.URL.Scheme; scheme == "" {
scheme = "http://"
}
var url string
if etcd {
etcdAddr, _ := nameToEtcdURL(raftServer.Leader())
url = etcdAddr + path
} else {
raftAddr, _ := nameToRaftURL(raftServer.Leader())
url = raftAddr + path
}
debugf("Redirect to %s", url)
http.Redirect(*w, req, url, http.StatusTemporaryRedirect)
return
}
(*w).WriteHeader(http.StatusInternalServerError)
(*w).Write(newJsonError(300, ""))
return
}
//--------------------------------------
// State non-sensitive handlers
// will not dispatch to leader
// TODO: add sensitive version for these
// command?
//--------------------------------------
// Handler to return the current leader's raft address
func LeaderHttpHandler(w http.ResponseWriter, req *http.Request) {
leader := raftServer.Leader()
if leader != "" {
w.WriteHeader(http.StatusOK)
raftURL, _ := nameToRaftURL(leader)
w.Write([]byte(raftURL))
} else {
// not likely, but it may happen
w.WriteHeader(http.StatusInternalServerError)
w.Write(newJsonError(301, ""))
}
}
// Handler to return all the known machines in the current cluster
func MachinesHttpHandler(w http.ResponseWriter, req *http.Request) {
peers := raftServer.Peers()
// Add itself to the machine list first
// Since peer map does not contain the server itself
machines, _ := getEtcdURL(raftServer.Name())
// Add all peers to the list and separate by comma
// We do not use json here since we accept machines list
// in the command line separate by comma.
for peerName, _ := range peers {
if addr, ok := getEtcdURL(peerName); ok {
machines = machines + "," + addr
}
}
w.WriteHeader(http.StatusOK)
w.Write([]byte(machines))
}
// Handler to return the current version of etcd
func VersionHttpHandler(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte(fmt.Sprintf("etcd %s", releaseVersion)))
}
// Handler to return the basic stats of etcd
func StatsHttpHandler(w http.ResponseWriter, req *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write(etcdStore.Stats())
}
// Get Handler
func GetHttpHandler(w *http.ResponseWriter, req *http.Request) {
key := req.URL.Path[len("/v1/keys/"):]
debugf("[recv] GET http://%v/v1/keys/%s", raftServer.Name(), key)
command := &GetCommand{
Key: key,
}
if body, err := command.Apply(raftServer); err != nil {
if _, ok := err.(store.NotFoundError); ok {
(*w).WriteHeader(http.StatusNotFound)
(*w).Write(newJsonError(100, err.Error()))
return
}
(*w).WriteHeader(http.StatusInternalServerError)
(*w).Write(newJsonError(300, ""))
} else {
body, ok := body.([]byte)
if !ok {
panic("wrong type")
}
(*w).WriteHeader(http.StatusOK)
(*w).Write(body)
}
}
// Watch handler
func WatchHttpHandler(w http.ResponseWriter, req *http.Request) {
key := req.URL.Path[len("/v1/watch/"):]
command := &WatchCommand{
Key: key,
}
if req.Method == "GET" {
debugf("[recv] GET http://%v/watch/%s", raftServer.Name(), key)
command.SinceIndex = 0
} else if req.Method == "POST" {
// watch from a specific index
debugf("[recv] POST http://%v/watch/%s", raftServer.Name(), key)
content := req.FormValue("index")
sinceIndex, err := strconv.ParseUint(string(content), 10, 64)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
w.Write(newJsonError(203, "Watch From Index"))
}
command.SinceIndex = sinceIndex
} else {
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
if body, err := command.Apply(raftServer); err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write(newJsonError(500, key))
} else {
w.WriteHeader(http.StatusOK)
body, ok := body.([]byte)
if !ok {
panic("wrong type")
}
w.Write(body)
}
}
// TestHandler
func TestHttpHandler(w http.ResponseWriter, req *http.Request) {
testType := req.URL.Path[len("/test/"):]
if testType == "speed" {
directSet()
w.WriteHeader(http.StatusOK)
w.Write([]byte("speed test success"))
return
}
w.WriteHeader(http.StatusBadRequest)
}
// Convert string duration to time format
func durationToExpireTime(strDuration string) (time.Time, error) {
if strDuration != "" {
duration, err := strconv.Atoi(strDuration)
if err != nil {
return time.Unix(0, 0), err
}
return time.Now().Add(time.Second * (time.Duration)(duration)), nil
} else {
return time.Unix(0, 0), nil
}
}

View File

@ -1,150 +0,0 @@
package main
import (
"fmt"
"math/rand"
"net/http"
"os"
"strconv"
"strings"
"testing"
"time"
)
// This test will kill the current leader and wait for the etcd cluster to elect a new leader for 200 times.
// It will print out the election time and the average election time.
func TestKillLeader(t *testing.T) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
clusterSize := 5
argGroup, etcds, err := createCluster(clusterSize, procAttr, false)
if err != nil {
t.Fatal("cannot create cluster")
}
defer destroyCluster(etcds)
leaderChan := make(chan string, 1)
time.Sleep(time.Second)
go leaderMonitor(clusterSize, 1, leaderChan)
var totalTime time.Duration
leader := "http://127.0.0.1:7001"
for i := 0; i < clusterSize; i++ {
fmt.Println("leader is ", leader)
port, _ := strconv.Atoi(strings.Split(leader, ":")[2])
num := port - 7001
fmt.Println("kill server ", num)
etcds[num].Kill()
etcds[num].Release()
start := time.Now()
for {
newLeader := <-leaderChan
if newLeader != leader {
leader = newLeader
break
}
}
take := time.Now().Sub(start)
totalTime += take
avgTime := totalTime / (time.Duration)(i+1)
fmt.Println("Leader election time is ", take, "with election timeout", ELECTIONTIMEOUT)
fmt.Println("Leader election time average is", avgTime, "with election timeout", ELECTIONTIMEOUT)
etcds[num], err = os.StartProcess("etcd", argGroup[num], procAttr)
}
}
// TestKillRandom kills random machines in the cluster and
// restart them after all other machines agree on the same leader
func TestKillRandom(t *testing.T) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
clusterSize := 9
argGroup, etcds, err := createCluster(clusterSize, procAttr, false)
if err != nil {
t.Fatal("cannot create cluster")
}
defer destroyCluster(etcds)
leaderChan := make(chan string, 1)
time.Sleep(3 * time.Second)
go leaderMonitor(clusterSize, 4, leaderChan)
toKill := make(map[int]bool)
for i := 0; i < 20; i++ {
fmt.Printf("TestKillRandom Round[%d/20]\n", i)
j := 0
for {
r := rand.Int31n(9)
if _, ok := toKill[int(r)]; !ok {
j++
toKill[int(r)] = true
}
if j > 3 {
break
}
}
for num, _ := range toKill {
etcds[num].Kill()
etcds[num].Release()
}
<-leaderChan
for num, _ := range toKill {
etcds[num], err = os.StartProcess("etcd", argGroup[num], procAttr)
}
toKill = make(map[int]bool)
}
<-leaderChan
}
func templateBenchmarkEtcdDirectCall(b *testing.B, tls bool) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
clusterSize := 3
_, etcds, _ := createCluster(clusterSize, procAttr, tls)
defer destroyCluster(etcds)
time.Sleep(time.Second)
b.ResetTimer()
for i := 0; i < b.N; i++ {
resp, _ := http.Get("http://127.0.0.1:4001/test/speed")
resp.Body.Close()
}
}
func BenchmarkEtcdDirectCall(b *testing.B) {
templateBenchmarkEtcdDirectCall(b, false)
}
func BenchmarkEtcdDirectCallTls(b *testing.B) {
templateBenchmarkEtcdDirectCall(b, true)
}

View File

@ -1,209 +0,0 @@
package main
import (
"fmt"
"github.com/coreos/go-etcd/etcd"
"math/rand"
"os"
//"strconv"
"testing"
"time"
)
// Create a single node and try to set value
func TestSingleNode(t *testing.T) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
args := []string{"etcd", "-n=node1", "-f", "-d=/tmp/node1"}
process, err := os.StartProcess("etcd", args, procAttr)
if err != nil {
t.Fatal("start process failed:" + err.Error())
return
}
defer process.Kill()
time.Sleep(time.Second)
c := etcd.NewClient()
c.SyncCluster()
// Test Set
result, err := c.Set("foo", "bar", 100)
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.TTL != 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Set 1 failed with %s %s %v", result.Key, result.Value, result.TTL)
}
time.Sleep(time.Second)
result, err = c.Set("foo", "bar", 100)
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.PrevValue != "bar" || result.TTL != 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Set 2 failed with %s %s %v", result.Key, result.Value, result.TTL)
}
}
// This test creates a single node and then set a value to it.
// Then this test kills the node and restart it and tries to get the value again.
func TestSingleNodeRecovery(t *testing.T) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
args := []string{"etcd", "-n=node1", "-d=/tmp/node1"}
process, err := os.StartProcess("etcd", append(args, "-f"), procAttr)
if err != nil {
t.Fatal("start process failed:" + err.Error())
return
}
time.Sleep(time.Second)
c := etcd.NewClient()
c.SyncCluster()
// Test Set
result, err := c.Set("foo", "bar", 100)
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.TTL != 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Set 1 failed with %s %s %v", result.Key, result.Value, result.TTL)
}
time.Sleep(time.Second)
process.Kill()
process, err = os.StartProcess("etcd", args, procAttr)
defer process.Kill()
if err != nil {
t.Fatal("start process failed:" + err.Error())
return
}
time.Sleep(time.Second)
results, err := c.Get("foo")
if err != nil {
t.Fatal("get fail: " + err.Error())
return
}
result = results[0]
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.TTL > 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Recovery Get failed with %s %s %v", result.Key, result.Value, result.TTL)
}
}
// Create a three nodes and try to set value
func templateTestSimpleMultiNode(t *testing.T, tls bool) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
clusterSize := 3
_, etcds, err := createCluster(clusterSize, procAttr, tls)
if err != nil {
t.Fatal("cannot create cluster")
}
defer destroyCluster(etcds)
time.Sleep(time.Second)
c := etcd.NewClient()
c.SyncCluster()
// Test Set
result, err := c.Set("foo", "bar", 100)
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.TTL != 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Set 1 failed with %s %s %v", result.Key, result.Value, result.TTL)
}
time.Sleep(time.Second)
result, err = c.Set("foo", "bar", 100)
if err != nil || result.Key != "/foo" || result.Value != "bar" || result.PrevValue != "bar" || result.TTL != 99 {
if err != nil {
t.Fatal(err)
}
t.Fatalf("Set 2 failed with %s %s %v", result.Key, result.Value, result.TTL)
}
}
func TestSimpleMultiNode(t *testing.T) {
templateTestSimpleMultiNode(t, false)
}
func TestSimpleMultiNodeTls(t *testing.T) {
templateTestSimpleMultiNode(t, true)
}
// Create a five nodes
// Randomly kill one of the node and keep on sending set command to the cluster
func TestMultiNodeRecovery(t *testing.T) {
procAttr := new(os.ProcAttr)
procAttr.Files = []*os.File{nil, os.Stdout, os.Stderr}
clusterSize := 5
argGroup, etcds, err := createCluster(clusterSize, procAttr, false)
if err != nil {
t.Fatal("cannot create cluster")
}
defer destroyCluster(etcds)
time.Sleep(2 * time.Second)
c := etcd.NewClient()
c.SyncCluster()
stop := make(chan bool)
// Test Set
go set(stop)
for i := 0; i < 10; i++ {
num := rand.Int() % clusterSize
fmt.Println("kill node", num+1)
// kill
etcds[num].Kill()
etcds[num].Release()
time.Sleep(time.Second)
// restart
etcds[num], err = os.StartProcess("etcd", argGroup[num], procAttr)
if err != nil {
panic(err)
}
time.Sleep(time.Second)
}
fmt.Println("stop")
stop <- true
<-stop
}

View File

@ -1,8 +1,10 @@
Testing x509 certs for luacrypto
Testing x509 certs for etcd
The passphrases for the keys are `asdf`.
# Make the CA cert
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -extfile openssl.cnf -extensions v3_ca
openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config openssl.cnf -extensions v3_ca
# Make server cert and signing request
openssl genrsa -des3 -out server.key 4096
@ -16,3 +18,4 @@ openssl rsa -in server.key -out server.key.insecure
# Output "raw" public key from server crt
openssl x509 -pubkey -noout -in server.crt > server.pub

View File

@ -1,31 +1,31 @@
-----BEGIN CERTIFICATE-----
MIIFajCCA1KgAwIBAgIJAL6GUooGHc/oMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
MIIFajCCA1KgAwIBAgIJAKMtnrbM5eQaMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX
aWRnaXRzIFB0eSBMdGQwHhcNMTMwODExMDUxMTI0WhcNMTQwODExMDUxMTI0WjBF
aWRnaXRzIFB0eSBMdGQwHhcNMTMxMTEzMTkwNzMwWhcNMTQxMTEzMTkwNzMwWjBF
MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50
ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
CgKCAgEAyAJNWQmsBtTBPv/jSjFk+EqCZM9zLcnS9P7bg8snLu1RaDS0NA8RjQFm
1fw+fAoNyOJ5X4FdEep6piMcVaYa/xGgls3DVkUytOvJ0BcdUJgrcyH0CDodDhu4
T/qi1W7I+y3gbjr+VyyBdOSQuybyun9RwRrktcfVDfObaA0AmLt1PtJzMI+tB2As
XRgxPfFLETUTy9nIQc3PQxs11sWeEzvxcVrO595XsumPYZZAan86KNrQzES4r61R
0pOGAIEEfyvT2uU5y7fnFNtRr2xxjdgUj2/ghJX6M49BnYp4edyQuyNQp+weSA6c
3ueTu98gin1vxzMaVJJIaRRerKzekCerXLq3YsFzS7HFzMaR201faPw45b7K83bh
/DJ2wcc8JhyrhnOBM76jCnug4FReiETnCyUAc7fP+iCOCpgCzYky7wi8Jc+MTXWG
RIvpfmcB326gUdyG8n/yvIc95E6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qKwWfqvj8JQNYVmKdDVsoax36glVaj4qHZojul9eWS6SdDOo6a5t/xf0kP
Upxi87dqS4H7qfa6HTVFQhqRL8JuPqTs4csojA6XJt+yYzTfs8Gf3MAyQznuwiWh
E7kIv9lYH5APLW5LXNLizTaZtBS826f05TgBsYuYj3mGeSsr/llP4zb8u7qxL+B3
0Q6OLK3JtPbwtaHCBxs70HOQzjWjiEF6PE3f1MhvXFjMQmQEgGzCuK69EEUWK2s0
cIjoTLJxmQ+voWPms39gjstNLeykAygsyaYryGks/YjgchRrTtrOxUCows8knkmB
lve7RC9xW7yQwmWacPq0ndJUL0smdsWODx+L3J0R/YmbjYIO5N8i9YFqSwFLIC2v
ghirHq7EqZbYAaDxS6KvpeVh+f0pC8AC63FLbsp9+SOayoEQJ/gB8f+s3cxV+rNQ
/Z6077QuDgb1gpjCWCHHjMMELtjvy+HNUmgiRfv6a+mtWOS8g5Ii3OUYFVr2kQ==
-----END CERTIFICATE-----

View File

@ -1,54 +1,54 @@
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,90DB77765661F24C
DEK-Info: DES-EDE3-CBC,5AD5C95753A0AE70
f0pCWQG7S6EdHqlN0tHfpowMyEFR/WYtQTjYws93+2MBcEDa9fqecN1mqNkskWsA
As1HVdp6o357bJ3VtoFHBRvv4iql6xutkZV8NoVAQseLjjZkYGFbIJ8Dv/O6xnXy
XDqm3WopCQB9hLKjORcwJN3Q9SRKmmRCxkndVcNkCjoY/TdN1jPEmQqtfWfmLy5S
GVmTHmoTPVvJh34mvkUsLrNkQ6XOrIisz93zmFO0VpskvxUmE2lOdLzTALbz2MZP
TJalI2zZSfoU6ZaF8eUG8DA5+3PknGNSRP4ivbA0CYkYn0Wssatf6+YUg1kMJ5+B
nPhh1tTeeE9bMaTEmcrJiDQFqn+EBmzXBzLDxYsUIEzCzcc4bPbvuHpZSThXFTQa
D6bakKXYW/bmO190o3XxpfQkLqzRQLWhURqjx57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4MaL2Q
jf0GtWuPwuD2ZOV8lDL8klINUgyWL+WeRt+M2WwLeaJEuZhjGootkkfmicSshH5c
JMnejiRWTpAzLehHQs9ZbP9yzg+tc1WiwvqOXi1NM7KpYALh20MaUMSVIW6Lvwq5
JAIo772x6lW9IVcTxajfYtlZDW9qGD/4n95qBvDqtqSX665UmB+Kfskf5sWyIEKQ
4A3i/RAXclhyEwgF5fBDMSr8ek3vcSzbA8a7KCUHQ4aTGm6dnQHtsAlI5Aww0vs2
QYi7oc2o5G3YXNfKmJdogxQJVwi+9/ZWoYGlQt77h90u9twej8XozOabF8M0zC8F
vU/7Wc84pzvykpY7aao36E653FNt3MCJhRG2MinqjITO+Xcd2B/dRRWYFB7qM/D0
KbXtzvLnyJw91ERGjEJJ2E5/BgW6Wz996c/AGExnnf5xFgZ4/Z/dNPpwzNwRSTPZ
khlrhdmnQkKjHXJDHLy+uZZ8uj2yCGoTaJEZapEp7GGvsgwi/1DbAvmpwZpfXADW
A4x+m6rJJvrOnwui5URcAgj1F+JEW6d2piMmO1mDayiyNEkRpv3jB/Au713SUpm0
0GQCHrmrTb5izgCH3ggS75kCAwEAAQ==
-----END PUBLIC KEY-----

3
go_version.go Normal file
View File

@ -0,0 +1,3 @@
// +build !go1.2
"etcd requires go 1.2 or greater to build"

75
http/cors.go Normal file
View File

@ -0,0 +1,75 @@
/*
Copyright 2013 CoreOS Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package http
import (
"fmt"
"net/http"
"net/url"
)
type CORSInfo map[string]bool
func NewCORSInfo(origins []string) (*CORSInfo, error) {
// Construct a lookup of all origins.
m := make(map[string]bool)
for _, v := range origins {
if v != "*" {
if _, err := url.Parse(v); err != nil {
return nil, fmt.Errorf("Invalid CORS origin: %s", err)
}
}
m[v] = true
}
info := CORSInfo(m)
return &info, nil
}
// OriginAllowed determines whether the server will allow a given CORS origin.
func (c CORSInfo) OriginAllowed(origin string) bool {
return c["*"] || c[origin]
}
type CORSHandler struct {
Handler http.Handler
Info *CORSInfo
}
// addHeader adds the correct cors headers given an origin
func (h *CORSHandler) addHeader(w http.ResponseWriter, origin string) {
w.Header().Add("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
w.Header().Add("Access-Control-Allow-Origin", origin)
}
// ServeHTTP adds the correct CORS headers based on the origin and returns immediatly
// with a 200 OK if the method is OPTIONS.
func (h *CORSHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// Write CORS header.
if h.Info.OriginAllowed("*") {
h.addHeader(w, "*")
} else if origin := req.Header.Get("Origin"); h.Info.OriginAllowed(origin) {
h.addHeader(w, origin)
}
if req.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
h.Handler.ServeHTTP(w, req)
}

36
http/query_params.go Normal file
View File

@ -0,0 +1,36 @@
package http
import (
"net/http"
"strings"
)
func NewLowerQueryParamsHandler(hdlr http.Handler) *LowerQueryParamsHandler {
return &LowerQueryParamsHandler{hdlr}
}
type LowerQueryParamsHandler struct {
Handler http.Handler
}
func (h *LowerQueryParamsHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
err := req.ParseForm()
if err == nil {
lowerBoolQueryParams(req)
}
h.Handler.ServeHTTP(w, req)
}
func lowerBoolQueryParams(req *http.Request) {
form := req.Form
for key, vals := range form {
for i, val := range vals {
lowered := strings.ToLower(val)
if lowered == "true" || lowered == "false" {
req.Form[key][i] = lowered
} else {
req.Form[key][i] = val
}
}
}
}

46
http/query_params_test.go Normal file
View File

@ -0,0 +1,46 @@
package http
import (
"net/http"
"testing"
)
type NilResponseWriter struct{}
func (w NilResponseWriter) Header() http.Header {
return http.Header{}
}
func (w NilResponseWriter) Write(data []byte) (int, error) {
return 0, nil
}
func (w NilResponseWriter) WriteHeader(code int) {
return
}
type FunctionHandler struct {
f func(*http.Request)
}
func (h FunctionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.f(r)
}
func TestQueryParamsLowered(t *testing.T) {
assertFunc := func(req *http.Request) {
if len(req.Form["One"]) != 1 || req.Form["One"][0] != "true" {
t.Errorf("Unexpected value for One: %s", req.Form["One"])
} else if len(req.Form["TWO"]) != 1 || req.Form["TWO"][0] != "false" {
t.Errorf("Unexpected value for TWO")
} else if len(req.Form["three"]) != 2 || req.Form["three"][0] != "true" || req.Form["three"][1] != "false" {
t.Errorf("Unexpected value for three")
}
}
assertHdlr := FunctionHandler{assertFunc}
hdlr := NewLowerQueryParamsHandler(assertHdlr)
respWriter := NilResponseWriter{}
req, _ := http.NewRequest("GET", "http://example.com?One=TRUE&TWO=False&three=true&three=FALSE", nil)
hdlr.ServeHTTP(respWriter, req)
}

44
log/log.go Normal file
View File

@ -0,0 +1,44 @@
package log
import (
golog "github.com/coreos/etcd/third_party/github.com/coreos/go-log/log"
"os"
)
// The Verbose flag turns on verbose logging.
var Verbose bool = false
var logger *golog.Logger = golog.New("etcd", false,
golog.CombinedSink(os.Stdout, "[%s] %s %-9s | %s\n", []string{"prefix", "time", "priority", "message"}))
func Infof(format string, v ...interface{}) {
logger.Infof(format, v...)
}
func Debugf(format string, v ...interface{}) {
if Verbose {
logger.Debugf(format, v...)
}
}
func Debug(v ...interface{}) {
if Verbose {
logger.Debug(v...)
}
}
func Warnf(format string, v ...interface{}) {
logger.Warningf(format, v...)
}
func Warn(v ...interface{}) {
logger.Warning(v...)
}
func Fatalf(format string, v ...interface{}) {
logger.Fatalf(format, v...)
}
func Fatal(v ...interface{}) {
logger.Fatalln(v...)
}

View File

@ -1,27 +0,0 @@
package main
import (
"net/url"
"path"
)
func getEtcdURL(name string) (string, bool) {
resps, _ := etcdStore.RawGet(path.Join("_etcd/machines", name))
m, err := url.ParseQuery(resps[0].Value)
if err != nil {
panic("Failed to parse machines entry")
}
addr := m["etcd"][0]
return addr, true
}
// machineNum returns the number of machines in the cluster
func machineNum() int {
response, _ := etcdStore.RawGet("_etcd/machines")
return len(response)
}

42
metrics/metrics.go Normal file
View File

@ -0,0 +1,42 @@
// Package metrics provides both a means of generating metrics and the ability
// to send metric data to a graphite endpoint.
// The usage of this package without providing a graphite_addr when calling
// NewBucket results in NOP metric objects. No data will be collected.
package metrics
import (
"io"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)
type Timer gometrics.Timer
type Gauge gometrics.Gauge
type Bucket interface {
// If a timer exists in this Bucket, return it. Otherwise, create
// a new timer with the given name and store it in this Bucket.
// The returned object will fulfull the Timer interface.
Timer(name string) Timer
// This acts similarly to Timer, but with objects that fufill the
// Gauge interface.
Gauge(name string) Gauge
// Write the current state of all Metrics in a human-readable format
// to the provide io.Writer.
Dump(io.Writer)
// Instruct the Bucket to periodically push all metric data to the
// provided graphite endpoint.
Publish(string) error
}
// Create a new Bucket object that periodically
func NewBucket(name string) Bucket {
if name == "" {
return nilBucket{}
}
return newStandardBucket(name)
}

25
metrics/nil.go Normal file
View File

@ -0,0 +1,25 @@
package metrics
import (
"io"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)
type nilBucket struct{}
func (nmb nilBucket) Dump(w io.Writer) {
return
}
func (nmb nilBucket) Timer(name string) Timer {
return gometrics.NilTimer{}
}
func (nmf nilBucket) Gauge(name string) Gauge {
return gometrics.NilGauge{}
}
func (nmf nilBucket) Publish(string) error {
return nil
}

86
metrics/standard.go Normal file
View File

@ -0,0 +1,86 @@
package metrics
import (
"io"
"net"
"sync"
"time"
gometrics "github.com/coreos/etcd/third_party/github.com/rcrowley/go-metrics"
)
const (
// RuntimeMemStatsSampleInterval is the interval in seconds at which the
// Go runtime's memory statistics will be gathered.
RuntimeMemStatsSampleInterval = time.Duration(2) * time.Second
// GraphitePublishInterval is the interval in seconds at which all
// gathered statistics will be published to a Graphite endpoint.
GraphitePublishInterval = time.Duration(2) * time.Second
)
type standardBucket struct {
sync.Mutex
name string
registry gometrics.Registry
timers map[string]Timer
gauges map[string]Gauge
}
func newStandardBucket(name string) standardBucket {
registry := gometrics.NewRegistry()
gometrics.RegisterRuntimeMemStats(registry)
go gometrics.CaptureRuntimeMemStats(registry, RuntimeMemStatsSampleInterval)
return standardBucket{
name: name,
registry: registry,
timers: make(map[string]Timer),
gauges: make(map[string]Gauge),
}
}
func (smb standardBucket) Dump(w io.Writer) {
gometrics.WriteOnce(smb.registry, w)
return
}
func (smb standardBucket) Timer(name string) Timer {
smb.Lock()
defer smb.Unlock()
timer, ok := smb.timers[name]
if !ok {
timer = gometrics.NewTimer()
smb.timers[name] = timer
smb.registry.Register(name, timer)
}
return timer
}
func (smb standardBucket) Gauge(name string) Gauge {
smb.Lock()
defer smb.Unlock()
gauge, ok := smb.gauges[name]
if !ok {
gauge = gometrics.NewGauge()
smb.gauges[name] = gauge
smb.registry.Register(name, gauge)
}
return gauge
}
func (smb standardBucket) Publish(graphite_addr string) error {
addr, err := net.ResolveTCPAddr("tcp", graphite_addr)
if err != nil {
return err
}
go gometrics.Graphite(smb.registry, GraphitePublishInterval, smb.name, addr)
return nil
}

10
mod/README.md Normal file
View File

@ -0,0 +1,10 @@
## Etcd modules
etcd modules (mods) are higher order pieces of functionality that only
speak to the client etcd API and are presented in the `/mod` HTTP path
of the etcd service.
The basic idea is that etcd can ship things like dashboards, master
election APIs and other helpful services that would normally have to
stand up and talk to an etcd cluster directly in the binary. It is a
convienence and hopefully eases complexity in deployments.

3
mod/dashboard/.bowerrc Normal file
View File

@ -0,0 +1,3 @@
{
"directory": "app/bower_components"
}

View File

@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
indent_size = 2
# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false

1
mod/dashboard/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=auto

6
mod/dashboard/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
node_modules
dist
.tmp
.sass-cache
app/bower_components
/go-bindata

View File

@ -0,0 +1,3 @@
app/scripts/vega.js
app/scripts/moment.min.js
app/scripts/ng-time-relative.min.js

27
mod/dashboard/.jshintrc Normal file
View File

@ -0,0 +1,27 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": false,
"strict": true,
"trailing": true,
"smarttabs": true,
"globals": {
"angular": false,
"$": false,
"vg": false,
"moment": false
}
}

View File

@ -0,0 +1,7 @@
language: node_js
node_js:
- '0.8'
- '0.10'
before_script:
- 'npm install -g bower grunt-cli'
- 'bower install'

355
mod/dashboard/Gruntfile.js Normal file
View File

@ -0,0 +1,355 @@
// Generated on 2013-10-07 using generator-webapp 0.4.3
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
// configurable paths
uglify: {
options: {
mangle: false
},
},
yeoman: {
app: 'app',
dist: 'dist'
},
watch: {
compass: {
files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
tasks: ['compass:server', 'autoprefixer']
},
styles: {
files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
tasks: ['copy:styles', 'autoprefixer']
},
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= yeoman.app %>/*.html',
'.tmp/styles/{,*/}*.css',
'{.tmp,<%= yeoman.app %>}/scripts/{,*/}*.js',
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
]
}
},
connect: {
options: {
port: 9000,
livereload: 35729,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= yeoman.app %>'
]
}
},
test: {
options: {
base: [
'.tmp',
'test',
'<%= yeoman.app %>'
]
}
},
dist: {
options: {
open: true,
base: '<%= yeoman.dist %>'
}
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'.tmp',
'<%= yeoman.dist %>/*',
'!<%= yeoman.dist %>/.git*'
]
}]
},
server: '.tmp'
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'<%= yeoman.app %>/scripts/{,*/}*.js',
'!<%= yeoman.app %>/scripts/vendor/*',
]
},
mocha: {
all: {
options: {
run: true,
urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
}
}
},
compass: {
options: {
sassDir: '<%= yeoman.app %>/styles',
cssDir: '.tmp/styles',
generatedImagesDir: '.tmp/images/generated',
imagesDir: '<%= yeoman.app %>/images',
javascriptsDir: '<%= yeoman.app %>/scripts',
fontsDir: '<%= yeoman.app %>/styles/fonts',
importPath: '<%= yeoman.app %>/bower_components',
httpImagesPath: '/images',
httpGeneratedImagesPath: '/images/generated',
httpFontsPath: '/styles/fonts',
relativeAssets: false,
assetCacheBuster: false
},
dist: {
options: {
generatedImagesDir: '<%= yeoman.dist %>/images/generated'
}
},
server: {
options: {
debugInfo: true
}
}
},
autoprefixer: {
options: {
browsers: ['last 1 version']
},
dist: {
files: [{
expand: true,
cwd: '.tmp/styles/',
src: '{,*/}*.css',
dest: '.tmp/styles/'
}]
}
},
// not used since Uglify task does concat,
// but still available if needed
/*concat: {
dist: {}
},*/
requirejs: {
dist: {
// Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js
options: {
// `name` and `out` is set by grunt-usemin
baseUrl: '<%= yeoman.app %>/scripts',
optimize: 'none',
// TODO: Figure out how to make sourcemaps work with grunt-usemin
// https://github.com/yeoman/grunt-usemin/issues/30
//generateSourceMaps: true,
// required to support SourceMaps
// http://requirejs.org/docs/errors.html#sourcemapcomments
preserveLicenseComments: false,
useStrict: true,
wrap: true
//uglify2: {} // https://github.com/mishoo/UglifyJS2
}
}
},
useminPrepare: {
options: {
dest: '<%= yeoman.dist %>'
},
html: ['<%= yeoman.app %>/index.html']
},
usemin: {
options: {
dirs: ['<%= yeoman.dist %>']
},
html: ['<%= yeoman.dist %>/{,*/}*.html'],
css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
},
imagemin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.{png,jpg,jpeg}',
dest: '<%= yeoman.dist %>/images'
}]
}
},
svgmin: {
dist: {
files: [{
expand: true,
cwd: '<%= yeoman.app %>/images',
src: '{,*/}*.svg',
dest: '<%= yeoman.dist %>/images'
}]
}
},
cssmin: {
// This task is pre-configured if you do not wish to use Usemin
// blocks for your CSS. By default, the Usemin block from your
// `index.html` will take care of minification, e.g.
//
// <!-- build:css({.tmp,app}) styles/main.css -->
//
// dist: {
// files: {
// '<%= yeoman.dist %>/styles/main.css': [
// '.tmp/styles/{,*/}*.css',
// '<%= yeoman.app %>/styles/{,*/}*.css'
// ]
// }
// }
},
htmlmin: {
dist: {
options: {
/*removeCommentsFromCDATA: true,
// https://github.com/yeoman/grunt-usemin/issues/44
//collapseWhitespace: true,
collapseBooleanAttributes: true,
removeAttributeQuotes: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeOptionalTags: true*/
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>',
src: '*.html',
dest: '<%= yeoman.dist %>'
}]
}
},
ngmin: {
dist: {
src: '.tmp/concat/scripts/app.js',
dest: '.tmp/concat/scripts/app.js'
}
},
// Put files not handled in other tasks here
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= yeoman.app %>',
dest: '<%= yeoman.dist %>',
src: [
'*.{ico,png,txt}',
'.htaccess',
'images/{,*/}*.{webp,gif,svg}',
'styles/fonts/{,*/}*.*',
'views/*.*',
//'index.html',
'bower_components/sass-bootstrap/fonts/*.*'
]
}]
},
styles: {
expand: true,
dot: true,
cwd: '<%= yeoman.app %>/styles',
dest: '.tmp/styles/',
src: '{,*/}*.css'
}
},
modernizr: {
devFile: '<%= yeoman.app %>/bower_components/modernizr/modernizr.js',
outputFile: '<%= yeoman.dist %>/bower_components/modernizr/modernizr.js',
files: [
'<%= yeoman.dist %>/scripts/{,*/}*.js',
'<%= yeoman.dist %>/styles/{,*/}*.css',
'!<%= yeoman.dist %>/scripts/vendor/*'
],
uglify: true
},
concurrent: {
server: [
'compass',
'copy:styles'
],
test: [
'copy:styles'
],
dist: [
//'compass',
'copy:styles',
'imagemin',
'svgmin',
'htmlmin'
]
},
bower: {
options: {
exclude: ['modernizr']
},
all: {
rjsConfig: '<%= yeoman.app %>/scripts/main.js'
}
}
});
grunt.registerTask('server', function (target) {
if (target === 'dist') {
return grunt.task.run(['build', 'connect:dist:keepalive']);
}
grunt.task.run([
'clean:server',
'concurrent:server',
'autoprefixer',
'connect:livereload',
'watch'
]);
});
grunt.registerTask('test', [
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'mocha'
]);
grunt.registerTask('build', [
'clean:dist',
'jshint',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'concat',
'cssmin',
'ngmin',
'usemin',
'uglify',
'copy:dist'
]);
grunt.registerTask('default', [
'jshint',
'test',
'build'
]);
};

29
mod/dashboard/README.md Normal file
View File

@ -0,0 +1,29 @@
# etcd Dashboard
## Developing
If you'd like to contribute to the etcd dashboard mod, follow these instructions. For contributing to the rest of etcd, see the contributing document in the root of the repository.
### Install yeoman
http://yeoman.io/
### Install NPM locally
```
npm install
```
### Install Bower Components
```
bower install
```
### View in Browser
run `export ETCD_DASHBOARD_DIR=/absolute/path/to/coreos/etcd/mod/dashboard/app`
Run etcd like you normally would and afterward browse to:
http://localhost:4001/mod/dashboard/

View File

@ -0,0 +1,7 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
preserveAspectRatio="xMinYMin" viewBox="0 0 72.556 61" enable-background="new 0 0 72.556 61" xml:space="preserve">
<path d="M34.521,8v11.088v23v10.737c0,2.209,1.791,4,4,4c2.209,0,4-1.791,4-4V42.067V19.109V8c0-2.209-1.791-4-4-4
C36.312,4,34.521,5.791,34.521,8z"/>
<path d="M16.109,34.412h11.088h23h10.737c2.209,0,4-1.791,4-4c0-2.209-1.791-4-4-4H50.175H27.217H16.109c-2.209,0-4,1.791-4,4
C12.109,32.621,13.9,34.412,16.109,34.412z"/>
</svg>

After

Width:  |  Height:  |  Size: 561 B

View File

@ -0,0 +1,6 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
preserveAspectRatio="xMinYMin" viewBox="0 0 73.356 61" enable-background="new 0 0 73.356 61" xml:space="preserve">
<path d="M5.27,33.226l22.428,22.428c1.562,1.562,4.095,1.562,5.657,0c1.562-1.562,1.562-4.095,0-5.657L17.77,34.413h48.514
c2.209,0,4-1.791,4-4s-1.791-4-4-4H17.749l15.604-15.582c1.563-1.561,1.565-4.094,0.004-5.657C32.576,4.391,31.552,4,30.527,4
c-1.023,0-2.046,0.39-2.827,1.169L5.272,27.567c-0.751,0.75-1.173,1.768-1.173,2.829C4.098,31.458,4.52,32.476,5.27,33.226z"/>
</svg>

After

Width:  |  Height:  |  Size: 608 B

View File

@ -0,0 +1,7 @@
<svg version="1.1" fill="#f00" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
x="0px" y="0px" preserveAspectRatio="xMinYMin" viewBox="0 0 76.143 61" enable-background="new 0 0 76.143 61" xml:space="preserve">
<path d="M49.41,13.505l-6.035,6.035L27.112,35.803l-6.035,6.035c-1.562,1.562-1.562,4.095,0,5.657c1.562,1.562,4.095,1.562,5.657,0
l6.05-6.05l16.234-16.234l6.05-6.05c1.562-1.562,1.562-4.095,0-5.657C53.505,11.943,50.972,11.943,49.41,13.505z"/>
<path d="M21.077,19.162l6.035,6.035L43.375,41.46l6.035,6.035c1.562,1.562,4.095,1.562,5.657,0c1.562-1.562,1.562-4.095,0-5.657
l-6.05-6.05L32.783,19.555l-6.05-6.05c-1.562-1.562-4.095-1.562-5.657,0C19.515,15.067,19.515,17.6,21.077,19.162z"/>
</svg>

After

Width:  |  Height:  |  Size: 749 B

View File

@ -0,0 +1,46 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
preserveAspectRatio="xMinYMin" viewBox="0 0 792 306" enable-background="new 0 0 792 306" xml:space="preserve">
<g>
<g>
<path fill="#53A3DA" d="M136.168,45.527C76.898,45.527,28.689,93.739,28.689,153c0,59.265,48.209,107.474,107.479,107.474
c59.252,0,107.465-48.209,107.465-107.474C243.633,93.739,195.42,45.527,136.168,45.527z"/>
<path fill="#F1606D" d="M136.168,55.389c-17.283,0-31.941,27.645-37.235,66.069c-0.169,1.236-0.333,2.487-0.478,3.746
c-0.723,6.047-1.213,12.335-1.458,18.808c-0.117,2.962-0.175,5.956-0.175,8.988c0,3.029,0.058,6.029,0.175,8.985
c0.245,6.472,0.735,12.764,1.458,18.811c8.104,1.049,16.769,1.761,25.807,2.099c3.907,0.146,7.872,0.233,11.907,0.233
c4.023,0,8-0.088,11.895-0.233c9.049-0.338,17.708-1.05,25.819-2.099c0.892-0.114,1.77-0.239,2.659-0.368
c33.754-4.74,57.235-15.232,57.235-27.428C233.776,99.088,190.071,55.389,136.168,55.389z"/>
<path fill="#FFFFFF" d="M176.541,125.569c-0.979-1.428-2.029-2.796-3.148-4.11c-8.956-10.557-22.297-17.265-37.224-17.265
c-4.839,0-9.148,7.407-11.907,18.909c-1.096,4.586-1.947,9.819-2.495,15.498c-0.432,4.551-0.665,9.391-0.665,14.399
s0.233,9.849,0.665,14.396c4.554,0.432,9.387,0.664,14.402,0.664c5.009,0,9.842-0.232,14.396-0.664
c10.011-0.95,18.653-2.875,24.775-5.411c6.046-2.501,9.624-5.615,9.624-8.985C184.963,142.832,181.858,133.388,176.541,125.569z"
/>
</g>
<g>
<path fill="#231F20" d="M344.891,100.053c12.585,0,22.816,6.138,29.262,13.062l-10.064,11.326
c-5.353-5.192-11.175-8.495-19.041-8.495c-16.839,0-28.953,14.16-28.953,37.291c0,23.448,11.169,37.608,28.32,37.608
c9.128,0,15.895-3.775,21.717-10.228l10.067,11.169c-8.335,9.598-19.038,14.95-32.099,14.95c-26.119,0-46.731-18.88-46.731-53.025
C297.37,120.036,318.454,100.053,344.891,100.053z"/>
<path fill="#231F20" d="M416.961,125.701c19.352,0,36.822,14.793,36.822,40.597c0,25.647-17.471,40.439-36.822,40.439
c-19.197,0-36.66-14.792-36.66-40.439C380.301,140.494,397.764,125.701,416.961,125.701z M416.961,191.945
c11.33,0,18.25-10.228,18.25-25.647c0-15.577-6.92-25.804-18.25-25.804s-18.094,10.227-18.094,25.804
C398.867,181.717,405.631,191.945,416.961,191.945z"/>
<path fill="#231F20" d="M459.771,127.589h14.943l1.26,13.688h0.629c5.506-10.07,13.691-15.577,21.871-15.577
c3.938,0,6.455,0.472,8.811,1.574l-3.148,15.734c-2.67-0.784-4.717-1.257-8.018-1.257c-6.139,0-13.539,4.245-18.256,15.893v47.203
h-18.092V127.589z"/>
<path fill="#231F20" d="M541.121,125.701c20.928,0,31.941,15.107,31.941,36.667c0,3.458-0.314,6.604-0.787,8.495h-49.09
c1.57,14.003,10.379,21.869,22.811,21.869c6.613,0,12.273-2.041,17.941-5.662l6.135,11.326
c-7.395,4.878-16.676,8.341-26.432,8.341c-21.404,0-38.08-14.95-38.08-40.439C505.561,141.12,523.023,125.701,541.121,125.701z
M557.326,159.376c0-12.277-5.189-19.671-15.732-19.671c-9.125,0-16.996,6.768-18.57,19.671H557.326z"/>
<path fill="#F1606D" d="M600.602,152.607c0-32.729,17.785-53.344,42.799-53.344c24.863,0,42.641,20.615,42.641,53.344
c0,32.889-17.777,54.13-42.641,54.13C618.387,206.737,600.602,185.496,600.602,152.607z M678.49,152.607
c0-28.639-14.158-46.731-35.09-46.731c-21.084,0-35.248,18.093-35.248,46.731c0,28.796,14.164,47.521,35.248,47.521
C664.332,200.128,678.49,181.403,678.49,152.607z"/>
<path fill="#53A4D9" d="M699.738,186.125c7.557,8.495,18.412,14.003,30.529,14.003c15.732,0,25.807-8.499,25.807-20.767
c0-12.904-8.494-17.154-18.723-21.717l-15.736-7.082c-8.969-3.936-20.934-10.385-20.934-25.808
c0-14.947,12.904-25.492,30.059-25.492c12.588,0,22.658,5.665,28.949,12.435l-4.244,4.878c-5.982-6.452-14.32-10.7-24.705-10.7
c-13.691,0-22.816,7.239-22.816,18.565c0,11.962,10.385,16.521,17.936,19.985l15.738,6.921
c11.486,5.195,21.713,11.647,21.713,27.539s-13.061,27.851-33.201,27.851c-15.107,0-26.75-6.451-34.932-15.576L699.738,186.125z"
/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@ -0,0 +1,64 @@
<!DOCTYPE html>
<html class="no-js" ng-app="etcdControlPanel" ng-controller="RootCtrl">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>etcd dashboard</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,400italic,600,700,900" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600,700" rel="stylesheet" type="text/css">
<!-- build:css styles/styles.css -->
<link rel="stylesheet" href="styles/bootstrap.css">
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/browser.css">
<link rel="stylesheet" href="styles/stats.css">
<link rel="stylesheet" href="styles/etcd-widgets.css">
<!-- endbuild -->
</head>
<body>
<h1>etcd Dashboard</h1>
<div id="view-container" ng-view></div>
<div id="footer">
<div id="powered-by" class="text-center">Powered by <a href="https://github.com/coreos/etcd" tabindex="-1">etcd</a></div>
<div id="coreos-logo">
<a href="http://coreos.com" tabindex="-1"><img src="images/logo.svg"/></a>
</div>
</div>
<!-- build:js scripts/modules.js -->
<script src="bower_components/jquery/jquery.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-resource/angular-resource.js"></script>
<script src="bower_components/angular-route/angular-route.js"></script>
<script src="bower_components/angular-cookies/angular-cookies.js"></script>
<script src="bower_components/angular-sanitize/angular-sanitize.js"></script>
<script src="bower_components/d3/d3.js"></script>
<script src="bower_components/underscore/underscore.js"></script>
<script src="bower_components/underscore.string/lib/underscore.string.js"></script>
<script src="bower_components/moment/moment.js"></script>
<script src="scripts/vega.js"></script>
<script src="scripts/ng-time-relative.min.js"></script>
<!-- endbuild -->
<!-- build:js scripts/app.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/root.js"></script>
<script src="scripts/directives.js"></script>
<script src="scripts/shims.js"></script>
<script src="scripts/controllers/home.js"></script>
<script src="scripts/controllers/browser.js"></script>
<script src="scripts/common/services/etcd.js"></script>
<script src="scripts/common/services/prefix-url.js"></script>
<script src="scripts/common/directives/highlight.js"></script>
<script src="scripts/common/directives/enter.js"></script>
<script src="scripts/common/services/etcd.js"></script>
<script src="scripts/controllers/stats.js"></script>
<!-- endbuild -->
</body>
</html>

View File

@ -0,0 +1,43 @@
'use strict';
var app = angular.module('etcdControlPanel', [
'ngRoute',
'ngResource',
'etcd',
'etcdDirectives',
'timeRelative',
'underscore',
'jquery',
'moment',
'vg'
]);
app.constant('urlPrefix', '/mod/dashboard');
app.constant('keyPrefix', '/v2/keys/');
app.config(function($routeProvider, $locationProvider, urlPrefix) {
function prefixUrl(url) {
return urlPrefix + url;
}
$locationProvider.html5Mode(true);
$routeProvider
.when(prefixUrl('/'), {
controller: 'HomeCtrl',
templateUrl: prefixUrl('/views/home.html')
})
.when(prefixUrl('/stats'), {
controller: 'StatsCtrl',
templateUrl: prefixUrl('/views/stats.html')
})
.when(prefixUrl('/browser'), {
controller: 'BrowserCtrl',
templateUrl: prefixUrl('/views/browser.html')
})
.otherwise({
templateUrl: prefixUrl('/404.html')
});
});

View File

@ -0,0 +1,16 @@
'use strict';
angular.module('etcdControlPanel')
.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind('keydown keypress', function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
});
};
});

View File

@ -0,0 +1,19 @@
'use strict';
angular.module('etcdControlPanel')
.directive('highlight', function(keyPrefix) {
return {
restrict: 'E',
scope: {
highlightBase: '=',
highlightCurrent: '='
},
link: function(scope, element, attrs) {
var base = _.str.strRight(scope.highlightBase, keyPrefix),
current = _.str.trim(scope.highlightCurrent, '/');
if (base === current) {
element.parent().parent().addClass('etcd-selected');
}
}
};
});

View File

@ -0,0 +1,103 @@
'use strict';
angular.module('etcd', [])
.factory('EtcdV2', ['$http', '$q', function($http, $q) {
var keyPrefix = '/v2/keys/'
var statsPrefix = '/v2/stats/'
var baseURL = '/v2/'
var leaderURL = ''
delete $http.defaults.headers.common['X-Requested-With'];
function cleanupPath(path) {
var parts = path.split('/');
if (parts.length === 0) {
return '';
}
parts = parts.filter(function(v){return v!=='';});
parts = parts.join('/');
return parts
}
function newKey(keyName) {
var self = {};
self.name = cleanupPath(keyName);
self.getParent = function() {
var parts = self.name.split('/');
if (parts.length === 0) {
return newKey('');
}
parts.pop();
return newKey(parts.join('/'));
};
self.path = function() {
var path = '/' + cleanupPath(keyPrefix + self.name);
if (path === keyPrefix.substring(0, keyPrefix.length - 1)) {
return keyPrefix
}
return path
};
self.get = function() {
return $http.get(self.path());
};
self.set = function(keyValue) {
return getLeader().then(function(leader) {
return $http({
url: leader + self.path(),
data: $.param({value: keyValue}),
method: 'PUT',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
});
});
};
self.deleteKey = function(keyValue) {
return getLeader().then(function(leader) {
return $http({
url: leader + self.path(),
method: 'DELETE',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
});
});
};
return self;
}
function newStat(statName) {
var self = {};
self.name = cleanupPath(statName);
self.path = function() {
return '/' + cleanupPath(statsPrefix + self.name);
};
self.get = function() {
return $http.get(self.path());
};
return self
}
function getLeader() {
return newStat('leader').get().then(function(response) {
return newKey('/_etcd/machines/' + response.data.leader).get().then(function(response) {
// TODO: do something better here p.s. I hate javascript
var data = decodeURIComponent(response.data.node.value);
data = data.replace(/&/g, "\",\"").replace(/=/g,"\":\"");
data = JSON.parse('{"' + data + '"}');
return data.etcd;
});
});
}
return {
getStat: newStat,
getKey: newKey,
}
}]);

View File

@ -0,0 +1,10 @@
'use strict';
angular.module('etcdControlPanel')
.factory('prefixUrl', function(urlPrefix) {
return function(url) {
return urlPrefix + url;
}
});

View File

@ -0,0 +1,156 @@
'use strict';
angular.module('etcdControlPanel')
.controller('BrowserCtrl', function ($scope, $window, EtcdV2, keyPrefix, $, _, moment) {
$scope.save = 'etcd-save-hide';
$scope.preview = 'etcd-preview-hide';
$scope.enableBack = true;
$scope.writingNew = false;
$scope.key = null;
$scope.list = [];
// etcdPath is the path to the key that is currenly being looked at.
$scope.etcdPath = keyPrefix;
$scope.inputPath = keyPrefix;
$scope.resetInputPath = function() {
$scope.inputPath = $scope.etcdPath;
};
$scope.setActiveKey = function(key) {
$scope.etcdPath = keyPrefix + _.str.trim(key, '/');
$scope.resetInputPath();
};
$scope.stripPrefix = function(path) {
return _.str.strRight(path, keyPrefix);
};
$scope.onEnter = function() {
var path = $scope.stripPrefix($scope.inputPath);
if (path !== '') {
$scope.setActiveKey(path);
}
};
$scope.updateCurrentKey = function() {
function etcdPathKey() {
return pathKey($scope.etcdPath);
}
function pathKey(path) {
var parts = path.split(keyPrefix);
if (parts.length === 1) {
return '';
}
return parts[1];
}
// Notify everyone of the update
localStorage.setItem('etcdPath', $scope.etcdPath);
$scope.enableBack = true;
//disable back button if at root (/v2/keys/)
if ($scope.etcdPath === keyPrefix) {
$scope.enableBack = false;
}
$scope.key = EtcdV2.getKey(etcdPathKey($scope.etcdPath));
};
$scope.$watch('etcdPath', $scope.updateCurrentKey);
$scope.$watch('key', function() {
if ($scope.writingNew === true) {
return;
}
$scope.key.get().success(function (data, status, headers, config) {
//hide any errors
$('#etcd-browse-error').hide();
// Looking at a directory if we got an array
if (data.dir === true) {
$scope.list = data.node.nodes;
$scope.preview = 'etcd-preview-hide';
} else {
$scope.singleValue = data.node.value;
$scope.preview = 'etcd-preview-reveal';
$scope.key.getParent().get().success(function(data) {
$scope.list = data.node.nodes;
});
}
$scope.previewMessage = 'No key selected.';
}).error(function (data, status, headers, config) {
$scope.previewMessage = 'Key does not exist.';
$scope.showBrowseError(data.message);
});
});
//back button click
$scope.back = function() {
$scope.etcdPath = $scope.key.getParent().path();
$scope.resetInputPath();
$scope.preview = 'etcd-preview-hide';
$scope.writingNew = false;
};
$scope.showSave = function() {
$scope.save = 'etcd-save-reveal';
};
$scope.saveData = function() {
$scope.setActiveKey($scope.stripPrefix($scope.inputPath));
$scope.updateCurrentKey();
// TODO: fixup etcd to allow for empty values
$scope.key.set($scope.singleValue || ' ').then(function(response) {
$scope.save = 'etcd-save-hide';
$scope.preview = 'etcd-preview-hide';
$scope.back();
$scope.writingNew = false;
}, function (response) {
$scope.showSaveError(response.message);
});
};
$scope.deleteKey = function(key) {
$scope.setActiveKey(key);
$scope.updateCurrentKey();
$scope.key.deleteKey().then(function(response) {
//TODO: remove loader
$scope.save = 'etcd-save-hide';
$scope.preview = 'etcd-preview-hide';
$scope.back();
}, function (response) {
//TODO: remove loader
//show errors
$scope.showBrowseError('Could not delete the key');
});
};
$scope.add = function() {
$scope.save = 'etcd-save-reveal';
$scope.preview = 'etcd-preview-reveal';
$scope.singleValue = '';
$('.etcd-browser-path').find('input').focus();
$scope.writingNew = true;
};
$scope.showBrowseError = function(message) {
$('#etcd-browse-error').find('.etcd-popover-content').text('Error: ' + message);
$('#etcd-browse-error').addClass('etcd-popover-right').show();
};
$scope.showSaveError = function(message) {
$('#etcd-save-error').find('.etcd-popover-content').text('Error: ' + message);
$('#etcd-save-error').addClass('etcd-popover-left').show();
};
$scope.getHeight = function() {
return $($window).height();
};
//$scope.$watch($scope.getHeight, function() {
////$('.etcd-container.etcd-browser etcd-body').css('height', $scope.getHeight()-45);
//});
$window.onresize = function(){
$scope.$apply();
};
});

View File

@ -0,0 +1,3 @@
angular.module('etcdControlPanel')
.controller('HomeCtrl', function($scope) {
});

View File

@ -0,0 +1,9 @@
'use strict';
angular.module('etcdControlPanel')
.controller('RootCtrl', function($rootScope, prefixUrl) {
// Expose prefixUrl() function to all.
$rootScope.prefixUrl = prefixUrl;
});

Some files were not shown because too many files have changed in this diff Show More