skip to Main Content

i have multiple micro services and all use some local files, now i want to run each micro service on EC2 instance separately and perform file operations

(i found some hints from here :- https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html )

so i want to know, is it possible?

if possible, then what should configuration of EC2 ?

if not possible then how can i archive it?

2

Answers


  1. Definitely, yes.

    According to documentation, there are some limitations:

    1. Your EC2 instances should be in one Availability Zone
    2. EBS multi-attach supported only for io1/io2 EBS volume family
    3. You should use a file system that’s cluster-aware (not EX4, etc…)

    In case of microservices communication, best practice is use EFS that can be mounted to your EC2 instances. In case of EFS, you can use share storage between availability zones within VPC that increases availability of your application.

    Login or Signup to reply.
  2. Yes, it’s possible. However, multiple writes at a time might result in corrupted files (been there, done that). You can install Gluster to prevent that.

    On the other hand, It’s recommend to use EFS instead of EC2 multi attach for this kind of work, just remember to put dump file to EFS to increase iops.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search