Create the instance using the key pair and security group previously created and also include the --ebs-optimized flag and specify individual PIOPS EBS volumes (/dev/xvdf for data, /dev/xvdg for journal, /dev/xvdh for log). Refer to the documentation for ec2-run-instances for more information on devices and parameters.:
Next, create/configure the mount points, mount each volume, set ownership (MongoDB runs under the mongod user/group), and set the /journal link:
sudo mkdir /data /log /journal
sudo mkfs.ext4 /dev/xvdf # for data
sudo mkfs.ext4 /dev/xvdg # for journal
sudo mkfs.ext4 /dev/xvdh # for log
echo '/dev/xvdf /data ext4 defaults,auto,noatime,noexec 0 0
/dev/xvdg /journal ext4 defaults,auto,noatime,noexec 0 0
/dev/xvdh /log ext4 defaults,auto,noatime,noexec 0 0' | sudo tee -a /etc/fstab
sudo mount /data
sudo mount /journal
sudo mount /log
sudo chown mongod:mongod /data /journal /log
sudo ln -s /journal /data/journal
sudovi /etc/mongod.conf
dbpath = /data
logpath = /log/mongod.log