php - Reloading multiple application servers on deploy -
i have setup there several application servers running php-fpm
service , share glusterfs
mount application code , other assets. in current deploy process, files updated directly on file server , many times reflect changes application service must reloaded. achieve that, deployment script needs every server , issue reload command autoscaling, number of servers not same @ every moment.
overall, working on sketching couple of alternatives solution problem:
first one, more artesanal , not perfect, proof of concept, cron job run every x minutes on application machines , file should contain unique info it's hostname or ip address. if matches, not take action if not, reload , write within file. on deployment procedure, script clear file , servers should reloaded in next cron run.
second, using more sophisticated approach message queue or notification service running applications machine subscribe @ boot time , wait order reload. deploy script publish notification servers aware time. similar cron job previous method notice , reload app server.
would of make sense? there simpler or more standard way trigger broadcast applications servers running @ given moment in deploy procedure without having ssh each , issuing reload command? other advice can provide or other suggestions?
thanks!