Load balancing with rsync
- by David
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