I have been digging around and can't really figure out which software can synchronize files automatically to other web servers. Just like Facebook. they have many servers but when you upload something, it's accessible from almost every server. I need like to synchronize a new file that has been added from the current server to other servers, so that they have the same file as it is on the current server.
-
Look into using something like rsyncd– Raman SailopalCommented Oct 25, 2017 at 8:42
-
doesnt work automatically– DennisrecCommented Oct 25, 2017 at 8:43
-
1Another options is disk level read/write replication other the network i.e. through drbd but this may be "overkill" depending on the rate of read/write and perhaps not an ideal solution if servers are sitting remotely on the Internet.– Raman SailopalCommented Oct 25, 2017 at 8:50
-
You'll have to describe exact files types. You can use rsync or lsyncd for static files. Keeping databases in sync, will have many additional approaches + require some deep design consideration. Another tack you can take is running LXD on all your machines + syncing entire LXD containers, which may be easier.– David FavorCommented Oct 25, 2017 at 10:45
-
inotify and rsync can be used for that. inotify will trigger an event when something changes on the filesystem and rsync will then react to that event by syncing the file(s).– Nic3500Commented Nov 2, 2017 at 10:56
Add a comment
|
1 Answer
That is not a simple question, it is really complex and there are many way to achieve this, not all of them has the same performance.
- To share static files like images, you can use file server and put the data that you want to share between the servers in that folder and mount that folder in all the servers,
- To sync code, you can use git hook, like the github one, and use some thing for deploy this code for example (jenkins), then github hook, will run task in jenkins, and you can configure the jenkins task to deploy the code to multiple servers
The question is really big and each part of it could be a blog or book