Created
March 26, 2018 07:58
-
-
Save aidansteele/18416bdce1b86d71fa70111378005a01 to your computer and use it in GitHub Desktop.
userdata to use nvme disk for docker instead of ebs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -euxo pipefail | |
service docker stop | |
vgextend docker /dev/nvme0n1 | |
lvremove -f /dev/docker/docker-pool | |
vgreduce docker /dev/sdcz1 | |
lvcreate -T docker -n docker-pool -L 200G | |
lvcreate docker -n scratch -L 200G | |
mkfs.ext4 -E nodiscard /dev/docker/scratch | |
mkdir /mnt/scratch | |
mount -o nodiscard /dev/docker/scratch /mnt/scratch/ | |
rm -rf /var/lib/docker | |
mkdir /mnt/scratch/docker | |
echo 'OPTIONS="${OPTIONS} --data-root=/mnt/scratch/docker"' >> /etc/sysconfig/docker | |
service docker start | |
echo ECS_CLUSTER=<cluster> >> /etc/ecs/ecs.config | |
restart ecs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment