Mysql – How to synchronize 2 web server files with load balance

apache-2.2load balancingMySQLvarnish

I need to setup a website with load balance to accommodate more visitors,

I've seen on forums that varnish(balance)->apache(web1&2)->mysql(dbserver) is the way to go.

I know how to setup varnish->single webserver->mysql but not two web server to balance,

But how can I go through on synchronizing both web server content realtime? my custom app allows visitors to post files.

Please advise me on how can I configure this?

My setup.

        (internet)
             |
  (load balance server)
            / \ 
           /   \
 (webserver1) (webserver2)
          \     /
     (database server)

thank you.

Best Answer

If you really need real-time replication of all the files uploaded, you need a distributed file system like GlusterFS or use a DRBD/ocfs2 setup.

Otherwise I would go with csync2 or a simple rsync script.

Related Topic