---
 00-README.conf       | 43 +++++++++++++++++++++++++++++++++++++++++++
 Makefile.am          |  4 +++-
 src/osaf/Makefile.am |  8 ++++++--
 3 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/00-README.conf b/00-README.conf
index 5de286225..24d583a89 100644
--- a/00-README.conf
+++ b/00-README.conf
@@ -654,3 +654,46 @@ on each node, except on the active node. This file 
indicates that a cluster
 reboot is in progress and all nodes needs to delay their start, this to give
 the active a lead.
 
+Split-Brain Prevention with Consensus Service
+=============================================
+
+Split-brain prevention is supported in OpenSAF through a pluggable arbitration
+interface, to implement a consensus service. In network partitions containing
+half of the nodes or less, a controller cannot become active thus preventing
+a split-brain scenario. When the network once again merges such that consensus 
can
+be formed, an active controller will be chosen from the controllers that have 
write
+access to the consensus service. This is assuming that each node
+of the cluster participates in the consensus service.
+
+To enable split-brain prevention, edit fmd.conf and update accordingly:
+
+export SPLIT_BRAIN_PREVENTION=1
+export KEYVALUE_STORE_PLUGIN_CMD=/usr/local/lib/opensaf/etcd.plugin
+
+The plugin must implement a key-value store interface.
+
+An example plugin is provided for etcd, an implemention of RAFT. The plugin 
assumes
+etcd is installed and available on system controllers. In clusters where
+there are only two system controllers, it is highly recommended to configure 
etcd so
+it runs on at least three nodes to facilitate a majority vote with failure 
tolerance.
+
+Other implementations of a distributed key-value store service
+can be used, provided as it implements the interface documented in 
sample.plugin.
+
+get <key> - returns <value> of <key> in key-value store
+set <key> <value> - set <key> to <value> in key-value store
+erase <key> - erase <key> from key-value store
+lock <timeout> - distributed lock with automatic unlock after <timeout> seconds
+unlock - distributed unlock
+lock_owner - returns owner of lock
+watch <key> - returns new <value> of <key> when the value is changed
+
+The key-value store does not need to reside on the same nodes as OpenSAF.
+In such a configuration, an appropriate plugin that handles
+the communication with a remotely located key-value store, must be provided.
+
+If remote fencing is enabled, then it will be used to fence a node that the 
consensus
+service believes should not be active. Otherwise, rded will initiate a 
'self-fencing'
+by rebooting the node, if it determines the node is no longer active
+according to the consensus service.
+
diff --git a/Makefile.am b/Makefile.am
index bcfd844cd..57c2585a8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -159,7 +159,9 @@ dist_osaf_execbin_SCRIPTS += \
        $(top_srcdir)/scripts/opensaf_reboot \
        $(top_srcdir)/scripts/opensaf_sc_active \
        $(top_srcdir)/scripts/opensaf_scale_out \
-       $(top_srcdir)/scripts/plm_scale_out
+       $(top_srcdir)/scripts/plm_scale_out \
+       $(top_srcdir)/src/osaf/consensus/plugins/etcd.plugin
+# TODO remove above line before pushing
 
 include $(top_srcdir)/src/ais/Makefile.am
 include $(top_srcdir)/src/base/Makefile.am
diff --git a/src/osaf/Makefile.am b/src/osaf/Makefile.am
index 05b78c988..10bbe427b 100644
--- a/src/osaf/Makefile.am
+++ b/src/osaf/Makefile.am
@@ -16,7 +16,9 @@
 
 noinst_HEADERS += \
        src/osaf/immutil/immutil.h \
-       src/osaf/saflog/saflog.h
+       src/osaf/saflog/saflog.h \
+       src/osaf/consensus/keyvalue.h \
+       src/osaf/consensus/service.h
 
 pkglib_LTLIBRARIES += lib/libosaf_common.la
 
@@ -33,7 +35,9 @@ lib_libosaf_common_la_LDFLAGS = \
 
 lib_libosaf_common_la_SOURCES = \
        src/osaf/immutil/immutil.c \
-       src/osaf/saflog/saflog.c
+       src/osaf/saflog/saflog.c \
+       src/osaf/consensus/keyvalue.cc \
+       src/osaf/consensus/service.cc
 
 nodist_EXTRA_lib_libosaf_common_la_SOURCES = dummy.cc
 
-- 
2.14.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to