Articles in this section
Category / Section

How to Mount a Persistent Volume for App Data in Amazon AWS ECS Service

Published:

If you are upgrading your service or container restart, it might lead to data loss in the BoldBI application which is deployed in Amazon AWS ECS service. To avoid this, we suggest you mount a persistent volume for app data. This article explains how to mount app data in EFS storage while deploying and how to access the app_data in the EFS file storage through Linux VM.

Prerequisites

  • VPC must be same for both EFS and ECS (including creating services or Task).

  • Security group also be same for both EFS and ECS.

Follow the steps to create EFS

  1. From the task definition, create new revision and enter a required detail.

  2. Before creating container, definition need to add EFS related details in Volume.

    Name: any

    Volume type: EFS

    File system ID: EFS file system id (It’s show automatically from dropdown)

    Access point ID: If you have access point ID please enter.

    Root directory: /

    Then select ADD.

  3. From container definition, select Add container. Enter the required details in Edit container window.

  4. Then, STORAGE AND LOGGING need to add EFS volume name in mount point and enter the Source Volume path as /application/app_data.

  5. After adding the container, select create. After creating the revision, create service under cluster and deploy the Bold BI application.

  6. Now, app_data is mounted in the EFS storage.

Steps to access app_data folder in EFS file storage through Linux VM

  1. Connect anyone of AWS Linux EC2, install machine, and follow the below command to mount EFS in folder.

    sudo apt-get install nfs-common

    cd
    sudo mkdir efs
  2. Go to the EFS console in AWS -> Name -> Attach.

  3. Then copy the NFS client command.

  4. Then, run the command in the AWS EC2 Linux machine which is copied from the NFS client.

  5. Now, the EFS file is mount in the Linux machine.



Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
IJ
Written by Israel Jebaraj Chandirakumar
Updated
Comments (0)
Please  to leave a comment
Access denied
Access denied