ec2 instance sync code beteen all slave instance issue

49 Views Asked by At

I am new on ec2. I have one master instance and multiple slave instance. I push the code on master instance then I do rsync between all slave server.

doubt-

1- Does rsync can create any issue. 
2- because first PHP code interpreted then executed..When and where it 
   will happen..and because customer is using it ..can it create any issue to customer
   i mean data loss or anything. 
3- can i do rsync code at any time

Please if you have any documentation or link plz share with me.

1

There are 1 best solutions below

0
On

You will probably be able to use such a rsync-based option without any problems. However in your case I would think about a generalized approach:

Always have your code in version control. When setting up a new server, use some kind of Configuration Management (like Puppet, Chef, Ansible, Salt). With these tools you can easily set up a cluster of identical machines. Use identical checkouts from your VCS on all machines.

Now when you want to deploy your code, you can create a "playbook" or "recipe" that does all the necessary work: log in to all of your machines, check out the latest code from your VCS, render static assets, restart servers etc. This setup allows you to use a more robust and scalable solution that using rsync.