87 Commits

Author SHA1 Message Date
Yicheng Qin
b12a52b0fd etcdmain: fix the check in fallback-to-proxy case
advertise-client-urls has to be set if listen-client-urls is set when
fallbacking to proxy, which breaks the behavior. Loosen the check to fix
it.
2015-06-25 14:07:45 -07:00
Yicheng Qin
6fd2dfdebc etcdmain: fix that advertise-client-urls is required in proxy mode
etcd proxy doesn't need to set advertise-client-urls because the flag is
not used.
2015-06-16 14:18:01 -07:00
Yicheng Qin
6ee6f72c48 etcdmain: increase maxIdleConnsPerHost in proxy transport
This PR set maxIdleConnsPerHost to 128 to let proxy handle 128 concurrent
requests in long term smoothly.
If the number of concurrent requests is bigger than this value,
proxy needs to create one new connection when handling each request in
the delta, which is bad because the creation consumes resource and may
eat up your ephemeral port.
2015-06-16 14:10:58 -07:00
Yicheng Qin
973cfbebda *: make dial timeout configurable
Dial timeout is set shorter because
1. etcd is supposed to work in good environment, and the new value is long
enough
2. shorter dial timeout makes dial fail faster, which is good for
performance

Conflicts:
	etcdmain/etcd.go
2015-06-16 14:06:18 -07:00
Xiang Li
9a0e0c2eae etcdmain: better error msg when detected duplicate id in discovery
Conflicts:
	etcdmain/etcd.go
2015-05-15 13:47:02 -07:00
Mohammad Samman
d30e764b2d version: added more version information
added more version information output to aid debugging
print etcd Version, Git SHA, Go runtime version, OS
and architecture

Fixes #2560

Conflicts:
	version/version.go
2015-05-15 12:34:33 -07:00
Yicheng Qin
67c5d4dfd2 etcdmain: advertise-client-urls must be set if listen-client-urls is set
Before this PR, people can set listen-client-urls without setting
advertise-client-urls, and leaves advertise-client-urls as default
localhost value. The client libraries which sync the cluster info
fetch wrong advertise-client-urls and cannot connect to the cluster.
This PR avoids this case and provides better UX.

On the other hand, this change is safe because people always want to set
advertise-client-urls if listen-client-urls is set. The default localhost
advertise url cannot be accessed from the outside, and should always be
set except that etcd is bootstrapped with no flag.

Conflicts:
	etcdmain/etcd.go
2015-05-15 12:32:35 -07:00
Yicheng Qin
fce4cf4dc8 Revert "etcdserver: fix cluster fallback recovery"
This reverts commit cff005777a40bcf3a5bea3e87387273afe054ce1.
2015-04-24 13:06:43 -07:00
Xiang Li
21455d2f3b *: stop using resolved tcp addr
We start to resolve host into tcp addrs since we generate
tcp based initial-cluster during srv discovery. However it
creates problems around tls and cluster verification. The
srv discovery only needs to use resolved the tcp addr to
find the local node. It does not have to resolve everything
and use the resolved addrs.

This fixes #2488 and #2226
2015-04-22 14:59:07 -07:00
Yicheng Qin
a1cb5cb768 etcdmain: print error when non-flag args remain 2015-03-24 22:49:31 -07:00
Brandon Philips
697883fb8c etcdmain: let user provide a name w/o initial-cluster update
Currently this doesn't work if a user wants to try out a single machine
cluster but change the name for whatever reason. This is because the
name is always "default" and the

```
./bin/etcd -name 'baz'
```

This solves our problem on CoreOS where the default is `ETCD_NAME=%m`.
2015-03-21 11:13:42 -07:00
Brandon Philips
f794f87f26 Documentation: fixup grammar around the unsafe flags 2015-03-21 11:13:28 -07:00
Xiang Li
0847986d4a etcdmain: identify data dir type 2015-03-21 11:12:18 -07:00
Xiang Li
02fb648abf etcdmain: verify heartbeat and election flag 2015-03-21 11:11:09 -07:00
kmeaw
4c9e1686b1 pkg/flags: Add support for IPv6 addresses
Support IPv6 address for ETCD_ADDR and ETCD_PEER_ADDR

pkg/flags: Support IPv6 address for ETCD_ADDR and ETCD_PEER_ADDR

pkg/flags: tests for IPv6 addr and bind-addr flags

pkg/flags: IPAddressPort.Host: do not enclose IPv6 address in square brackets

pkg/flags: set default bind address to [::] instead of 0.0.0.0

pkg/flags: we don't need fmt any more

also, one minor fix: net.JoinHostPort takes string as a port value

pkg/flags: fix ipv6 tests

pkg/flags: test both IPv4 and IPv6 addresses in TestIPAddressPortString

