Best practice for cluster nodes

47 views
Skip to first unread message

Cev Ing

unread,
Sep 6, 2017, 8:00:36 AM9/6/17
to Ansible Project
I have several clusters containing several nodes. I want to run configuration jobs on all cluster nodes. The configuration jobs involve a small down time of the cluster node. I have to take care, that at least a minimum number of nodes in each cluster is still running. What is the best practice to achieve this?

I found an option in Ansible to limit the total number of simultaneous connections. But this does not help, because I need simultaneous connections per cluster.

Another way is to put all nodes of each cluster in groups: First the group of all first cluster members, second the group of all second cluster members and so on. This would make it possible to apply the configuration role to each group. But this is still not exactly what I am looking for, because this serializes the cluster nodes more than necessary. If I have 10 nodes per cluster and I want to keep at least 50% of all nodes running, it would be possible for Ansible to process 5 nodes in parallel.

What is the best practice for Ansible to handle cluster nodes?

Dick Davies

unread,
Sep 8, 2017, 1:39:35 PM9/8/17
to ansible list
Have you seen the serial: argument to plays?

http://docs.ansible.com/ansible/latest/playbooks_delegation.html#rolling-update-batch-size

That's intended for working on a 'chunk' of N servers in a given group at once.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/adb8ddab-4973-41a9-91e9-519d9777e92f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Cev Ing

unread,
Sep 12, 2017, 10:01:18 AM9/12/17
to Ansible Project

Am Freitag, 8. September 2017 19:39:35 UTC+2 schrieb Dick Davies:
Have you seen the serial: argument to plays?

No. Thanks for the link!

rhys.jame...@googlemail.com

unread,
Sep 16, 2017, 1:42:45 PM9/16/17
to Ansible Project
I had a similar issue with a cassandra cluster recently. Serial wasn't really a workable option for me but I found an alternative solution using delegate_to. I did a write up of it here; http://www.youdidwhatwithtsql.com/staged-service-restart-ansible/2337/

Rhys
Reply all
Reply to author
Forward
0 new messages