-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NOMAD_ALLOC_INDEX is 0 on all nodes when using system scheduler. #1851
Comments
Hey, This is currently the desired behavior. The allocation index is used to indicate the instance out of a desired count size. System jobs do not have an explicit count but are based more on the size of a the targeted cluster, making the index less informative. I'm curious what you have in mind for the index. Further there is an associated cost with making it a monotonically increasing counter (need to store additional meta data) and I am not sure of the benefit. |
I was trying to use the allocation index to get separate host names for each instance via consul. I need this because the service needs host names/addresses of all nodes that are going to be part of the cluster in advance (zookeeper is the culprit). I also want to wait until all instances are up before I start dependent services, and checking for |
@siffiejoe I've been helping @smuthali with zookeeper as well, and he got something working out of that, perhaps drop by the gitter channel and give him a poke? :) |
@siffiejoe I think you could accomplish that by using I am going to close this issue as it is desired behavior. Hope you get the help you need from @jippi and @smuthali Best, |
a hack is to have a docker entrypoint that echo ${NOMAD_ALLOC_INDEX} into the required file :) |
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. |
Nomad version
Nomad v0.4.0
Operating system and Environment details
Issue
Two different nodes get the same allocation index (0) when using the system scheduler.
Reproduction steps
Create a nomad cluster of at least two nodes, copy the following script onto all nodes as
/tmp/x.sh
and run the job script below.All (both in my case) print the same allocation index (i.e. 0).
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: