Commit Graph

166 Commits

Author SHA1 Message Date
James Phillips 7bf684ece1 Fixes some bad error returns in the persist service and check paths. 2016-04-26 15:03:26 -07:00
James Phillips ceac68c5eb Merge pull request #1762 from mshean/script-timeout
Add Timeout field to CheckMonitor
2016-04-24 23:08:06 -07:00
Matt Shean fe4107019e add Timeout field to CheckMonitor 2016-04-20 11:41:30 -07:00
James Phillips eedeba682b Makes reap time configurable for LAN and WAN. 2016-04-11 00:38:25 -07:00
Wim b5d45322b4 Allow [::] as a bind address (binds to first public IPv6 address) 2016-03-18 23:59:44 +01:00
James Phillips c60a526fde Sets up config for more address tags down the road, renames struct members. 2016-02-07 10:37:34 -08:00
Evan Gilman 8fa2a60208 Rectify value of `AdvertiseAddrWan` when set elsewhere
`AdvertiseAddrs` has been introduced as a configuration option, which
duplicates a few other options, namely `AdvertiseAddrWan`. We need to
use this value elsewhere, so rather than doing a precedence check every
time we need to access it, rectify the value of `AdvertiseAddrWan` to
match
2016-02-06 23:01:45 -08:00
Sean Chittenden 7af6a94edb 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 343838f12b Adds support for the reap lock. 2016-01-12 21:10:25 -08:00
Ryan Uber afafae53fd consul: dev mode works 2015-12-26 20:19:36 -05:00
James Phillips 95c708f65e Adds Docker checks support to client API.
Also changed `DockerContainerId` to `DockerContainerID`, and updated the agent
API docs to reflect their support for Docker checks.
2015-11-18 07:40:02 -08:00
James Phillips 5e7523ea4b Adds a slightly more flexible mock system so we can test DNS. 2015-11-15 17:06:00 -08:00
James Phillips c0bd639662 Makes the version upshift code look at the correct version field. 2015-10-27 14:44:34 -07:00
Diptanu Choudhury 471442e9a4 Making an explicit check to test whether a check is of type Monitor 2015-10-26 19:52:32 -07:00
Diptanu Choudhury 423f7fbcac Not adding the docker check if we couldn't create the client 2015-10-26 16:45:12 -07:00
Diptanu Choudhury 5f8f531d2a Defaulting to Monitor check 2015-10-26 15:02:23 -07:00
Diptanu Choudhury 71ede8addb Implemented Docker health checks 2015-10-26 10:23:57 -07:00
James Phillips 660da92152 Makes the default protocol 2 and lets 3 interoperate with 2. 2015-10-23 15:23:01 -07:00
James Phillips ad65d953f6 Scales coordinate sends to hit a fixed aggregate rate across the cluster. 2015-10-23 15:23:01 -07:00
James Phillips 66a3d29743 Simplifies the batching function and adds some comments. 2015-10-23 15:23:01 -07:00
James Phillips 5f754c4a87 Does some small cleanups based on PR feedback.
* Holds coordinate updates in map and gets rid of the update channel.
* Cleans up config variables a bit.
2015-10-23 15:23:01 -07:00
James Phillips d12aa2ffab Moves batching down into the state store and changes it to fail-fast.
* A batch of updates is done all in a single transaction.
* We no longer need to get an update to kick things, there's a periodic flush.
* If incoming updates overwhelm the configured flush rate they will be dumped with an error.
2015-10-23 15:23:01 -07:00
James Phillips b9d5fb0f90 Flips the sense of the coordinate enable option. 2015-10-23 15:23:01 -07:00
James Phillips 86b112fe31 Does a clean up pass on the Consul side. 2015-10-23 15:23:01 -07:00
Derek Chiang f144d17b1c Address comments 2015-10-23 15:23:01 -07:00
Derek Chiang ab9262c656 Add a test case 2015-10-23 15:23:01 -07:00
Derek Chiang bf5cb7522f Use IndexedCoordinate instead 2015-10-23 15:23:01 -07:00
Derek Chiang a1854a7614 Some fixes 2015-10-23 15:23:01 -07:00
Derek Chiang 98d87b5dd5 Complete logic for sending coordinates 2015-10-23 15:23:01 -07:00
Derek Chiang 9113b26286 Some fixes 2015-10-23 15:23:01 -07:00
Derek Chiang a9ea503c69 Adding tests and stuff 2015-10-23 15:23:01 -07:00
James Phillips 4ee43e90b7 Deletes the old state store and all its accoutrements. 2015-10-15 14:59:09 -07:00
Dale Wijnand 5a28ebcaa3 Fix a bunch of typos. 2015-09-15 13:22:08 +01:00
Ryan Uber 125d7fd4ee agent: thread tokens through for maintenance mode 2015-09-10 11:43:59 -07:00
Peter Fern b023904298 Add TCP check type
Adds the ability to simply check whether a TCP socket accepts
connections to determine if it is healthy.  This is a light-weight -
though less comprehensive than scripting - method of checking network
service health.

