A Journey in Learning

Designing Highly Available Systems Part 2: Mounting and Modifying Permissions

I have been working on getting this EFS working, after mounting the network drive and transferring files, I attempted to connect to the site but received this error:

Dataroot is not writable, admin has to fix directory permissions

I perused some articles online and realized that this was a permissions issue, I was able to determine that I needed to my system permissions to access the file system on the EFS system. Also I need to make sure to double check my code before continuing troubleshooting. I was able to find Moodle’s config.php file and I learned that I need to specify the exact location of the Moodledata folder and not the parent directory that houses it. the permissions will need to be modified and the CLI command is below

sudo chown -R bitnami-admins /home/bitnami/efs/moodledatashared/moodledata

After getting this configured I was able to load the site but noticed that upon reboot the Dataroot error would return. I deduced that the drive would need to be mounted at each reboot. There is a configuration file named fstab that would need to edited to allow proper connection. The proper commands took some time to find and improper configuration would crash the ec2 instance and make it non-recoverable. See below:

sudo nano /etc/fstab

##add the following line with proper fs ID and region, then save.

<fs-********>.efs.<region>.amazonaws.com:/ /home/bitnami/efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 0 0

Upon restart this configuration would work; however the website is EXRTREMELY slow, so I will implement a caching solution. Part three to this project will be to add and configure Elasticache.