Active/passive deployment with nomad

124 views
Skip to first unread message

Mircea Mihai Costache

unread,
Mar 26, 2018, 7:21:34 AM3/26/18
to Nomad
Hi guys,
Noob question here:

I have a process (heketi) that I want to run on one node and if that node fails start it on a secondary node.
I have done this with consul services(for other services that needs to talk with heketi); consul KV to dump and restore heketi db and with a cron script that checks the health of primary node

I would like to have these 2 nodes in nomad and define 1 service that always needs to be up (use the checks from consul), if primary goes down to  start service on the secondary node and start to dump db from that node and also make sure will not start on primary without manual intervention

Thanks, 

Chelsea Komlo

unread,
Mar 26, 2018, 8:39:24 AM3/26/18
to Mircea Mihai Costache, Nomad
Hi Mircea,

Thanks for the email, noob questions are always welcome!

Have you taken a look at Nomad service jobs? https://www.nomadproject.io/docs/job-specification/service.html These might be a good fit for what you describe. You can set the total count for the job, which in this case seems to be 1.

Nomad constraints are also worth taking a look at, if this service should be constrained to run on particular nodes: https://www.nomadproject.io/docs/job-specification/constraint.html

As far as using the health status from the consul health check, take a look at the check_restart stanza: https://www.nomadproject.io/docs/job-specification/check_restart.html

Let us know if there is anything else we can help with,
Chelsea

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/nomad/issues
IRC: #nomad-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Nomad" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nomad-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nomad-tool/7b5b0453-6335-4279-a5f1-550f59b0a36c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages