Commit Graph

172 Commits

Author SHA1 Message Date
Charlie Voiselle
1ec6388145 Added service wrapper code (#6220)
This is the basic code to add the Windows Service Manager hooks to Nomad.

Includes vendoring golang.org/x/sys/windows/svc and added Docs:
* guide for installing as a windows service.
* configuration for logging to file from PR #6429
2019-11-11 15:16:07 -05:00
Drew Bailey
c8d60dd6f9 only look up rpchandler for node if we have nodeid
fix some comments and nomad monitor -h output
2019-11-05 09:51:51 -05:00
Drew Bailey
8095b4868a New monitor pkg for shared monitor functionality
Adds new package that can be used by client and server RPC endpoints to
facilitate monitoring based off of a logger

clean up old code

small comment about write

rm old comment about minsize

rename to Monitor

Removes connection logic from monitor command

Keep connection logic in endpoints, use a channel to send results from
monitoring

use new multisink logger and interfaces

small test for dropped messages

update go-hclogger and update sink/intercept logger interfaces
2019-11-05 09:51:49 -05:00
Drew Bailey
12819975ee remove log_writer
prefix output with proper spacing

update gzip handler, adjust first byte flow to allow gzip handler bypass

wip, first stab at wiring up rpc endpoint
2019-11-05 09:51:48 -05:00
Drew Bailey
a828c92403 Display error when remote side ended monitor
multisink logger

remove usage of logwriter
2019-11-05 09:51:48 -05:00
Drew Bailey
91c0184773 Adds AgentMonitor Endpoint
AgentMonitor is an endpoint to stream logs for a given agent. It allows
callers to pass in a supplied log level, which may be different than the
agents config allowing for temporary debugging with lower log levels.

Pass in logWriter when setting up Agent
2019-11-05 09:51:46 -05:00
Mahmood Ali
f010fe22fa Merge pull request #6047 from hashicorp/b-ignore-server-if-disabled
Only warn against BootstrapExpect set in CLI flag
2019-10-29 10:55:44 -04:00
Danielle Lancashire
f72febd0b5 agent: Refactor log setup to support log-to-file 2019-10-07 14:42:32 +02:00
Lang Martin
c65c3fb50d default raft protocol v2 2019-09-24 14:37:55 -04:00
Mahmood Ali
e66239d353 Merge pull request #6250 from hashicorp/f-raft-protocol-v3
Update default raft protocol to version 3
2019-09-04 09:34:41 -04:00
Tim Gross
ab38c1bbea cli: split -dev and -dev-connect flags 2019-08-30 09:33:30 -04:00
Mahmood Ali
ae666bb417 Default raft protocol to version 3 2019-08-28 15:56:59 -04:00
Tim Gross
e145d3ba30 agent: add optional param to -dev flag for connect (#6126)
Consul Connect must route traffic between network namespaces through a
public interface (i.e. not localhost). In order to support testing in
dev mode, users needed to manually set the interface which doesn't
make for a smooth experience.

This commit adds a facility for adding optional parameters to the
`nomad agent -dev` flag and uses it to add a `-dev=connect` flag that
binds to a public interface on the host.
2019-08-14 15:29:37 -04:00
Mahmood Ali
92c369c95e Only warn against BootstrapExpect set in CLI flag
If server.enabled is false, we ought to ignore all other values in
the server stanza.

However, I opted to preserve current error when `--bootstrap-expect` is
passed to the CLI when server is not enabled, to maintain current
behavior.
2019-07-31 03:19:15 -05:00
Chris Baker
fcc6a2ca13 agent config: cleaner VAULT_ env lookup 2019-04-10 10:34:10 -05:00
Chris Baker
20a3884559 docs: -vault-namespace, VAULT_NAMESPACE, and config
agent: added VAULT_NAMESPACE env-based configuration
2019-04-10 10:34:10 -05:00
Chris Baker
5db81957ff wip: added config parsing support, CLI flag, still need more testing, VAULT_ var, documentation 2019-04-10 10:34:10 -05:00
Preetha Appan
fb85d1155d Move logger initialization to earlier step 2019-02-21 12:41:54 -06:00
Preetha Appan
b3b4d7b9a3 cli Ui implementation that logs to a hclogger
This makes it so any messages output to the UI *after* the agent has started
will be logged in json format correctly
2019-02-19 17:53:14 -06:00
Alex Dadgar
95297c608c goimports 2019-01-22 15:44:31 -08:00
Alex Dadgar
f171a723cb Enable json logs 2019-01-11 11:36:37 -08:00
Chris Baker
8a7c09aaab increased config validation coverage for dev mode 2019-01-09 18:56:40 +00:00
Chris Baker
1dc25090a5 move if dev check into config validation, to support dev-mod
validation in the future
2019-01-08 22:21:48 +00:00
Chris Baker
cdcc1db700 refactored config validation into a new method, modified Meta.Client
tests appropriately
2019-01-08 15:07:36 +00:00
Chris Baker
64f591875d moved interp key regex out to a helper function 2019-01-08 00:11:47 +00:00
Chris Baker
31f82895a9 added validation on client metadata keys 2019-01-07 17:16:38 +00:00
Nick Ethier
af3f535f0a agent: suppose filter_default telemetry option 2018-11-19 23:21:48 -05:00
Nick Ethier
4182e3e141 nomad: add flag to disable publishing of job_summary metrics for dispatched jobs 2018-11-19 23:21:19 -05:00
Alex Dadgar
57f40c7e3e Device manager
Introduce a device manager that manages the lifecycle of device plugins
on the client. It fingerprints, collects stats, and forwards Reserve
requests to the correct plugin. The manager, also handles device plugins
failing and validates their output.
2018-11-07 10:43:15 -08:00
Alex Dadgar
e2553a13d4 Fix client reloading and pass the plugin loaders to server and client 2018-10-16 16:56:55 -07:00
Alex Dadgar
260b566c91 server 2018-09-15 16:23:13 -07:00
Alex Dadgar
40d095fd1a agent + consul 2018-09-13 10:43:40 -07:00
Alex Dadgar
9c6de4bb20 plugin dir parsing 2018-08-30 13:43:09 -07:00
Chelsea Holland Komlo
82c096bc60 skip update checking if DisableUpdateCheck is set to true 2018-08-10 13:08:13 -04:00
Chelsea Holland Komlo
b1f60121cc fix reload issue for tls certificates in dev mode 2018-07-05 17:08:31 -04:00
Chelsea Holland Komlo
44bacc3494 remove logic to reload RPC connections from agent 2018-06-08 13:14:40 -04:00
Alex Dadgar
82f7f54fa0 move log line 2018-06-07 15:12:51 -07:00
Chelsea Holland Komlo
db4115a68f fixup! comment and move to always log server reload operation 2018-06-07 17:12:36 -04:00
Chelsea Holland Komlo
f8f89d7490 move logic for testing equality for vault config 2018-06-07 16:23:50 -04:00
Chelsea Holland Komlo
3de3b47829 fix for dynamically reloading vault 2018-06-07 15:34:18 -04:00
Alex Dadgar
2dde49e2bf Improve validation/defaulting, handle start-join
This commit:
* Improves how we combine the old retry-* fields and the new stanza and
how it is validated
* Handles the new stanza setting start_join
* Fixes integration test to not bind to the standard port and instead be
randomized.
* Simplifies parsing of the old retry_interval
* Fixes the errors from retry join being masked
* Flags get parsed into new server_join stanza
2018-05-31 10:53:26 -07:00
Chelsea Holland Komlo
4b20a698ac ensure default value of 30s is set for server_join stanza 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
fa1d2de5df RetryInterval should be a time.Duration 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
023cc2c3b7 set retryInterval and other code feedback 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
b4a0f2cc8c add further configuration validation for server_join 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
0770f03031 update documentation for server_join 2018-05-31 10:50:04 -07:00
Chelsea Holland Komlo
02b89ae0f4 update server_join naming and improve logging 2018-05-31 10:50:03 -07:00
Chelsea Holland Komlo
1a854c444e add server join info to server and client 2018-05-31 10:50:03 -07:00
Alex Dadgar
df70a934b2 Display bind/advertise addresses on agent startup
Sample outputs from demo/vagrant/(server/client1).hcl and `nomad agent -dev` mode

Server:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 192.168.1.75:4646; RPC: 192.168.1.75:4647; Serf: 192.168.1.75:4648
            Bind Addrs: HTTP: 0.0.0.0:4646; RPC: 0.0.0.0:4647; Serf: 0.0.0.0:4648
                Client: false
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true
               Version: 0.8.4-dev
```

Client:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 192.168.1.75:5656
            Bind Addrs: HTTP: 0.0.0.0:5656
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: false
               Version: 0.8.4-dev
```

Dev:

```
==> Nomad agent configuration:

       Advertise Addrs: HTTP: 127.0.0.1:4646; RPC: 127.0.0.1:4647; Serf: 127.0.0.1:4648
            Bind Addrs: HTTP: 127.0.0.1:4646; RPC: 127.0.0.1:4647; Serf: 127.0.0.1:4648
                Client: true
             Log Level: DEBUG
                Region: global (DC: dc1)
                Server: true
               Version: 0.8.4-dev
```
2018-05-22 15:14:33 -07:00
Chelsea Holland Komlo
5b7027d9ec refactor to retryJoiner interface 2018-05-07 16:57:06 -04:00