Skip to content

Commit 34bd2cb

Browse files
committed
update the etcd version (use API v3)
1 parent e12ba5a commit 34bd2cb

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

roles/confd/templates/confd.toml.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
backend = "etcd"
1+
backend = "etcdv3"
22
interval = 10
33
watch = true
44
nodes = [

roles/etcd/tasks/main.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,19 @@
116116

117117
- block:
118118
- name: Wait until the etcd cluster is healthy
119-
command: /usr/local/bin/etcdctl cluster-health
120-
environment:
121-
ETCDCTL_API: 2
119+
command: >
120+
/usr/local/bin/etcdctl endpoint health
121+
--endpoints=http://{{ inventory_hostname }}:2379
122122
register: etcd_health_result
123-
run_once: true
124-
changed_when: false
125-
until: "'cluster is healthy' in etcd_health_result.stdout"
123+
until: "'is healthy' in etcd_health_result.stdout"
126124
retries: 10
127125
delay: 10
126+
changed_when: false
128127
ignore_errors: false
129128

130129
- name: cluster health
131-
run_once: true
132130
debug:
133-
var: etcd_health_result.stdout_lines
131+
msg: "{{ etcd_health_result.stdout }}"
134132
tags: etcd, etcd_start, etcd_status
135133

136134
...

roles/etcd/templates/etcd.conf.j2

-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ ETCD_DATA_DIR="{{ etcd_data_dir }}"
1010
ETCD_ELECTION_TIMEOUT="5000"
1111
ETCD_HEARTBEAT_INTERVAL="1000"
1212
ETCD_INITIAL_ELECTION_TICK_ADVANCE="false"
13-
ETCD_ENABLE_V2="true"

roles/patroni/templates/patroni.yml.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ restapi:
3030
# password: password
3131

3232
{% if not dcs_exists|bool and dcs_type == 'etcd' %}
33-
etcd:
33+
etcd3:
3434
hosts: {% for host in groups['etcd_cluster'] %}{{ hostvars[host]['inventory_hostname'] }}:2379{% if not loop.last %},{% endif %}{% endfor %}
3535
{% endif %}
3636
{% if dcs_exists|bool and dcs_type == 'etcd' %}
37-
etcd:
37+
etcd3:
3838
hosts: {% for etcd_hosts in patroni_etcd_hosts %}{{etcd_hosts.host}}:{{etcd_hosts.port}}{% if not loop.last %},{% endif %}{% endfor %}
3939
{% endif %}
4040

vars/Debian.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ postgresql_packages:
5858
# - postgresql-{{ postgresql_version }}-repack"
5959

6060
# Extra packages
61-
etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/{{ etcd_ver }}/etcd-{{ etcd_ver }}-linux-amd64.tar.gz"
61+
etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/v{{ etcd_ver }}/etcd-v{{ etcd_ver }}-linux-amd64.tar.gz"
6262
vip_manager_package_repo: "https://github.com/cybertec-postgresql/vip-manager/releases/download/v{{ vip_manager_version }}/vip-manager_{{ vip_manager_version }}-1_amd64.deb"
6363
# (if with_haproxy_load_balancing: true)
6464
haproxy_installation_method: "deb" # (default)"deb" or "src"

vars/RedHat.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ postgresql_packages:
7979
# - pg_repack{{ postgresql_version_terse }}
8080

8181
# Extra packages
82-
etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/{{ etcd_ver }}/etcd-{{ etcd_ver }}-linux-amd64.tar.gz"
82+
etcd_package_repo: "https://github.com/etcd-io/etcd/releases/download/v{{ etcd_ver }}/etcd-v{{ etcd_ver }}-linux-amd64.tar.gz"
8383
vip_manager_package_repo: "https://github.com/cybertec-postgresql/vip-manager/releases/download/v{{ vip_manager_version }}/vip-manager-{{ vip_manager_version }}-1.x86_64.rpm"
8484
# (if with_haproxy_load_balancing: true)
8585
haproxy_installation_method: "rpm" # (default)"rpm" or "src"

vars/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dcs_exists: false # or 'true' if you don't want to deploy a new etcd cluster
5252
dcs_type: "etcd" # or 'consul'
5353

5454
# if dcs_type: "etcd" and dcs_exists: false
55-
etcd_ver: "v3.3.27" # version for deploy etcd cluster
55+
etcd_ver: "3.5.7" # version for deploy etcd cluster
5656
etcd_data_dir: "/var/lib/etcd"
5757
etcd_cluster_name: "etcd-{{ patroni_cluster_name }}" # ETCD_INITIAL_CLUSTER_TOKEN
5858

0 commit comments

Comments
 (0)