Commit Graph

234 Commits

Author SHA1 Message Date
James Phillips ea95e8f40d Moves logger setup into its own package. (#2471)
* Moves logger setup into its own package.

* Removes a stray regex mark in the test locator.
2016-11-03 21:14:56 -07:00
James Phillips 18926728d4 Supports WAN and LAN Serf Bind Addresses. (#2468)
* * adding cli config and config file support for specifying the serf wan and lan bind addresses
* updating documentation for serf wan and lan options
Fixes #2007

* Cleans up some small things from #2380.

* Uses the bind default for the agent test for Serf WAN and LAN.
2016-11-03 12:58:58 -07:00
Kyle Havlovitz a8215f4e2f Merge pull request #2459 from hashicorp/f-aws-autodiscovery
AWS -retry-join-ec2 option
2016-11-03 13:27:23 -04:00
Kyle Havlovitz 1e2ca107c2
Small tweaks to docs and syntax 2016-11-03 13:04:42 -04:00
Kyle Havlovitz 169cae2203 Disallow -bootstrap-expect flag in dev mode (#2464) 2016-11-03 01:54:43 -04:00
Kyle Havlovitz a3af480c42
Add support for ECS task roles as an auth mechanism 2016-11-02 18:48:15 -04:00
Kyle Havlovitz b9aa912e4c
Move EC2 discovery logic into retryJoin for robustness 2016-11-02 14:35:37 -04:00
Kyle Havlovitz f212329cc6
Support more forms of EC2 authentication 2016-11-01 21:24:18 -04:00
Kyle Havlovitz 0499784b94
Fixed up config structure for EC2 discovery 2016-11-01 17:58:51 -04:00
Kyle Havlovitz 9aa0261c1c Merge branch 'master' of github.com:hashicorp/consul into aws_autodiscovery 2016-11-01 11:19:52 -04:00
Kyle Havlovitz 10c5f11315 Retry periodically for 60s if syslog setup fails (#2455) 2016-10-31 17:24:00 -07:00
Adam Wolfe Gordon ae5bd0f2cc agent: Stop reaping child processes (resolves #1988)
The consul docker image now uses dumb-init to reap child processes, so
there's no need to reap them ourselves.
2016-10-04 09:36:41 -06:00
James Phillips aed72ccc60 Merge pull request #2263 from sweeneyb/dnsPort
Add support for dns port as a command line option
2016-09-01 22:16:15 -07:00
James Phillips d419a0ae0d
Changes default for `leave_on_terminate` based on server or client mode. 2016-08-31 23:39:11 -07:00
sweeneyb e8117ba622 Add support for dns port as a command line option 2016-08-10 04:05:56 +00:00
James Phillips 4a7b55c8cb Fixes startup version print to show the human version. 2016-07-20 08:09:05 -07:00
James Phillips 9816c995bd Adds version info back into the config.
In #2191 I accedentally broke SCADA by not populating the agent's version
information into the config structure. This adds it back, and makes the
distinction between the raw parts we send to APIs and the human form of
the version that we display.
2016-07-19 18:38:15 -07:00
James Phillips 51fbad91fd Merge pull request #2193 from hashicorp/pr-2188-slackpad
Adds Circonus support for telemetry metrics.
2016-07-19 17:15:29 -07:00
James Phillips 53877aa260 Makes sure version is always displayed consistently. 2016-07-19 15:06:32 -07:00
richard.hulm f11a0145ab RH: Add revision (if it exists) 2016-07-19 10:04:56 +01:00
matt maier 87e29fd709 fix: typo coupled, default token app to "consul", switch submit_interval/SubmitInterval to submission_interval/SubmissionInterval 2016-07-18 15:46:11 -04:00
matt maier c5a6cb8b4c Add Circonus support for Telemetry metrics 2016-07-18 09:34:43 -04:00
richard.hulm c2b78eac7d Add the version (from config) to the Starting Consul Agent printout 2016-07-18 10:01:16 +01:00
Ryan Uber 62d0edbdd4 Merge pull request #1847 from mssola/dc-to-datacenter
[proposal] command: deprecated the -dc flag in the agent CLI
2016-07-05 13:01:51 -07:00
Jeff Mitchell e061d89fe9 Use upstream high-level SCADA provider 2016-06-01 18:25:39 -04:00
Justin Lambert 1c8d20ba6a allow automatically discovering aws ec2 consul servers 2016-05-11 19:41:41 -06:00
Sean Chittenden b34b1f85aa Include the current version along side the available version.
When checkpoint emits a log message indicating an agent is out of
date, include the current version along with the available version
according to checkpoint.

Inspired by: log output in #993
2016-05-04 22:57:44 -07:00
James Phillips 79153c3014 Merge pull request #1884 from mtchavez/1541-data-dir-perms
command: Data directory permission error message
2016-04-12 22:06:49 -07:00
James Phillips 07e7d551f9 Removes a bogus warning for Windows. 2016-04-05 18:04:23 -07:00
Sean Chittenden 80cfe3d1ab Clean up verifyUniqueListners
The first pass over this was a hackjob in the sense that it was not elegant.  Fixed.

Pointed out by: subcionscious in the middle of the night
2016-04-04 11:03:49 -07:00
Chavez 10f297e8fc command: Data directory permission error message
* Check for invalid data directory permissions
* Display appropriate permissions error message
* Add command test for bad data directory permissions
2016-04-01 19:17:38 -07:00
Sean Chittenden fca71e1974 Rely exclusively on error to signal failure
Pointed out by: slackpad
2016-04-01 10:34:45 -07:00
Sean Chittenden 4660cb969f Print a helpful message re: duplicate addresses
IP sockets provide nice endpoints where the kernel will fail to bind and will error out saying socket already in use.  UNIX sockets, however, don't enjoy this nice property when cleaning up stale sockets on listen.  Given the number of addresses in Consul, provide operators with a helpful message that indicates the source of the reused address.

Before this fix, it was possible for the HTTP socket to unlink the RPC socket, leading to confusing blocked behavior when running commands like `consul info`.

```
% cat tmp.config.json
{
    "addresses": {
	"http": "unix:///tmp/.consul.sock",
	"rpc": "unix:///tmp/.consul.sock"
    },
    "unix_sockets": {
	"mode": "0700"
    }
}
% consul agent -config-file tmp.config.json -advertise=127.0.0.1 -data-dir=/tmp/
==> All listening endpoints must be unique: HTTP address already configured for RPC
Exit 1
```
2016-04-01 10:20:45 -07:00
Sean Chittenden 9eaffc456f skip_leave_on_int's default changes based on agent mode
`skip_leave_on_int`'s behavior now changes based on whether or not the agent is acting as a client or server.

Fixes: 1687
2016-03-31 17:45:14 -07:00
Sean Chittenden 08aa037dd3 Guard against a node name containing pure whitespace for real 2016-03-31 15:10:19 -07:00
Sean Chittenden faa2aa4436 Guard against a node name containing pure whitespace 2016-03-31 15:02:58 -07:00
Sean Chittenden c03d025903 Node names are not allowed to be empty 2016-03-31 14:47:55 -07:00
Sean Chittenden a29f6e8c8f Allow adjusting the number of DNS records in a response...
Based on work done by @fusiondog in #1583, extend the concept to use an integer instead of a boolean.

Fixes: #1583 && #1481
2016-03-29 19:23:56 -07:00
Hrishikesh Barua bcca7efe83 Added help text for -dev option #1804 2016-03-21 17:27:57 +05:30
Miquel Sabaté Solà 314a0913e2 command: deprecated the -dc flag in the agent CLI
The `-dc` flag from the agent CLI command has been deprecated in favor of
`-datacenter`. This is done this way because:

- Other CLI commands used `-datacenter`. See: event, exec and watch.
- The agent configuration file uses `datacenter`.

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
2016-03-18 15:44:35 +01:00
James Phillips a599e88507 Merge pull request #1284 from nbrownus/telemetry
Option to disable hostnames from telemetry
2016-02-06 22:00:14 -08: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
Nate Brown 541a98c9c7 Option to disable hostnames from telemetry 2016-01-29 13:44:48 -08:00
Seth Vargo dc9131a732 Use HTTPS + www. where appropriate 2016-01-13 17:44:01 -05:00
James Phillips b21ef7330f Merge pull request #1592 from hashicorp/b-reap
Adds support for the reap lock.
2016-01-13 09:37:54 -08:00
James Phillips d22fe5ba62 Adds support for the reap lock. 2016-01-12 21:10:25 -08:00
Matt McCoy f8a6b6db83 Add consul agent help for advertise-wan 2016-01-11 14:27:54 -05:00
Ryan Uber ce4cf8a542 consul: dev mode works 2015-12-26 20:19:36 -05:00
Ryan Uber 52ad989405 agent: static UI is configurable 2015-12-24 22:21:34 -05:00
James Phillips d71036c4f0 Moves logger down where it's used for reaping. 2015-12-22 10:29:55 -08:00
James Phillips e1d456a079 Changes sense of option to "reap" and uses nil for "not set". 2015-12-22 10:28:10 -08:00
James Phillips 1e4aa28c9d Adds child process reaping when Consul is running as PID 1. 2015-12-21 21:47:35 -08:00
James Phillips b87aeec4e1 Removes the GOMAXPROCS warnings which are obsolete for Go 1.5+. 2015-11-25 17:59:16 -08:00
talwai 01ccad69a1 Kill unused import in command.go 2015-11-13 11:14:15 -05:00
talwai e6e842d9e7 Add DogStatsd configuration 2015-11-11 14:30:36 -05:00
Ryan Uber aba1b26015 agent: consolidates data dir checker 2015-10-15 14:21:35 -07:00
Ryan Uber 2a7609d6bc agent: remove migrator, refuse to start if mdb dir found 2015-10-15 14:15:08 -07:00
Ryan Breen a013095f62 Merge pull request #1167 from railsguru/master
Add -http-port option to change the HTTP API port
2015-09-02 01:15:55 -04:00
Ryan Uber d6b71de3f4 agent: reload SCADA client if endpoint changes 2015-08-27 13:29:07 -07:00
Ryan Uber 5bd7a5f239 command: atlas endpoint can be passed 2015-08-27 11:11:05 -07:00
Ryan Uber 00d78963bf agent: log a message when making a new scada connection 2015-08-25 21:03:16 -07:00
Ryan Uber 33cadcf925 agent: don't reload scada client if there is no config change 2015-08-25 20:43:57 -07:00
Ryan Uber e3cd2f2c0d agent: clean up scada connection manager 2015-08-25 18:27:07 -07:00
Ryan Uber 1378fd93b0 agent: scada client and HTTP server are tracked separately 2015-08-25 16:59:53 -07:00
Andy Lo-A-Foe 3d133ab78c Use Ports.HTTP directly 2015-08-20 20:27:20 +02:00
Andy Lo-A-Foe 7e2ecf6a3c Add documentation for http-port option 2015-08-20 20:19:35 +02:00
Andy Lo-A-Foe 7a3da7db26 Add -http-port option to change the HTTP API port
This is useful when pushing consul to PaaS like
Cloud Foundry making the HTTP API easily routable.
2015-08-11 14:14:21 +02:00
Ryan Uber 359abdb9a8 agent: don't replace config on SIGHUP if parsing fails 2015-05-30 22:50:24 -07:00
Ryan Uber b5cd115795 agent: flush progress info to console during migrations 2015-05-19 18:47:44 -07:00
Ryan Uber 704f6343c3 agent: log a message when data migrations start 2015-05-12 12:58:44 -07:00
Cameron Ruatta 0b9bc7d2f5 Adding documentation about specifying multiple configuration directories 2015-05-11 10:19:04 -07:00
Armon Dadgar 0e9718247d command/agent: Lowercase DC. Fixes #761 2015-05-05 13:56:37 -07:00
Armon Dadgar efaed93b91 Merge pull request #816 from pepov/master
Support different advertise address for WAN gossip
2015-05-04 15:40:25 -07:00
Ryan Uber 94f0834d8f agent: allow configuring the stats prefix 2015-05-03 16:46:20 -07:00
Ryan Uber 1fad389f23 agent: Don't attempt migration on new server 2015-04-10 19:41:09 -07:00
Ryan Uber 8ebee678cc Merge pull request #857 from hashicorp/f-boltdb
Raft uses BoltDB
2015-04-10 18:30:07 -07:00
Ryan Uber 4f4f5fa7d5 command: automatically migrate raft data on start 2015-04-09 23:00:20 -07:00
pepov 8da6d4f065 add and test -advertise-wan cli flag 2015-03-28 16:08:19 +01:00
Johannes 'fish' Ziemke 78cde71a22 Add -domain command line flag to agent
This makes it possible to configure the domain on the command line
additionally to the config file.
2015-03-20 16:05:41 +01:00
Ryan Uber f7d1397bba command: clarify -recursor agent arg 2015-02-23 09:33:45 -08:00
Mohammad Zolfaghari fec46d0559 Support multiple recursor flag 2015-02-21 10:15:52 +03:30
Ryan Uber a9f23a9154 agent: Better warning for keyring with -encrypt option. Fixes #718. 2015-02-19 18:51:42 -08:00
Ryan Breen 53afd77e2d s/data center/datacenter/g 2015-02-19 17:45:47 -05:00
Armon Dadgar 7ddf87eb54 agent: Rename AtlasCluster to AtlasInfrastructure 2015-02-18 15:12:15 -08:00
Armon Dadgar 524bfccc5a agent: Adding atlas_join configuration 2015-02-18 15:12:14 -08:00
Armon Dadgar 948f9a0d00 agent: SCADA HTTP listener 2015-02-18 15:12:14 -08:00
Armon Dadgar 08895ce325 agent: Starting SCADA integration 2015-02-18 15:12:14 -08:00
Armon Dadgar 49d11e37f7 agent: Adding Atlas CLI flags 2015-02-18 15:12:14 -08:00
Armon Dadgar 60f69224ea agent: Snapshot and restore health state on reload. Fixes #693 2015-02-17 12:00:04 -08:00
lalyos 865e97c340 fixing version numbers RCs should be labeled x.x.x-rcx
see conversation with ryanuber: https://github.com/hashicorp/go-checkpoint/issues/2#issuecomment-73199209
2015-02-09 08:17:30 +01:00
Ryan Uber c01277725a agent: beginning socket user/group/mode support as discussed in #612 2015-01-20 13:44:27 -08:00
Ryan Uber 49127722ec Merge pull request #610 from dave-tucker/bug/609
Don't forget to Shutdown the DNS Server!
2015-01-16 16:46:37 -08:00
Dave Tucker f026b8781e Don't forget to Shutdown the DNS Server!
Fixes #609

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2015-01-17 00:30:53 +00:00
Ryan Uber 263614d596 agent: error if binding to existing socket file 2015-01-16 12:39:15 -08:00
Ryan Uber 61d2f71d14 agent: only ignore errors on IsNotExist() 2015-01-16 09:14:52 -08:00
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