Load balancing with rsync

Posted by David on Server Fault See other posts from Server Fault or by David
Published on 2013-11-06T01:03:31Z Indexed on 2013/11/06 3:58 UTC
Read the original article Hit count: 446

Filed under:
|
|
|

i have 2 server with public ip:

SERVER A - 10.10.10.11
SERVER B - 10.10.10.12

both of them are centos 6 in OS, installed nginx with php-fpm, 2 exact same website stored at: /var/www/html.

Domain with: myxdomain.com and dns hosted with cloudflare ( since cloudflare do support round robin ) to point the domain to A record of 10.10.10.11 and 10.10.10.12. I know that round robin dns does not cover the failover or fallover, but it does not matter, what i need is:

How do i sync the both content of /var/www/html server A and server B to be exactly same? Lets say:

1) user uploaded their file to server A, the file content will be sync to server B as well.
2) user uploaded their file to server B, the file content will be sync to server A as well.

rsync will be good choice here? Any example of command line and cronjob time that suitable?

thanks

© Server Fault or respective owner

Related posts about linux

Related posts about dns