From ee08d1f89a588e878324141dd0f80c65058a377d Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Tue, 8 Jan 2019 18:36:14 +0100 Subject: [PATCH] mon: force peer addition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Somewhat something changed with the introduction of msg2 and we have to add each node as a peer so the monitors can form a quorum. This might be due to our CI environment, although adding this is completly harmless and solves monitors not being able to form quorum. It seems that the initial monitor map wasn't containing the right information about the peers (addresses like 0.0.0.0/0r1, for each rank. Signed-off-by: Sébastien Han --- roles/ceph-mon/tasks/ceph_keys.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index 3bc4f8f55..e8d9fd518 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -1,4 +1,18 @@ --- +- name: wait for the monitor socket to exist + stat: + path: "/var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok" + register: socket + until: socket.stat.exists + +- name: add bootstrap peers for monitors to form quorum + command: "{{ docker_exec_cmd }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[item.1]['_current_monitor_address'] }}:{{ item.0 }}" + with_nested: + - 3300 + - "{{ groups[mon_group_name] }}" + changed_when: false + failed_when: false + - name: waiting for the monitor(s) to form the quorum... command: > {{ docker_exec_cmd }} -- 2.39.5