New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
Use http://syncthing.net/ or RSync to sync files and MariaDB for SQL
Rsync/Mysql cluster depending what you mean by "webserver"
I did setup the wiki for LES using rsync to sync data between the sifferent locations.
There is a page about the setup @ wiki.lowendguide.com
Feel free to copy it.
There is no DB sync however.
what is your definition of webserver?
a sql database?
some php files?
some normal files?
jeez
Now all files are static so no DB now. But also how I can sync MariaDBs?
If only files, it is too easy. Use rsync for the folders you want to sync (do not sync critical OS folders and files, because each machine is differend and it can brake your configuration).
A simple approach:
rsync -avz /the/directory/you/want/to/sync/* [email protected]:/the/destination/ .
Put this in a cron every 5 minutes or what is working for you.
But first, generate keys to let master connect with slaves without the need of passwords (see this https://digitalocean.com/community/tutorials/how-to-copy-files-with-rsync-over-ssh )
On the other hand, database is more complicated. You cannot just copy files, this will corrupt the database in slave. You have to do periodic db replication for large dbs or dump the database from time to time, transfer it to the slaves and import it there, for smaller databases.
If you need to sync only files, there are different approaches to do this.
You can set up filesystem like tahoe-lafs between servers, or you can use instant sync like syncthing, csync2, lsyncd, lipsyncd.
Rsync and other 1-way copies may not be sufficient if files can be created on the slaves and need to be synced back - upload media on WordPress isn't guaranteed to hit any particular server.
We've tried most of the software @ValdikSS suggested (and Unison too) and recently migrated to GlusterFS with it configured to pull from itself when possible. So far, so good.
There are several approaches to this. It depends of the need (mirroring, 2-way syncing etc.) I thing OP wants a simple approach, without even DB replication.