This question already has an answer here:

I have set up 2 ubuntu instances in aws. How do I sync /usr/ubuntu in both the machines?

marked as duplicate by Sparhawk, Jeff Schaller, Kiwy, Thomas, αғsнιη Mar 26 '18 at 10:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


You can use rsync command to sync two directories, e.g:

rsync -avzhe ssh -i yourkey.pem /usr/ubuntu root@ec2ip:/usr/ubuntu

This question has at least two answers.

If you need periodically sync your folders, you can use rsync.

If you need persistent sync and /usr/ubuntu is distinguished disk partition, then you can use DRBD. It's like Net-RAID. Describe and documentation about DRBD - DRBD official site.


Set up one of the instances as an NFS server that exports the directory for the other instance to mount.

Not the answer you're looking for? Browse other questions tagged or ask your own question.