The files from the NFS server have now been copied to the AWS S3 bucket defined in the DataSync task. However, the application still running in the On-Premises environment will need access to the S3 bucket to continue with operations. The File Gateway was already deployed by CloudFormation in the on-premises region. Next, you will connect your application to the S3 bucket and provide access to the objects through Storage Gateway NFS share.
You will mount the Storage Gateway share on the Application server to validate access to the files.
DataMigrationWorkshop-inCloudResources
was deployed.Although the agent instance was created in the DataMigrationWorkshop-onPremResources template, before it can be used it needs to be activated.
Follow the steps below to active the agent:
Go to the AWS Management console page navigate to AWS Storage Gateway.
Click Create gateway.
Gateway Name: DataMigrationGateway
Gateway TimeZone: Select your timezone.
Gateway Option Type: Amazon S3 File Gateway.
Host Platform: Amazon EC2.
Launch EC2 Instance: Select Customize your settings.
Check Box to confirm gateway set up.
Click Next.
From the left-hand menu, select File Shares.
Click Create File share.
Select the Gateway just created.
Enter the S3 bucket’s name used for migration. Leave the S3 prefix name field blank.
Ensure NFS is selected under the Access objects using setting.
Leave Automated cache refresh from S3 set to none.
Click Next.
Keep the default S3 storage settings, then click Next.
Under the Access object section, click Add client.
Add the appServerPrivateIP address, followed by “/32”. This will allow the Application server to access the NFS file share on the gateway.
Click Next.
sudo mkdir /mnt/fgw
/mnt/fgw
. You must run the command as sudo.[Example]
sudo mount -t nfs -o nolock,hard 1.1.1.1:/data-migration-workshop-12345678-2222-3333-4444-012345678910 /mnt/fgw
mount | grep nfs4
Congratulations, you have successfully activated the Storage Gateway and created an NFS file share on the gateway. You then mounted the share on the Application server