Improve etcd scale up (#1846)

Now adding unjoined members to existing etcd cluster
occurs one at a time so that the cluster does not
lose quorum.
This commit is contained in:
Matthew Mosesohn
2017-10-20 08:02:31 +01:00
committed by GitHub
parent 55b9d02a99
commit 514359e556
3 changed files with 51 additions and 5 deletions

View File

@@ -9,10 +9,6 @@
tags:
- facts
- name: Configure | Add member to the cluster if it is not there
when: is_etcd_master and etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0
shell: "{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} member add {{ etcd_member_name }} {{ etcd_peer_url }}"
- name: Install etcd launch script
template:
src: etcd.j2
@@ -29,3 +25,12 @@
backup: yes
when: is_etcd_master
notify: restart etcd
- name: Configure | Join member(s) to cluster one at a time
include: join_member.yml
vars:
target_node: "{{ item }}"
loop_control:
pause: 10
with_items: "{{ groups['etcd'] }}"
when: inventory_hostname == item and etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0