etcdmain: test: use [::] instead of 0.0.0.0
2015-03-21 11:05:20 -07:00
Yicheng Qin
cff005777a etcdserver: fix cluster fallback recovery
Cluster and transport may recover to old states when new node joins
the cluster. Record cluster last modified index to avoid this.
2015-02-20 14:30:00 -08:00
Xiang Li
c5ca1218f3 etcdserver: GetClusterFromPeers -> GetClusterFromRemotePeers 2015-02-13 19:05:29 -08:00
Fabian Reinartz
8bf795dc3c etcdmain/osutil: shutdown gracefully, interrupt handling
The functionality in pkg/osutil ensures that all interrupt handlers finish
and the process kills itself with the proper signal.
Test for interrupt handling added.
The server shutsdown gracefully by stopping on interrupt (Issue #2277.)
2015-02-13 10:28:53 +01:00
Barak Michener
fade9b6065 etcdserver: Refactor 2.0.1 directory rename into a proper migration
fix all instances

fix detection test
2015-02-12 11:53:19 -05:00
Yicheng Qin
57dd8c18cc etcdmain: infer bind addr from addr in v1 flagset 2015-02-10 09:42:10 -08:00
Yicheng Qin
92b329fdb9 etcdmain: use symlink instead of link for v0.4 files
link doesn't support directory.
2015-02-03 10:59:43 -08:00
Yicheng Qin
afb14a3e7a Merge pull request #2210 from yichengq/316
etcdmain: use /member subdir to save member data
2015-02-02 17:06:30 -08:00
Yicheng Qin
ce1d7a9fa9 etcdmain: use /member subdir to save member data 2015-02-02 17:01:19 -08:00
Xiang Li
fbabcedcc9 etcd: fix proxy
1. move proxy datadir to /proxy subdir.
2. delay update proxy's cluster after validation.
2015-02-02 14:58:45 -08:00
Xiang Li
ae9f54c132 etcd: fix proxy updating 2015-01-30 16:56:41 -08:00
Xiang Li
dc7374c488 etcd: persist proxy cluster to disk 2015-01-30 15:18:26 -08:00
Yicheng Qin
ec5a6e8beb migrate: support start desired version 2015-01-30 00:35:53 -08:00
Xiang Li
9c7f66c5d9 Merge pull request #2119 from sorah/peer-ca-on-fetching-members
etcdserver: User peerTLSInfo to get cluster member
2015-01-26 10:50:44 -08:00
Shota Fukumori (sora_h)
033e7d1db9 etcdserver: User peerTLSInfo to get cluster member 2015-01-27 03:43:21 +09:00
Jonathan Boulle
f1ed69e883 *: switch to line comments for copyright
Build tags are not compatible with block comments.
Also adds copyright header to a few places it was missing.
2015-01-26 09:53:30 -08:00
Xiang Li
276a4abac0 etcdserver: make heartbeat/election configurable 2015-01-15 11:11:33 -08:00
Yicheng Qin
2e776117f8 Merge pull request #2071 from yichengq/287
etcdhttp: add NewPeerHandler test
2015-01-12 15:59:37 -08:00
Yicheng Qin
dc6aef0d02 etcdhttp: add NewPeerHandler test 2015-01-12 15:56:29 -08:00
Yicheng Qin
50395a53fb etcdmain: add license 2015-01-12 13:34:21 -08:00
Yicheng Qin
60d6c34c28 etcdmain: add config tests 2015-01-12 13:34:16 -08:00
Xiang Li
a15f39e6a2 etcdmain: do not set timeout for client api 2015-01-06 16:17:56 -08:00
Xiang Li
7f1c630a0b *: use keepalive listener to detect dead clients 2015-01-06 12:09:34 -08:00
Xiang Li
0afbca4090 etcdmain: add readtimeout for http server 2015-01-06 11:04:38 -08:00
Xiang Li
08e9c25ea5 *: move srv into pkg discovery 2014-12-24 21:37:20 -08:00
Kelsey Hightower
705ec45083 etcdmain: resolve DNS hostnames for client and peer URLs
etcd resolves DNS hostnames to IP addresses for client and peer URLs
before creating any listening sockets.

The following messages are logged during startup:

    etcd: Resolving infra0.coreos.com:2380 to 10.0.1.10:2380

Fixes #1991
2014-12-24 13:12:32 -05:00
Xiang Li
ee7f23d0d5 doc: doc addition/fix for discovery-srv flag 2014-12-22 12:10:04 -08:00
Xiang Li
3abe71dff5 etcdmian: add tests for configuration parsing 2014-12-22 11:56:56 -08:00
Xiang Li
0fa754d90e etcdmain: add config.go 2014-12-19 18:33:19 -08:00
Barak Michener
4f2d35679e Merge pull request #1947 from barakmich/dns_bootstrap
add capability to bootstrap from DNS SRV
2014-12-19 13:45:03 -08:00
Barak Michener
8fc17147ef change logging 2014-12-19 16:40:29 -05:00
Barak Michener
6295dfba5a resolve all hostnames in DNS discovery 2014-12-18 19:19:21 -05:00
Barak Michener
a5923e5b00 apologize profusely about locking on windows 2014-12-18 19:04:58 -05:00
Barak Michener
977c74069c move constants out for windows 2014-12-18 18:57:11 -05:00
Barak Michener
2dfcf053d4 rename flag to discovery-srv 2014-12-18 18:13:40 -05:00
Barak Michener
7f733ad68b Fully resolve DNS entries to IPs and ignore single errors (such as no etcd-server-ssl) 2014-12-18 18:08:56 -05:00