Skip to content

Commit d9a09b0

Browse files
committed
Merge pull request #4313 from carmstrong/fix-ec2-etcd2
fix(contrib): fix etcd2 data directory on AWS
2 parents 101bbba + be94e60 commit d9a09b0

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

contrib/aws/gen-json.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@
105105
dump = yaml.dump(data, default_flow_style=False)
106106

107107
# configure etcd to use its EBS volume
108-
dump = dump.replace('-data-dir /var/lib/etcd2', '-data-dir /media/etcd')
109-
dump = dump.replace('--volume=/var/lib/etcd2', '--volume=/media/etcd')
108+
dump = dump.replace('ETCD_HOST_DATA_DIR=/var/lib/etcd2', 'ETCD_HOST_DATA_DIR=/media/etcd')
110109

111110
template = json.load(open(os.path.join(CURR_DIR, 'deis.template.json'), 'r'))
112111

contrib/coreos/user-data.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ coreos:
2828
Environment="ETCD_IMAGE=quay.io/coreos/etcd:v2.1.1"
2929
Environment="ETCD_ELECTION_TIMEOUT=2000"
3030
Environment="ETCD_HEARTBEAT_INTERVAL=400"
31-
Environment="ETCD_DATA_DIR=/var/lib/etcd2"
31+
Environment="ETCD_HOST_DATA_DIR=/var/lib/etcd2"
3232
Environment="ETCD_NAME=%m"
3333
Environment="DOCKER_HOST=unix:///var/run/early-docker.sock"
3434
ExecStartPre=/bin/sh -c "docker history $ETCD_IMAGE >/dev/null 2>&1 || docker pull $ETCD_IMAGE"
3535
ExecStartPre=/bin/sh -c "docker inspect $ETCD_NAME >/dev/null 2>&1 && docker rm -f $ETCD_NAME || true"
3636
ExecStart=/usr/bin/docker run --net=host --rm \
37-
--volume=${ETCD_DATA_DIR}:/var/lib/etcd2 \
37+
--volume=${ETCD_HOST_DATA_DIR}:/var/lib/etcd2 \
3838
--volume=/usr/share/ca-certificates:/etc/ssl/certs:ro \
3939
-p 4001:4001 -p 2380:2380 -p 2379:2379 -p 7001:7001 \
4040
--name ${ETCD_NAME} \

0 commit comments

Comments
 (0)