Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We either take a new snapshot or we go into already created snapsots and restore the latest.

Steps in order to take a new snapshot.

  1. Navigate into DatabasesRDS → DB instances.

  2. Select the database we want to take a snapshot from

  3. Actions → Take Snapshot

  4. We give a name of the snapshot and hit create.

Snapshot it will take approximately 15 minutes to finish.

Restore from a snapshot (Manual or Automated).

  1. Navigate into RDS → Snapshots

  2. Select the snapshot we want to restore

  3. Actions → Restore Snapshot

  4. We navigate into a new window where we must select the appropriate Security Groups and availability zones.

  5. Restore DB instance.

Restore EFS

In order to make an EFS backup right away we need to navigate into AWS Backup service.

  1. We select the Create on-demand backup.

  2. Resource type we select EFS

  3. Select the File system ID

  4. Backup window set to “Create backup now“

  5. Transition to cold storage Never

  6. Retention period Always

  7. Backup vault set to Default

  8. IAM role set to Default role

  9. Set tags

  10. Create on-demand backup.

Creating the backup will take approximately ……….. minutes.

In order to restore EFS we need to go into AWS Backup services and then into Backup vaults

  1. Select the EFS we want to restore

  2. Actions → Restore

  3. We can select Full restore if we want the whole EFS or item-level restore if we want a specific directory from the efs.

  4. Restore to a new file system.

  5. Restore role → Default role

  6. Restore backup

This action will take approximately 15 minutes.

Mount EFS into EC2 instance

We assume that our instances already have the nescessary php, apache, packages installed.

In order to mount EFS into ec2 instance we need to make sure that both services exist into the same VPC and availability zone. This action wont work if the above are not correct.

The steps to mount the EFS are:

  1. In EFS dashboard we select the efs that we have restored and we navigate into anoter page

  2. we select Attach we chose the option Mount via DNS

  3. Using the NFS client we select the appropriate command on which we paste into our EC2 console.

  4. example of command

Code Block
breakoutModewide
sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-.....:/ efs

After using the command the EFS should be attached into our instance and ready to be used right away.

Some additional commands:

1. Report file system disk usage

Code Block
df -h

2. persist mount EFS (when restarting server will reattach EFS automatically)

Code Block
sudo vi /etc/fstab 
fs-......:/ /efs nfs defaults,_netdev 0 0

3. Check efs mounted successfully

Code Block
sudo mount -fav

Make appropriate changes in HTTPD

...