Installing AWS EFS in Unix/Linux

Amazon EFS is a fully managed service that makes it simple to configure and scale out file storage in the Amazon cloud, and to ensure its efficient use. A few clicks in the AWS management Console you can create a file system available for Amazon EC2 instances through the file system interface (using the standard API input and output files in the operating system). For such file systems supported full access semantics, including the strict consistency and file locking.

Amazon EFS file system provides automatic scaling from a few gigabytes to petabytes of data without having to provision the storage. Dozens, hundreds or even thousands of Amazon EC2 instances can concurrently access a file system EFS Amazon, while Amazon EFS ensures stable performance for each Amazon EC2 instance. Amazon EFS is characterized by high availability and reliability. With Amazon EFS is charged for only the resources actually used; minimum contributions and the charges for setting do not exist.

Working with AWS EFS and Terraform in Unix/Linux

The installation of the efs-EFS-utils for AWS in Unix/Linux

AWS EFS can be installed in several ways. The service itself you can create with your hands — you need to go to AWS console and create a resource, or automatically, such as through — Terraform. But on the side of the server (where it will be attached EFS), you need to install the software.

The installation of the efs-EFS-utils for AWS Amazon Linux

For those who use Amazon Linux Amazon Linux or 2, the easiest way to install efs-utils is to use the Amazon repository:

$ sudo yum-y install amazon-efs-utils

After what it takes to mount a broad.

The installation of the efs-EFS-utils for AWS in RedHat’s

Clone the project:

$ git clone https://github.com/aws/efs-utils && cd efs-utils

And then, do the following:

$ sudo yum-y install rpm-build && make rpm &&  sudo yum-y install build/amazon-efs-utils*rpm

After what it takes to mount a broad.

The installation of the efs-EFS-utils for AWS in Debian, s

Clone the project:

$ git clone https://github.com/aws/efs-utils && cd efs-utils

Next, execute:

$ sudo apt-get update && sudo apt-get -y install binutils &&  ./build-deb.sh &&  sudo apt-get -y install ./build/amazon-efs-utils*. deb

After what it takes to mount a broad.

Setup AWS EFS in Unix/Linux

To mount with recommended default settings, simply run:

$ sudo mount-t efs EFS_ID:/ to_MOUNT_POINT/

To automatically mount with the recommended settings, add an entry in /etc/fstab, for example:

EFS_ID to_MOUNT_POINT efs _netdev 0 0

To mount on top of TLS, just add the tls option:

$ sudo mount-t efs -o tls EFS_ID:/ to_MOUNT_POINT/

Example c support ocsp and tls:

$ sudo mount-t efs -o tls,ocsp fs-12345678:/ /mnt/efs

To automatically mount on top of TLS, add an entry in /etc/fstab, for example:

EFS_ID to_MOUNT_POINT efs _netdev,tls 0 0

I for their needs run the EFS as follows:

# mount-t efs $EFS_ID -o tls $JENKINS_HOME &&  mount-t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_DNS_NAME:/ $JENKINS_HOME

Where:

  • AWS_REGION — Region where EFS.
  • AWS_EFS_NAME is the Name created by AWS EFS (in my case). More details are described in the example below the script.
  • EFS_ID — ID from your EFS. If you are using AWS, it can be obtained as follows: (describe aws efs-file-systems —region=$AWS_REGION —output=text —query FileSystems[?Name==`$AWS_EFS_NAME`].FileSystemId). More details are described in the example below the script.
  • to_MOUNT_POINT — the Path where to mount EFS.
  • EFS_DNS_NAME — DNS name AWS EFS and typically has the following command: ($EFS_ID.efs.$AWS_REGION.amazonaws.com)
  • JENKINS_HOME is the Path to the mounted folder. I have this folder with Jenkins, you want to mount.

Here is the finished script to Terraform (Ubuntu) using user_data for provisioning the node(s):

#!/bin/bash export JENKINS_HOME="/var/build/jenkins_home" export AWS_REGION="us-west-2" export AWS_EFS_NAME="jenkins-master-efs-nonprod" git clone https://github.com/aws/efs-utils $JENKINS_HOME/efs-utils cd $JENKINS_HOME/efs-utils && ./build-deb.sh apt-get-y install ./build/amazon-efs-utils*. deb EFS_ID=$(aws describe efs-file-systems --region=$AWS_REGION --output=text --query FileSystems[?Name==`$AWS_EFS_NAME`].FileSystemId) EFS_DNS_NAME="$EFS_ID.efs.$AWS_REGION.amazonaws.com" mount-t efs $EFS_ID -o tls $JENKINS_HOME mount-t nfs -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport $EFS_DNS_NAME:/ $JENKINS_HOME

Perhaps Chet should be added, but is the only way. This is my note to remember what you were doing on your project.

That’s all the article “Installation of AWS EFS in Unix/Linux”, completed.

Source: linux-notes.org

(Visited 5 times, 1 visits today)