Commit Graph

189 Commits

Author SHA1 Message Date
Ryan Uber ad19c0afc2 agent: beginning refactor 2015-01-16 00:45:03 -08:00
Jeff Mitchell f88536f192 Remove unnecessary ClientListenerAddr function. Rework config test functions to be cleaner. Start of runtime tests.
This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>
2015-01-14 19:31:21 +00:00
Jeff Mitchell 400eadd671 RPC and HTTP interfaces fully generically-sockified so Unix is supported.
Client works for RPC; will honor CONSUL_RPC_ADDR. HTTP works via consul/api;
honors CONSUL_HTTP_ADDR.

The format of a Unix socket in configuration data is:
"unix://[/path/to/socket];[username or uid];[gid];[mode]"

Obviously, the user must have appropriate permissions to create the socket
file in the given path and assign the requested uid/gid. Also note that Go does
not support gid lookups from group name, so gid must be numeric. See
https://codereview.appspot.com/101310044

When connecting from the client, the format is just the first part of the
above line:
"unix://[/path/to/socket]"

This code is copyright 2014 Akamai Technologies, Inc. <opensource@akamai.com>
2015-01-14 19:31:21 +00:00
Ryan Uber 33bd157a61 agent: separate service and check loading/unloading concerns 2015-01-07 22:01:20 -08:00
Ryan Uber 4f14ba6326 agent: allow config reload to modify checks/services persistence
This change consolidates loading services and checks from both config
and persisted state into methods on the agent. As part of this, we
introduce optional persistence when calling RemoveCheck/RemoveService.

Fixes a bug where config reloads would kill persisted services/checks.
Also fixes an edge case:

1. A service or check is registered via the HTTP API
2. A new service or check definition with the same ID is added to config
3. Config is reloaded

The desired behavior (which this implements) is:

1. All services and checks deregistered in memory
2. All services and checks in config are registered first
3. All persisted checks are restored using the same logic as the agent
   start sequence, which prioritizes config over persisted, and removes
   any persistence files if new config counterparts are present.
