realtime sync files between ec2 instances [duplicate]
In my scenario, i have 2 ec2 instances and need to sync the files between them in realtime. Can I do this with rsync? Can anyone please suggest how to schedule a rsync?
Don't try to sync file systems. Read and write your files to S3 directly.
Syncing file systems adds an additional level of complexity to your application that's unnecessary. If the synchronization of the file system fails for any reason, your app will start failing.
Keep things simple: construct your application to use S3 effectively.
You have many alternatives:
- You can use Amazon's S3 to store files and access it via s3fs on both machines.
- You can use some cluster filesystem like GlusterFS or GVFS2.