How To Mount an Instance Store on EC2 for Disk Cache
One way to get a fast disk cache on an EC2 instance is to attach a local instance store. This article describes the steps to mount an instance store on your AWS EC2 instance and how to set it up as a disk cache for ObjectiveFS. If your EC2 instance has multiple instance stores, see this guide for how to use multiple instance stores for disk cache.
What you need: an EC2 instance with an instance store added (see how to add instance store to your EC2 instance)
SSH into your EC2 instance.
lsblkto view the block devices attached to the instance.
The example above shows the instance store block device
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 8G 0 disk |-xvda1 202:1 0 8G 0 part / xvdca 202:16 0 4G 0 disk /media/ephemeral0
xvdcais already formatted and mounted on
If the instance store volume is already mounted, please umount it.
$ sudo umount /media/ephemeral0
If the instance store is not formatted, you can format it with the following command ( assuming the block device name is
$ mkfs.ext3 /dev/xvdca
For NVMe SSD:
$ mkfs.ext4 -E nodiscard /dev/nvme0n1
Create the disk cache directory for ObjectiveFS
/var/cache/objectivefsand mount the instance store.
$ mkdir /var/cache/objectivefs $ mount /dev/xvdca /var/cache/objectivefs
df -hand verify that the instance store directory is mounted correctly.
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda1 7.8G 1.1G 6.6G 14% / devtmpfs 1.9G 60K 1.9G 1% /dev tmpfs 1.9G 0 1.9G 0% /dev/shm /dev/xvdca 3.9G 8.1M 3.7G 1% /var/cache/objectivefs
Your disk cache directory on the local instance store is now ready. See Disk Cache User Guide for configuration details. Please also remember to configure the disk cache to mount on boot.
by ObjectiveFS staff, September 30, 2015
ObjectiveFS is a shared file system for OS X and Linux that automatically scales and gives you scalable cloud storage. If you have questions or article idea suggestions, please email us at お問い合わせはこちら