# Laucnh group only certain node

**URL:** <https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368>\
**Category:** Nomad\
**Created:** [August 4, 2020, 10:41am UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368 "2020-08-04T10:41:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zakabluk](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/zakabluk/32/10146_2.png) [@zakabluk](https://discuss.hashicorp.com/u/zakabluk)\
**Post date:** [August 4, 2020, 10:41am UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/1 "2020-08-04T10:41:45Z")

</div>

I want UP ELK cluster by nomad. I will use separate type servers for every elastic role.  
ELK data and muster will use big server and kibana will use small server.  
How I can tell nomad launch kibana groupe to small server - only?

---

<div class="post-metadata">

**Author:** ![Wolfsrudel](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wolfsrudel/32/28465_2.png) [@Wolfsrudel](https://discuss.hashicorp.com/u/Wolfsrudel)\
**Post date:** [August 4, 2020, 3:13pm UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/2 "2020-08-04T15:13:42Z")

</div>

> **[Express Job Placement Preferences with Affinities | Nomad - HashiCorp Learn](https://learn.hashicorp.com/nomad/advanced-scheduling/affinity)**
>
> Express placement preferences for your jobs using affinities. Affinities act
> like soft constraints, and jobs using them will run even if the affinity can
> not be met.

---

<div class="post-metadata">

**Author:** ![shantanugadgil](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/shantanugadgil/32/923_2.png) [@shantanugadgil](https://discuss.hashicorp.com/u/shantanugadgil)\
**Post date:** [August 4, 2020, 4:20pm UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/3 "2020-08-04T16:20:02Z")

</div>

Although the title says `affinities` you may also want to check out `constraints` (which is also mentioned in the article)

HTH

---

<div class="post-metadata">

**Author:** ![Wolfsrudel](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/wolfsrudel/32/28465_2.png) [@Wolfsrudel](https://discuss.hashicorp.com/u/Wolfsrudel)\
**Post date:** [August 4, 2020, 5:22pm UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/4 "2020-08-04T17:22:41Z")

</div>

Indeed. I thought this site/ doc captures them both. 😊

---

<div class="post-metadata">

**Author:** ![zakabluk](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/zakabluk/32/10146_2.png) [@zakabluk](https://discuss.hashicorp.com/u/zakabluk)\
**Post date:** [August 6, 2020, 7:40am UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/5 "2020-08-06T07:40:07Z")

</div>

THNX it’s true. I used constraint and it’s work.

---

<div class="post-metadata">

**Author:** ![zakabluk](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/zakabluk/32/10146_2.png) [@zakabluk](https://discuss.hashicorp.com/u/zakabluk)\
**Post date:** [August 6, 2020, 3:48pm UTC](https://discuss.hashicorp.com/t/laucnh-group-only-certain-node/12368/6 "2020-08-06T15:48:51Z")

</div>

Hmmm I have now strange situation.  
From my groupe1

> ```
> constraint {
> attribute = "${node.datacenter}"
> value = "dc1"
> distinct_hosts = true
> }
> 
> ```

and from groupe2

> ```
> constraint {
> attribute = "${node.datacenter}"
> value = "dc2"
> distinct_hosts = true
> }
> 
> ```

But now i see that task from groupe1 is spinning on server which has lable dc2.  
Why?  
When I deleted  
distinct\_hosts = true  
My application is started right.
