help with solution to keep 2 servers in sync

From: Pete K. (pkhalil_at_signaturesnetwork.com)
Date: 12/10/04


Date: Fri, 10 Dec 2004 19:39:55 GMT


--------------------------------------------------------------------------------

I tend to feel this is the wrong solution to the problem at hand and would
like to get input from others before I continue heading down the path I was
told to take.

Setup
we have 1 webserver for our back end PHP processing
running apache 1.3.3
PHP 4.3.9
Mysql 4.0.20 Master (admin server) -> Master ->Slave (localhost) mysql setup

2 proxy servers running apache 2 and mod_proxy to cache static files

An admin server that is rsync'd to the production server every 5 min
(content manager's upload content through the main admin)

A staging server used to rsync files to the live site (used to put up code,
graphics ect...)

The goal is to add a second webserver to the setup and round-robin the load
on to the two boxes.

The Issue
Files need to stay in sync across the 2 webservers. This includes files that
may be uploaded by users through script, as well as files uploaded through
the staging server (rsync'd up, not really an issue) and files uploaded by
admins on the admin server. This also includes keeping config files, tmp
files, files moved or otherwise changed, sync'd between the 2 servers.
Using an NFS mount isn't an option.

The proposed solution
Go through all scripts, find any case that may some how change a file
weather it be a copy, delete, chmod, fwrite so on and so on, and log each
into a table with the file name and action to take. The server admin will
then have a script that runs every few seconds and checks the table,
performs an rsync based on the action then deletes the row.

There is a lot of code to go through, a lot of user interactivity that
touches a lot of files, and while I've written most of it, we do use third
party open source software such as php groupware and others that contain a
lot of code I have generally not even looked at.

I tend to think there is a better solution on the server side, but have a
pretty tight deadline to make all these changes, so I have not had much time
to research. I strongly feel that I'm being led down the wrong path, and
would like any suggestions or ideas that anyone can offer.



Relevant Pages

  • mysqli error?
    ... I'm just setting up my php enviroment and I typed in a simple script ... # configuration directives that give the server its instructions. ...
    (comp.lang.php)
  • Re: How do we get there from here?
    ... >> executing on the server as a pre-processor. ... If there are client side versions of PHP, ... > name implies a static text file, is it different from a PHP script? ...
    (comp.databases.pick)
  • Re: Apache: limiting the execution place
    ... They want it so users can't use FTP, shell, or a CGI or PHP script to view, ... other users via shell, FTP, web server processes (such as PHP or CGI ...
    (Security-Basics)
  • Re: PHP chmod Newbie Question
    ... How does the server keep ... how do I create user groups for chmod to recognize? ... CHMOD is for UNIX based servers, and the PHP chmod() ... edited or removed by the PHP script, and only read by the UNIX ...
    (comp.lang.php)
  • Re: PHP in html
    ... additional calls to the server, ... to invoke a script handler for every single image. ... configuration of the webserver and the PHP interpreter. ... If you think interpreting all pages as PHP ...
    (comp.lang.php)