Task within a group not on the same Nomad client

Hi everyone,

Nomad Doc define: The group stanza defines a series of tasks that should be co-located on the same Nomad client. Any task within a group will be placed on the same client.

I have three Nomad clients A,B & C.
I run nomad job init to get a example.nomad file, modify the count to 4.
And then run nomad job run example.nomad, but these 4 tasks not run on the same Nomad client.
Is this a bug or I missed any configuration?
My Nomad version is 0.11.3

the count is for the entire task group, not per task :slight_smile:

1 Like

But only one task in example.nomad.
Could you please give me example about both on the same Nomad client and not on the same Nomad client?

the default job placement will binpack the containers. (bunch them up on the same node as much as possible)

you can check up on the spread stanza to make tasks not end up on the same node.

also you could check up on the constraint distinct_hosts to make tasks use distinct hosts.

this much comes to mind for now. I’ll let someone from HashiCorp comment on any other options that could be set :+1:

1 Like