Etcd data dir must be empty

Otherwise we get the error "unknown wal version in data dir /var/etcd"

When this is the homedir for etcd, e.g. .bashrc confuses it
This commit is contained in:
Justin SB 2015-02-02 08:06:00 -08:00
parent e335e2d3e2
commit 9a29d9f92a
4 changed files with 13 additions and 3 deletions

View File

@ -3,4 +3,4 @@
{% set etcd_servers = grains.etcd_servers -%}
{% endif -%}
DAEMON_ARGS="-addr {{etcd_servers}}:4001 -bind-addr {{etcd_servers}}:4001 -data-dir /var/etcd"
DAEMON_ARGS="-addr {{etcd_servers}}:4001 -bind-addr {{etcd_servers}}:4001 -data-dir /var/etcd/data"

View File

@ -1,4 +1,4 @@
bind_addr = "0.0.0.0"
peer_bind_addr = "0.0.0.0"
data_dir = "/var/etcd"
data_dir = "/var/etcd/data"
max_retry_attempts = 60

View File

@ -84,6 +84,15 @@ etcd:
- user: etcd
- group: etcd
/var/etcd/data:
file.directory:
- user: etcd
- group: etcd
- dir_mode: 700
- require:
- user: etcd
- group: etcd
{% if grains['os_family'] == 'RedHat' %}
/etc/default/etcd:
@ -125,6 +134,7 @@ etcd-service:
- file: etcd-symlink
- require:
- file: /var/etcd
- file: /var/etcd/data
- user: etcd
- group: etcd

View File

@ -18,7 +18,7 @@ NAME=etcd
DAEMON=/usr/local/bin/$NAME
# DAEMON_ARGS="-peer-addr $HOSTNAME:7001 -name $HOSTNAME"
host_ip=$(hostname -i)
DAEMON_ARGS="-addr ${host_ip}:4001 -bind-addr ${host_ip}:4001 -data-dir /var/etcd -initial-advertise-peer-urls http://${HOSTNAME}:2380 -name ${HOSTNAME} -initial-cluster ${HOSTNAME}=http://${HOSTNAME}:2380"
DAEMON_ARGS="-addr ${host_ip}:4001 -bind-addr ${host_ip}:4001 -data-dir /var/etcd/data -initial-advertise-peer-urls http://${HOSTNAME}:2380 -name ${HOSTNAME} -initial-cluster ${HOSTNAME}=http://${HOSTNAME}:2380"
DAEMON_LOG_FILE=/var/log/$NAME.log
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME