You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running a Nomad agent in client mode on the same host as a Nomad agent running in server mode causes registration conflicts in Consul. This appears to be a regression of #525. Appreciate that the recommended best practise is to run separate server and client hosts in production, and that an agent can run in both client and server mode at the same time, however this was not an issue with 0.5.6. We run both client and server on the same host in dev (Vagrant VM) to more closely match production where we deploy them to separate instances.
Attempting to start up any further clients will fail as it cannot locate the Nomad server instance using Consul. As I said, this was not an issue in 0.5.6
Nomad Server logs (if appropriate)
vagrant@nomad:~$ sudo nomad agent -config server.hcl
==> WARNING: Bootstrap mode enabled! Potentially unsafe operation.
Loaded configuration from server.hcl
==> Starting Nomad agent...
==> Nomad agent configuration:
Atlas: <disabled>
Client: false
Log Level: DEBUG
Region: global (DC: dc1)
Server: true
Version: 0.6.0rc1
==> Nomad agent started! Log data will stream in below:
2017/07/12 17:49:59 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:10.0.2.15:4647 Address:10.0.2.15:4647}]
2017/07/12 17:49:59 [INFO] serf: EventMemberJoin: nomad.global 10.0.2.15
2017/07/12 17:49:59.125493 [INFO] nomad: starting 1 scheduling worker(s) for [batch system service _core]
2017/07/12 17:49:59 [INFO] raft: Node at 10.0.2.15:4647 [Follower] entering Follower state (Leader: "")
2017/07/12 17:49:59 [WARN] serf: Failed to re-join any previously known node
2017/07/12 17:49:59.133236 [INFO] nomad: adding server nomad.global (Addr: 10.0.2.15:4647) (DC: dc1)
2017/07/12 17:49:59.133793 [DEBUG] server.nomad: lost contact with Nomad quorum, falling back to Consul for server list
2017/07/12 17:49:59.169632 [DEBUG] consul.sync: registered 3 services, 3 checks; deregistered 0 services, 0 checks
2017/07/12 17:50:00 [WARN] raft: Heartbeat timeout from "" reached, starting election
2017/07/12 17:50:00 [INFO] raft: Node at 10.0.2.15:4647 [Candidate] entering Candidate state in term 3
2017/07/12 17:50:00 [DEBUG] raft: Votes needed: 1
2017/07/12 17:50:00 [DEBUG] raft: Vote granted from 10.0.2.15:4647 in term 3. Tally: 1
2017/07/12 17:50:00 [INFO] raft: Election won. Tally: 1
2017/07/12 17:50:00 [INFO] raft: Node at 10.0.2.15:4647 [Leader] entering Leader state
2017/07/12 17:50:00.733153 [INFO] nomad: cluster leadership acquired
2017/07/12 17:50:00.736016 [DEBUG] leader: reconciling job summaries at index: 6
2017/07/12 17:50:03 [DEBUG] memberlist: TCP connection from=127.0.0.1:52444
2017/07/12 17:50:04.533981 [DEBUG] http: Request /v1/status/peers (256.219µs)
Fixes#2827
This is a tradeoff. The pro is that you can run separate client and
server agents on the same node and advertise both. The con is that if a
Nomad agent crashes and isn't restarted on that node in the same mode
its entry will not be cleaned up.
That con scenario seems far less likely to occur than the scenario on
the pro side, and even if we do leak an agent entry the checks will be
failing so nothing should attempt to use it.
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Nomad version
Nomad v0.6.0-rc1 (5187fcf+CHANGES)
Operating system and Environment details
Ubuntu - Vagrantfile: https://github.com/hashicorp/nomad/blob/master/demo/vagrant/Vagrantfile
Issue
Running a Nomad agent in client mode on the same host as a Nomad agent running in server mode causes registration conflicts in Consul. This appears to be a regression of #525. Appreciate that the recommended best practise is to run separate server and client hosts in production, and that an agent can run in both client and server mode at the same time, however this was not an issue with 0.5.6. We run both client and server on the same host in dev (Vagrant VM) to more closely match production where we deploy them to separate instances.
Reproduction steps
sudo nomad agent -config server.hcl
sudo nomad agent -config client1.hcl
/var/log/syslog
to see the deregistration occur in Consulcurl http://127.0.0.1:8500/v1/catalog/services
. Expect to see:Actually see:
Attempting to start up any further clients will fail as it cannot locate the Nomad server instance using Consul. As I said, this was not an issue in 0.5.6
Nomad Server logs (if appropriate)
Nomad Client logs (if appropriate)
Consul Logs
The text was updated successfully, but these errors were encountered: