Fix Ceph split brain on multinode

Due to changes that make Ceph work on 1 node configuration
'mon_initial_members = controller-0' was added to /etc/ceph.conf.
This settings allows ceph to work with a single monitor. On
multinode it may cause brain split as controller-0 may start by
itself if it is not able to immediately connect to the good cluster.

This will also cause problems at Backup & Restore when controllers
are reinstalled but older ceph cluster is recovered. In this case
valid monitor data present on storage-0 is downloaded by the monitor
on controller-0. Problem is that if mon_initial_members = controller-0
then the monitor on controller-0 will be happy to start by itself and
will not download the valid data from storage-0 leading to a possible
brain split condition.

This commit sets this option for 1 node configuration only and
keeps it undef for multinode.

Change-Id: I01d5563260ad211b04fe4904c32f255f4e683b07
Closes-bug: 1801772
Signed-off-by: Ovidiu Poncea <ovidiu.poncea@windriver.com>
This commit is contained in:
Ovidiu Poncea 2018-11-14 17:26:00 +02:00
parent 54778ea064
commit 907f8de09e
1 changed files with 8 additions and 1 deletions

View File

@ -44,10 +44,17 @@ class platform::ceph
$system_mode = $::platform::params::system_mode
$system_type = $::platform::params::system_type
if $service_enabled or $configure_ceph_mon_info {
if $system_type == 'All-in-one' and 'simplex' in $system_mode {
# Allow 1 node configurations to work with a single monitor
$mon_initial_members = $mon_0_host
} else {
$mon_initial_members = undef
}
class { '::ceph':
fsid => $cluster_uuid,
authentication_type => $authentication_type,
mon_initial_members => $mon_0_host
mon_initial_members => $mon_initial_members
} ->
ceph_config {
"mon/mon clock drift allowed": value => ".1";