The check parameter `tcp` should be set to the `address:port`
combination for the service to be tested.  Supports both IPv6 and IPv4,
in the case of a hostname that resolves to both, connections will be
attempted via both protocol versions, with the first successful
connection returning a successful check result.

Example check:

```json
{
  "check": {
    "id": "ssh",
    "name": "SSH (TCP)",
    "tcp": "example.com:22",
    "interval": "10s"
  }
}
```
2015-07-24 14:06:05 +10:00
Ryan Uber d0348d1291 Merge pull request #1004 from i0rek/advertise_addrs
Add advertise_addrs.
2015-06-23 12:32:07 -07:00
Hans Hasselberg 267e0caf81 Implement advertise_addrs for SerfLan, SerfWan and RPC.
Fixes #550.
This will make it possible to configure the advertised adresses for
SerfLan, SerfWan and RPC. It will enable multiple consul clients on a
single host which is very useful in a container environment.

This option might override advertise_addr and advertise_addr_wan
depending on the configuration.

It will be configureable with advertise_addrs. Example:

{
  "advertise_addrs": {
    "serf_lan": "10.0.120.91:4424",
    "serf_wan": "201.20.10.61:4423",
    "rpc": "10.20.10.61:4424"
  }
}
2015-06-23 21:23:45 +02:00
Ryan Uber 69921808ee agent: use persist/load/purge convention for function names 2015-06-08 09:35:10 -07:00
Ryan Uber 1636a35289 agent: check state is purged if expired 2015-06-05 16:59:41 -07:00
Ryan Uber 2ee8fa8e15 agent: purge check state when checks are deregistered 2015-06-05 16:57:14 -07:00
Ryan Uber 7e6e861394 agent: testing state persistence, recovery, and expiration 2015-06-05 16:45:05 -07:00
Ryan Uber 7597d3d798 agent: first stab at persisting check state 2015-06-05 16:17:07 -07:00
Ryan Uber ebe57a1f65 agent: refactor loadChecks/loadServices, fixes a few minor bugs 2015-06-04 14:33:30 -07:00
Armon Dadgar ebf961ef8b Merge pull request #927 from hashicorp/f-tls
Add new `verify_server_hostname` to mitigate possibility of MITM
2015-05-11 18:15:16 -07:00
Armon Dadgar 8d86290ebf Fixing merge conflict 2015-05-11 16:48:10 -07:00
Armon Dadgar a485eb8447 agent: copy config into consul config 2015-05-11 15:16:13 -07:00
Ryan Uber 3ed0146e44 agent: use service ID field to determine associated health checks during deregister 2015-05-07 15:30:01 -07:00
Ryan Uber 204c11ec01 agent: restore check status when re-registering (updating) services 2015-05-06 12:28:42 -07:00
Ryan Uber 8ef01236e1 agent: allow persisted services to be updated on disk 2015-05-05 22:36:45 -07:00
Ryan Uber 739d1fdf03 Merge pull request #891 from hashicorp/f-token
ACL tokens for service/check registration
2015-05-05 22:17:31 -07:00