zynesis / lsyncd-aws-autoscaling

Lsyncd auto configuration that works with Amazon Web Services (AWS) Auto Scaling
MIT License
17 stars 5 forks source link

Allow reload of lsyncd config independent of slave change check #1

Open amarnus opened 11 years ago

amarnus commented 11 years ago

Right now, a new lsyncd config - lsyncd.conf.lua is generated only when new slaves have been added/removed from the load balancer. However, it is possible that there is a change in the original config template - lsyncd.conf.lua.template itself or a change in the values for certain parameters in the config.php file (app config) in which case we may want to do a lsyncd config reload independently.

This pull request adds a new file reload_config.php (open to a better name) that can be used for this purpose.

# Generates a new data/lsyncd.conf.lua file 
php reload_config.php
# Generates a new lsyncd conf file & restarts the daemon
php reload_config.php --restart

Have also refactored out three methods in utilities.php:

getSlaves()
setSlaves()
reloadConfig()
uzyn commented 11 years ago

Looks like a good thing to have but would probably be better if it is in the same file as monitor.php with arguments.

amarnus commented 11 years ago

Sure. On it.

Brettk80 commented 10 years ago

Any known reason why syncing would happen to on instance in a LB group and not another? I've tested shh from the master to the box using the pub key setup and it works. Same directory structure, etc.

I have: Master Slave1 Slave2 - created from AMI image of Slave 1

Slave 1 updates, Slave 2 doesnt. They are all in the same LB group; though autoscaling hasnt been configured. Looking at the source though, it doesnt look like it matters that we're not using AutoScaling yet in the test environment.

Any pointers?