1

I am deploying a distributed service which uses an NFS share across a handful nodes. In this scenario, there is a master node which exports an NFS share and a number of slave nodes which must mount this export.

Using chef, I am able to provision the master node. Once the master node is completed, I can provision the slaves in parallel. However, if chef-client kicks off at (roughly) the same time on all nodes, the slaves fail because the NFS share on the server doesn't exist yet.

Using chef, how can I ensure that the provisioning of the master is completed before the slaves start? I suppose it would be acceptable for the slaves to pause (and possibly time out after a few minutes) waiting for the NFS export to be available, though it would be best if I could guarantee that the master was fully provisioned (all recipes/roles) before allowing a chef-client on a slave to proceed.

Jeff W
  • 113
  • 5

1 Answers1

1

In general the best approach is to not ensure it all. Write your recipe code in a way that fails gracefully if dependencies aren't available, and then use chef-client's daemon mode (or run from cron) so it will keep trying as long as needed until it succeeds.

coderanger
  • 836
  • 4
  • 13