2014-11-26 12:46:42 -08:00
Ali Abbas ecac719bb8 fix Sprintf formatting 2014-11-25 20:06:33 +01:00
Ryan Uber fe119a1bd2 agent: prefer config over persisted services/checks (#497) 2014-11-24 19:40:53 -08:00
Ryan Uber a675b5faae agent: fix gossip encryption detection 2014-11-19 16:37:40 -08:00
Ryan Uber c9118b53bf agent: fix loading keyring on agent start 2014-11-19 16:37:40 -08:00
Ryan Uber 196cbd27b2 agent: ignore -encrypt if provided when keyring exists 2014-11-19 16:37:40 -08:00
Ryan Uber d02afd42fb agent: -encrypt appends to keyring if one exists 2014-11-19 16:36:01 -08:00
Ryan Uber 295f876923 command/agent: fix up gossip encryption indicator 2014-11-19 16:35:37 -08:00
Ryan Uber c59107f08e command: remove -init argument from keyring, auto-persist keyrings when using agent -encrypt 2014-11-19 16:35:13 -08:00
Ryan Uber a9f3cbd7f0 command: various cleanup 2014-11-19 16:31:06 -08:00
Ryan Uber 6609cb680b command: use separate key files for LAN/WAN 2014-11-19 16:31:06 -08:00
Ryan Uber a36ab53f25 agent: move keyring initialization out of agent, add -init option to keys command 2014-11-19 16:31:06 -08:00
Ryan Uber 3e64ed70df agent: clean up keyring file implementation 2014-11-19 16:31:06 -08:00
Ryan Uber 2e92e19760 agent: refactor keyring loader 2014-11-19 16:31:06 -08:00
Ryan Uber 61e3647ac1 command: warn when passing -encrypt when keyring already exists 2014-11-19 16:30:21 -08:00
Ryan Uber 208b5ae58f command: create serf dir if it doesn't exist, document -disable-keyring arg 2014-11-19 16:30:21 -08:00
Ryan Uber 8a4ed84711 consul: first pass at keyring integration 2014-11-19 16:30:20 -08:00
Armon Dadgar dd41c69389 Merge pull request #478 from amalaviy/https
Added HTTPS support via a new HTTPS Port configuration option
2014-11-19 11:17:10 -08:00
Atin Malaviya 2bd0e8c745 consul.Config() helper to generate the tlsutil.Config{} struct, 30 second keepalive, use keepalive for HTTP and HTTPS 2014-11-18 17:56:48 -05:00
Atin Malaviya 46178dbb37 Change names to StartJoinWan, RetryJoinWan etc 2014-11-17 17:14:59 -05:00
Atin Malaviya 59a68ecc26 Added HTTPS support via a new HTTPS Port configuration option similar to the HTTP Port. 2014-11-17 14:29:35 -05:00
Atin Malaviya df8d099f49 Add start-wan-join, retry-wan-join and related configuration options and commandline options 2014-11-14 10:56:39 -05:00
foostan 4d8f1c2133 Add multiple recursor definition support 2014-11-01 04:26:26 +09:00
Ryan Uber 5324e71cec agent: Filter messages logged to syslog. Fixes #272 2014-10-13 22:38:12 -07:00
Armon Dadgar 2c1add1c67 Merge pull request #396 from ryanuber/f-retry-join
agent: Retry failed joins on agent start
2014-10-13 10:46:10 -07:00
Ryan Uber b78e063ea7 command: formatting 2014-10-12 12:45:40 -07:00
Ryan Uber 1ec68be726 command/agent: add help for retry join 2014-10-12 12:35:25 -07:00
Ryan Uber 0266592205 agent: first pass at join retry 2014-10-12 10:50:15 -07:00
Anton Lindström 7f8f3c8edc Remove redundant assignment 2014-09-29 14:22:31 +02:00
Armon Dadgar 2067cc32dd agent: Fixing issue with multiple watches. Fixes #337 2014-09-15 10:56:04 -07:00
Armon Dadgar a1591d21d7 agent: Support for checkpoint 2014-09-02 14:23:43 -07:00
Armon Dadgar 55c695493b agent: Address overrides. Fixes #301 and #253 2014-09-02 12:47:40 -07:00
Armon Dadgar 47e30adf13 agent: statsd support. Fixes #247 2014-09-02 11:26:17 -07:00
Armon Dadgar 168ddedcee agent: Support encrypt CLI flag. Fixes #245. 2014-08-22 15:08:15 -07:00
Armon Dadgar f82a38ab12 agent: First pass at agent-based watches 2014-08-21 13:09:13 -07:00
Armon Dadgar 358b473e01 Updating documentation for new bootstrap method 2014-07-01 15:02:26 -07:00
Armon Dadgar 80b86c9ee9 Rename Expect to BootstrapExpect. Fixes #223. 2014-06-19 17:08:55 -07:00
Robert Xu a2fea2ce55 Utilise new raft.SetPeers() method, move expect logic to leader.go.
This way, we don't use EnableSingleMode, nor cause chaos adding peers.

Signed-off-by: Robert Xu <robxu9@gmail.com>
2014-06-18 12:03:30 -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 4f77db2d47 agent: Watch reload channel for trigger 2014-06-11 10:53:28 -07:00
Armon Dadgar 1021f48ad2 agent: Set custom syslog facility. Fixes #170. 2014-06-11 10:28:55 -07:00
Armon Dadgar bd39973df1 agent: Validate datacenter is valid. Fixes #169. 2014-06-09 11:57:15 -07:00
Armon Dadgar dea2eba631 agent: Support stale queries with retries 2014-06-08 16:02:17 -07:00
Armon Dadgar 39cdecb5d0 agent: Add version to info output 2014-06-06 14:40:22 -07:00
Armon Dadgar 5fa10c912e Support rejoin after leave. Fixes #110. 2014-05-21 12:32:24 -07:00
Armon Dadgar 9f2631f383 agent: syslog support. Fixes #105. 2014-05-21 12:06:03 -07:00
Armon Dadgar 03713e1eb3 agent: Provide log info about encryption. Fixes #151. 2014-05-20 17:00:04 -07:00
Armon Dadgar 14a84f4a4f agent: Support -advertise cli flag. Fixes #156. 2014-05-16 10:49:55 -07:00
Carlos Diaz-Padron b61e854f56 Return pid file errors and fix help formatting 2014-05-06 13:04:22 -04:00
Carlos Diaz-Padron e0d477896a Add flag to agent to write pid file 2014-05-05 23:39:18 -04:00
Armon Dadgar 32889c2f70 agent: Pass UiDir into the HTTP layer 2014-04-30 23:43:56 -04:00
Armon Dadgar 9327bbc400 agent: Adding -ui-dir CLI flag 2014-04-30 23:43:56 -04:00
Armon Dadgar 9493b9c126 agent: Add warning if windows and running server mode 2014-04-14 16:49:50 -07:00
Armon Dadgar 32eb65316f agent: Adding support for -join flag. Fixes #33. 2014-04-11 16:59:16 -07:00
Armon Dadgar 360158590e agent: Nice info output 2014-04-11 15:54:03 -07:00
Armon Dadgar 2663b28f3a agent: First pass at improving flags 2014-04-11 15:22:35 -07:00
Armon Dadgar 4a2b7e5e39 agent: Use EnableDebug to control adding pprof HTTP endpoints 2014-03-19 17:50:57 -07:00
Armon Dadgar 46a2c37852 agent: Support protocol version setting 2014-03-09 15:57:03 -07:00
Armon Dadgar fd1d00105e agent: Disallow bootstrap mode when a client. Fixes #3 2014-02-22 18:58:15 -08:00
Armon Dadgar 6898f23d2d agent: Adding a check for GOMAXPROCS. Fixes #10. 2014-02-22 17:43:12 -08:00
Armon Dadgar 85091090c6 agent: Switch to -data-dir, better error if missing. Fixes #2. 2014-02-22 17:34:57 -08:00
Armon Dadgar f7a4241097 agent: Copy the help text 2014-02-20 16:26:39 -08:00
Armon Dadgar 981e58e8e9 agent: Adding support for statsite telemetry 2014-02-20 14:59:54 -08:00
Armon Dadgar 46830a3c8f agent: Enable dumping telemetry on SIGUSR1 2014-02-20 13:51:51 -08:00
Armon Dadgar c200b63204 website: updating documentation on commands 2014-02-18 17:32:13 -08:00
Armon Dadgar fb34815562 agent: adding ability to reload services and checks 2014-02-07 12:19:56 -08:00
Armon Dadgar a63f060fff agent: Adding some primitive config reloading 2014-02-07 12:03:14 -08:00
Armon Dadgar 5cc0c73f89 TODO cleanups 2014-02-05 14:54:35 -08:00
Armon Dadgar 3eff9587a5 agent: Adding CLI flags 2014-02-05 13:30:40 -08:00
Armon Dadgar 2553c7b963 agent: First pass at parsing service and check definition 2014-02-03 15:15:35 -08:00
Armon Dadgar 1ebb6db8c1 Seperate localState from Agent 2014-01-21 11:52:25 -08:00
Armon Dadgar fc2e2927b7 Accept command line advertise addr 2014-01-20 15:17:12 -10:00
Armon Dadgar 7a74f58141 First pass at local state + anti-entropy 2014-01-15 15:14:50 -10:00
Armon Dadgar e2e844a70b Support DNS recursion and TCP queries 2014-01-03 15:43:35 -08:00
Armon Dadgar 900dd41a89 Domain pass through 2014-01-02 15:51:40 -08:00
Armon Dadgar 40a50780d3 Start DNS server, change logs, add SOA records 2014-01-02 15:10:13 -08:00
Armon Dadgar c4744d11c8 Rename HTTP server method 2014-01-02 11:45:58 -08:00
Armon Dadgar ce79f27364 Adding support for advertise address 2013-12-31 16:45:13 -08:00
Armon Dadgar 6ca0d9d0db Start the RPC server with the agent 2013-12-30 15:27:41 -08:00
Armon Dadgar 69ed0ec184 Adding a bootstrap flag to allow single server raft 2013-12-24 16:48:07 -08:00
Armon Dadgar b3e7bced05 Add Datacenter to output 2013-12-24 12:22:50 -08:00
Armon Dadgar 5e7e23dc52 Working on Agent HTTP interface 2013-12-23 11:38:51 -08:00
Armon Dadgar a0030308e7 Working on the agent 2013-12-20 16:39:32 -08:00
Armon Dadgar d9a1fb02a1 Agent skeleton 2013-12-19 17:14:46 -08:00
Armon Dadgar cb659a3b77 Adding agent skeleton 2013-12-19 12:18:06 -08:00