Commit Graph

35 Commits

Author SHA1 Message Date
Sean Chittenden f3a69c939d Refactor consul.serverParts into server_details.ServerDetails
This may be short-lived, but it also seems like this is going to lead us down a path where ServerDetails is going to evolve into a more powerful package that will encapsulate more behavior behind a coherent API.
2016-03-23 16:15:47 -07:00
Sean Chittenden 6bda2c007c Add a flag to denote that a server is disabled
A server is not normally disabled, but in the event of an RPC error, we want to mark a server as down to allow for fast failover to a different server.  This value must be an int in order to support atomic operations.

Additionally, this is the preliminary work required to bring up a server in a disabled state.  RPC health checks in the future could mark the server as alive, thereby creating an organic "slow start" feature for Consul.
2016-03-23 16:14:59 -07:00
James Phillips 18e12aa886 Adds more specific checks for ipv6 addresses. 2016-03-19 16:14:45 -07:00
Wim 508bc796a8 Allow [::] as a bind address (binds to first public IPv6 address) 2016-03-18 23:59:44 +01:00
Sean Chittenden c470553b6b Factor out duplicate functions into a lib package
Consolidate code duplication and tests into a single lib package.  Most of these functions were from various **/util.go functions that couldn't be imported due to cyclic imports.  The consul/lib package is intended to be a terminal node in an import DAG and a place to stash various consul-only helper functions.  Pulled in hashicorp/go-uuid instead of consolidating UUID access.
2016-01-29 16:57:45 -08:00
James Phillips e0ae4878f6 Merge pull request #948 from hashicorp/iface-down-fix
Don't try to bind on address from inactive interface
2016-01-14 17:00:54 -08:00
James Phillips 5449096bc2 Adds a check for the minimum version as well. 2015-10-27 15:56:36 -07:00
James Phillips c1305a08ea Makes the version upshift code look at the correct version field. 2015-10-27 14:44:34 -07:00
James Phillips 033e8e6625 Adds sort of DCs in catalog queries based on RTT. Cleans up.
* Makes the catalog endpoint respect disabling coordinates for all
  RTT-sorting query types.
2015-10-23 15:23:01 -07:00
William Tisäter 4ce2af3bd4 Bind to loopback only as last resort 2015-09-02 12:24:44 +02:00
William Tisäter 1013f2f494 Don't try to bind on address from inactive interface 2015-09-02 12:24:36 +02:00
William Tisäter 4267814e5b Treat 127.0.0.0/8 and 169.254.0.0/16 as private network 2015-09-02 12:24:14 +02:00
Mac Browning 04eb37ffb6 consul: refactor GetPrivateIP for testability 2015-08-15 17:44:32 -04:00
Armon Dadgar f1a83a8954 Merge pull request #1119 from trumant/multiple_private_IPs
Fixes #1099 by raising an error when we multiple private IPs are found
2015-07-22 17:32:00 -07:00
Travis Truman e18a93ed54 Fixes #1099 by raising an error when we multiple private IPs are found 2015-07-16 22:25:02 -04:00
Tiru Srikantha f1932e5e46 Add RFC 6598 private IP range
Fixes #1031 by adding 100.64.0.0/10 as a private IP range.
2015-06-19 12:20:30 -07:00
Armon Dadgar e5c8fce96a consul: adding randomStagger util method 2015-05-14 17:59:11 -07:00
Ryan Breen 53afd77e2d s/data center/datacenter/g 2015-02-19 17:45:47 -05:00
William Tisäter 75e631ee94 Add helper for lowercase list of strings 2014-07-23 23:42:21 +02:00
Robert Xu fff6546c75 Minor cleanup to logic and testsuite.
Signed-off-by: Robert Xu <robxu9@gmail.com>
2014-06-18 18:47:05 -04:00
Robert Xu 31c392813c Add expect bootstrap '-expect=n' mode.
This allows for us to automatically bootstrap a cluster of nodes after
'n' number of server nodes join. All servers must have the same 'n' set, or
they will fail to join the cluster; all servers will not join the peer set
until they hit 'n' server nodes.

If the raft commit index is not empty, '-expect=n' does nothing because it
thinks you've already bootstrapped.

Signed-off-by: Robert Xu <robxu9@gmail.com>
2014-06-16 17:40:33 -04:00
Armon Dadgar 589105eee4 consul: Store the protocol version for a server 2014-05-28 16:32:24 -07:00
Armon Dadgar c8831db91c consul: Adding Addr to serverParts 2014-05-28 16:32:24 -07:00
Armon Dadgar 00477dca21 consul: Adding util method to generate a UUID 2014-05-20 16:25:27 -07:00
Mitchell Hashimoto ec547d5b99 command/agent: find proper private IP on Windows
/cc @armon
2014-05-15 11:27:30 -07:00
Armon Dadgar ece6849cac consul: Expose runtime stats for debugging 2014-04-29 10:55:42 -07:00
Armon Dadgar 1ecdeae1b6 consul: Update for serf 0.4 2014-01-30 13:13:29 -08:00
Armon Dadgar 334c2137ef Preventing multiple nodes in bootstrap mode from adding each other as Raft peers 2014-01-20 13:56:29 -10:00
Armon Dadgar 3e6787511e change isConsulServer to parse flags 2014-01-20 13:39:07 -10:00
Armon Dadgar 3cb3085175 Adding utility method to parse consul nodes 2014-01-09 15:45:14 -08:00
Armon Dadgar 4bca485178 Adding some utility functions 2014-01-07 16:58:16 -08:00
Armon Dadgar f7eb948ae1 Methods to get a private IP 2013-12-31 15:44:17 -08:00
Armon Dadgar ed0af0ad42 Refactor isConsulServer into util 2013-12-19 14:37:54 -08:00
Armon Dadgar 644ce2fcf7 Refactor ensurePath to util 2013-12-19 14:18:55 -08:00
Armon Dadgar e1c927f218 Adding ability to list services 2013-12-12 11:07:14 -08:00