put docker data-root in /dgraph partition
@@ -121,9 +121,6 @@ export class Swarm extends cdk.Construct {
swarmUserData.addCommands(...[
'yum install -y docker amazon-cloudwatch-agent python3',
'amazon-cloudwatch-agent-ctl -m ec2 -a start',
- 'systemctl enable docker.service',
- 'systemctl start docker.service',
- 'usermod -a -G docker ec2-user',
'# create LUKS key',
'head -c 256 /dev/urandom > /root/luks_key',
'cryptsetup -v -q luksFormat /dev/nvme0n1 /root/luks_key',
@@ -135,6 +132,10 @@ export class Swarm extends cdk.Construct {
'mkdir /dgraph',
'echo -e "/dev/mapper/dgraph\t/dgraph\txfs\tdefaults,nofail\t0\t2" >> /etc/fstab',
'mount /dgraph',
+ 'echo -e "{\n \"data-root\": \"/dgraph\"\n}" > /etc/docker/daemon.json',
+ 'systemctl enable docker.service',
+ 'systemctl start docker.service',
+ 'usermod -a -G docker ec2-user',
]);
// Configure a Route53 Hosted Zone for the Swarm cluster.
