Commit Graph

536 Commits

Author SHA1 Message Date
Sean Chittenden
6035dbfbe4 Automatically register service checks for HTTP, RPC, and Serf. 2016-06-16 17:34:25 -07:00
Sean Chittenden
8e1777ae3a Test for errors 2016-06-16 14:43:46 -07:00
Sean Chittenden
5708560527 Merge pull request #1276 from hashicorp/f-consul-server-autojoin
Teach Nomad servers how to fall back to Consul.
2016-06-16 14:40:45 -07:00
Diptanu Choudhury
f10df99e5d Removed the stats block from client configuration 2016-06-16 21:30:29 +01:00
Sean Chittenden
4d149888cc Define BootstrapExepct as an int32 so it can be manipulated atomically. 2016-06-16 12:00:15 -07:00
Sean Chittenden
ea89976d9d Teach Nomad servers how to fall back to Consul. 2016-06-15 12:40:51 -07:00
Diptanu Choudhury
9f598d4367 Merge pull request #1284 from hashicorp/add-warn-message
Added a warn message for deprecated consul options
2016-06-15 11:33:24 +02:00
Diptanu Choudhury
eb4a719f67 Added a warn message for deprecated consul options 2016-06-15 02:31:57 +02:00
Alex Dadgar
d8e79759fc Document consul configuration 2016-06-14 15:21:57 -07:00
Sean Chittenden
f1a40c0deb Disambiguate auto_join from auto_register, rename reg to auto_advertise.
Provide an option that describes the value to the user vs the
operation performed by the software.  Momentarily introducing
`auto_join`
2016-06-14 12:11:38 -07:00
Sean Chittenden
aea3e2c360 Temporarily disable various syncer checks due to the API changes made earlier today. 2016-06-13 19:52:17 -07:00
Sean Chittenden
388ef7f6af Drive-by comment correction 2016-06-13 18:14:50 -07:00
Alex Dadgar
f320b5a76f address comments 2016-06-13 17:32:18 -07:00
Alex Dadgar
1e4ec6b2b3 Fix IDs and domain scoping 2016-06-13 16:30:58 -07:00
Diptanu Choudhury
d64ec9d138 Removing unwated line of code 2016-06-13 15:37:55 +02:00
Diptanu Choudhury
02b320c81e implemented reconciliation of unwanted services 2016-06-13 14:52:26 +02:00
Alex Dadgar
73600066c4 agent just calls run 2016-06-12 22:30:52 -07:00
Alex Dadgar
e90e92da9f register checks 2016-06-12 21:28:56 -07:00
Alex Dadgar
b1351a3564 Do not reconcile in client and cleanup executor a bit 2016-06-12 18:22:07 -07:00
Alex Dadgar
0c3b7b2537 fix test 2016-06-12 16:48:55 -07:00
Alex Dadgar
d0e3dc6a81 Merge pull request #1264 from hashicorp/b-rename-services
Rename ConsulService back to Service
2016-06-12 16:44:49 -07:00
Diptanu Choudhury
b6d9623b9d Remove initial delay of registering services with consul 2016-06-13 01:42:56 +02:00
Alex Dadgar
c5059fc7c4 Rename ConsulService back to Service 2016-06-12 16:36:49 -07:00
Alex Dadgar
020f8b05d3 only support latest and remove ring buffer 2016-06-12 09:32:38 -07:00
Alex Dadgar
1a7df4e7d2 Allocation resources returned in a struct 2016-06-11 21:04:10 -07:00
Sean Chittenden
9b6e720fbe Merge pull request #1201 from hashicorp/f-dyn-server-list
Dynamic Server Lists/Client Bootstrapping via consul.
2016-06-11 18:58:25 -04:00
Sean Chittenden
a8b53b05b4 Prefer %+q over %q in log messages. 2016-06-11 18:17:20 -04:00
Alex Dadgar
a9c97cfb19 Don't require slash for node stats 2016-06-11 13:15:57 -07:00
Sean Chittenden
5331ea7bc6 goling(1) compliance pass (e.g. Rpc* -> RPC) 2016-06-10 23:38:28 -04:00
Sean Chittenden
6819f2b68d Query for the Nomad service across multiple Consul datacenters. 2016-06-10 23:05:14 -04:00
Sean Chittenden
91582dc875 Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
aff951ca4e Always create a consul.Syncer. Use a default Consul Config if necessary. 2016-06-10 15:55:27 -04:00
Sean Chittenden
61a36a6d54 Commit miss, bump to 5s 2016-06-10 15:54:39 -04:00
Sean Chittenden
dbdebcad80 golint(1) police 2016-06-10 15:54:39 -04:00
Sean Chittenden
a423f07d63 Stash client and server registration behind consul.auto_register 2016-06-10 15:54:39 -04:00
Sean Chittenden
5757e50243 Only return the Client's server addresses, never mix-in server peers 2016-06-10 15:54:39 -04:00
Sean Chittenden
c426b8501c Hand wave over the syncer tests atm, these will be fixed shortly. 2016-06-10 15:54:39 -04:00
Sean Chittenden
69aa8e8195 Don't spam the consul if Consul is not available.
Log once when Consul goes away, and log when Consul comes back.
2016-06-10 15:54:39 -04:00
Sean Chittenden
05e713cfca Skip nil check for agent's consulSyncer is always not nil 2016-06-10 15:54:39 -04:00
Sean Chittenden
f7b2949f11 Properly cover Syncer attributes with the registryLock.
trackedServices, delegateChecks, trackedChecks, and checkRunners
should all be covered.  This lock needs to be reasonably narrow and
can't use defer due to possible recursive locking concerns further
downstream from the call sites.
2016-06-10 15:54:39 -04:00
Sean Chittenden
27f6ffd83d On Syncer Shutdown, remove all services that match a Syncer's prefix. 2016-06-10 15:54:39 -04:00
Sean Chittenden
7d060c20d7 Sync checks with Consul by comparing the AgentCheckReg w/ ConsulService
The source of truth is the local Nomad Agent.  Any checks are not local that
have a matching prefix are removed.  Changed checks are re-registered
and missing checks are re-added.
2016-06-10 15:54:39 -04:00
Sean Chittenden
19f765eb05 Sync services with Consul by comparing the AgentServiceReg w/ ConsulService
The source of truth is the local Nomad Agent.  Any services not local that
have a matching prefix are removed.  Changed services are re-registered
and missing services are re-added.
2016-06-10 15:54:39 -04:00
Sean Chittenden
d1ab21f2f7 Generate and sync Consul ServiceIDs consistently 2016-06-10 15:54:39 -04:00
Sean Chittenden
5913acfd69 Rename runChecks to consulAvailable
Apologies in advance for the variable thrash, the fingerprinter is
no longer used to gate whether or not Consul is available any more.
2016-06-10 15:54:39 -04:00
Sean Chittenden
d87c697c87 Update Syncer.Run() to call SyncServices(). 2016-06-10 15:54:39 -04:00
Sean Chittenden
8be79cf28c Add "Service Groups" to the Syncer.
Now the right way to register services with the Syncer is to call
`SetServices(groupName, []*services)`.  This was required to allow
the Syncer to sync either the Client, Server, or Both using a
single Syncer.
2016-06-10 15:54:39 -04:00
Sean Chittenden
a4f605a789 Initialize Consul for the Nomad Agent in a more uniform way.
Decompose Client and Server registration into `setupClient()` and
`setupServer()`, respectively.
2016-06-10 15:54:39 -04:00
Sean Chittenden
802a8c459c Rename command/agent/consul/sync.go to syncer.go 2016-06-10 15:54:39 -04:00
Sean Chittenden
7ad5cd571c Begin leveraging the Agent-level consul.Syncer 2016-06-10 15:54:39 -04:00