24

I have 2 containers in a Fargate task definition. One of the containers is a database server. I'm wanting to persist the data directory. However, Fargate doesn't support the Source Path field when setting up a volume in the task definition. Does anyone know who to set up persistence in Fargate?

Anthony Neace
  • 21,951
  • 6
  • 100
  • 116
Ira Klein
  • 423
  • 3
  • 6
  • 2
    Put code of your yml files to be able to assist you. Remember ! **AWS EKS** will be released , so it will cover many things : https://www.cloudassessments.com/blog/aws-reinvent-2017-keynote-andy-jassy/?utm_campaign=AWSBlogs&utm_content=63812128&utm_medium=social&utm_source=linkedin – Abdennour TOUMI Dec 02 '17 at 19:25
  • 4
    I'm looking for an answer to this too. Apparently persistence isn't available yet. https://forums.aws.amazon.com/thread.jspa?messageID=816397&tstart=0 – mattmc Dec 21 '17 at 03:26

4 Answers4

7

AWS Fargate at this moment is targeted to stateless container solutions only, but we never know, maybe AWS is already working in a solution for it.

Remember you are sharing the same host with other AWS Customers. Your instance could be terminated and restarted in another host anytime. You also can scale out your service anytime.

You can use any of the options below:

  • use RDS for general purpose databases.

  • If your DB is not available you can start a new EC2 and install the database

  • continue to use fargate for the other services.
Alessandro Oliveira
  • 1,838
  • 1
  • 13
  • 23
2

AWS Fargate supports EFS volumes, at last!

1

I can think about 3 ways to do this:

  • use a storage solutions compatible with containers workload (longhorn or portwork are good calls)
  • use RDS
  • use a distributed database that can have multiple copies of it's data (but you will have to take care of the case all the copies where shutdown)
webofmars
  • 1,060
  • 11
  • 23
0

[Fargate] [Volumes]: Allow at least EFS mounts to Fargate Containers.

This is some thing you can trust: https://github.com/aws/containers-roadmap/issues/53

Until then you can:

  1. Generate dump of Database periodically within the container.
  2. With the help of AWS CLI/SDK, Upload same to S3.
  3. Use dump to recover whenever required.
Mangal
  • 389
  • 1
  • 5