Add Ceph integration with OCF-compliant HA resource managers
cover Add Ceph integration with OCF-compliant HA resource managers
Hi everyone,
please consider reviewing the following patches. These add OCF-compliant cluster resource agent functionality to Ceph, allowing MDS, OSD and MON to run as cluster resources under compliant managers (such as Pacemaker, http://www.clusterlabs.org).
This new stuff does not build nor install by default; you must enable with the "--with-ocf" flag. That same flag maps to a new RPM build conditional ("--with ocf") which rolls the resource agents into a separate subpackage, "ceph-resource-agents".
These patches require the tiny patch to the init script that I posted here a few days ago.
Just in case you're interested, all the above changes (including the init script patch) since commit e18b1c9734e88e3b779ba2d70cdd54f8fb94743d:
rgw: removing swift user index when removing user (2011-12-28 17:00:19 -0800)
are also available in my GitHub repo at:
git://github.com/fghaas/ceph ocf-ra
Florian Haas (3):
init script: be LSB compliant for exit code on status Add OCF-compliant resource agent for Ceph daemons
Spec: conditionally build ceph-resource-agents package
ceph.spec.in | 22 ++++++ configure.ac | 8 ++ src/Makefile.am | 4 +- src/init-ceph.in | 7 ++- src/ocf/Makefile.am | 23 +++++++ src/ocf/ceph.in | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 238 insertions(+), 3 deletions(-) create mode 100644 src/ocf/Makefile.am create mode 100644 src/ocf/ceph.in
Hope this is useful. All feedback is much appreciated. Thanks!
Cheers,
Florian
PATCH 1/2 Add OCF-compliant resource agent for Ceph daemons
Add a wrapper around the ceph init script that makes MDS, OSD and MON configurable as Open Cluster Framework (OCF) compliant cluster resources. Allows Ceph daemons to tie in with cluster resource managers that support OCF, such as Pacemaker (http://www.clusterlabs.org).
Disabled by default, configure --with-ocf to enable.
--- configure.ac | 8 ++ src/Makefile.am | 4 +- src/ocf/Makefile.am | 23 +++++++ src/ocf/ceph.in | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 210 insertions(+), 2 deletions(-) create mode 100644 src/ocf/Makefile.am create mode 100644 src/ocf/ceph.in
configure.ac +8 -0
@@ -277,6 +277,12 @@ AM_CONDITIONAL(WITH_LIBATOMIC, [test "$HAVE_ATOMIC_OPS" = "1"]) # [], # [with_newsyn=no]) +AC_ARG_WITH([ocf], + [AS_HELP_STRING([--with-ocf], [build OCF-compliant cluster resource agent])], + , + [with_ocf=no]) +AM_CONDITIONAL(WITH_OCF, [ test "$with_ocf" = "yes" ]) + # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC
@@ -375,6 +381,8 @@ AM_PATH_PYTHON([2.4], AC_CONFIG_HEADERS([src/acconfig.h]) AC_CONFIG_FILES([Makefile src/Makefile + src/ocf/Makefile + src/ocf/ceph man/Makefile ceph.spec]) AC_OUTPUT
src/Makefile.am +2 -2
@@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = gnu -SUBDIRS = -DIST_SUBDIRS = gtest +SUBDIRS = ocf +DIST_SUBDIRS = gtest ocf CLEANFILES = bin_PROGRAMS = # like bin_PROGRAMS, but these targets are only built for debug builds
src/ocf/Makefile.am new file +23 -0
@@ -0,0 +1,23 @@ +EXTRA_DIST = ceph.in Makefile.in + +if WITH_OCF +# The root of the OCF resource agent hierarchy +# Per the OCF standard, it's always "lib", +# not "lib64" (even on 64-bit platforms). +ocfdir = $(prefix)/lib/ocf + +# The ceph provider directory +radir = $(ocfdir)/resource.d/$(PACKAGE_NAME) + +ra_SCRIPTS = ceph + +install-data-hook: + $(LN_S) ceph $(DESTDIR)$(radir)/osd + $(LN_S) ceph $(DESTDIR)$(radir)/mds + $(LN_S) ceph $(DESTDIR)$(radir)/mon + +uninstall-hook: + rm -f $(DESTDIR)$(radir)/osd + rm -f $(DESTDIR)$(radir)/mds + rm -f $(DESTDIR)$(radir)/mon +endif
src/ocf/ceph.in new file +177 -0
177 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH 2/2 Spec: conditionally build ceph-resource-agents package
In reply to Florian HaasPut OCF resource agents in a separate subpackage, to be enabled with a separate build conditional (--with ocf).
Make the subpackage depend on the resource-agents package, which provides the ocf-shellfuncs library that the Ceph RAs use.
--- ceph.spec.in | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-)
ceph.spec.in +22 -0
@@ -1,5 +1,6 @@ %define with_gtk2 %{?_with_gtk2: 1} %{!?_with_gtk2: 0} +%bcond_with ocf # it seems there is no usable tcmalloc rpm for x86_64; parts of # google-perftools don't compile on x86_64, and apparently the # decision was to not build the package at all, even if tcmalloc
@@ -130,6 +131,19 @@ gcephtool is a graphical monitor for the clusters running the Ceph distributed file system. %endif +%if %{with ocf} +%package resource-agents +Summary: OCF-compliant resource agents for Ceph daemons +Group: System Environment/Base +License: LGPLv2 +Requires: %{name} = %{version} +Requires: resource-agents +%description resource-agents +Resource agents for monitoring and managing Ceph daemons +under Open Cluster Framework (OCF) compliant resource +managers such as Pacemaker. +%endif + %package -n librados2 Summary: RADOS distributed object store client library Group: System Environment/Libraries
@@ -211,6 +225,7 @@ MY_CONF_OPT="$MY_CONF_OPT --without-gtk2" --docdir=%{_docdir}/ceph \ --without-hadoop \ $MY_CONF_OPT \ + %{?_with_ocf} \ %{?with_tcmalloc:--with-tcmalloc} %{!?with_tcmalloc:--without-tcmalloc} # fix bug in specific version of libedit-devel
@@ -415,6 +430,13 @@ fi %endif ################################################################################# +%if %{with ocf} +%files resource-agents +%defattr(0755,root,root,-) +/usr/lib/ocf/resource.d/%{name}/* +%endif + +################################################################################# %files -n librados2 %defattr(-,root,root,-) %{_libdir}/librados.so.*
Signature · 1 line
1.7.5.4
Hi Florian,
I don't have any first-hand experience with OCF, but I did a quick over these look over the code and it looks reasonable enough. Merged all three patches.
Thanks!
sage
Quoted 48 lines · Florian Haas
Hi everyone,
please consider reviewing the following patches. These add OCF-compliant cluster resource agent functionality to Ceph, allowing MDS, OSD and MON to run as cluster resources under compliant managers (such as Pacemaker, http://www.clusterlabs.org).
This new stuff does not build nor install by default; you must enable with the "--with-ocf" flag. That same flag maps to a new RPM build conditional ("--with ocf") which rolls the resource agents into a separate subpackage, "ceph-resource-agents".
These patches require the tiny patch to the init script that I posted here a few days ago.
Just in case you're interested, all the above changes (including the init script patch) since commit
e18b1c9734e88e3b779ba2d70cdd54f8fb94743d:rgw: removing swift user index when removing user (2011-12-28 17:00:19 -0800)
are also available in my GitHub repo at:
git://github.com/fghaas/cephocf-raFlorian Haas (3):
init script: be LSB compliant for exit code on status Add OCF-compliant resource agent for Ceph daemons
Spec: conditionally build ceph-resource-agents packageceph.spec.in | 22 ++++++ configure.ac | 8 ++ src/Makefile.am | 4 +- src/init-ceph.in | 7 ++- src/ocf/Makefile.am | 23 +++++++ src/ocf/ceph.in | 177 +++++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 238 insertions(+), 3 deletions(-) create mode 100644 src/ocf/Makefile.am create mode 100644 src/ocf/ceph.inHope this is useful. All feedback is much appreciated. Thanks!
Cheers,
Florian
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · On 2011. December 29. 20:58:00 Florian Haas wrote:
please consider reviewing the following patches. These add OCF-compliant cluster resource agent functionality to Ceph, allowing MDS, OSD and MON to run as cluster resources under compliant managers (such as Pacemaker, http://www.clusterlabs.org).
Nice work, however, I don't really see the point of running Ceph in a HA cluster. If you have more than one machine, then why not deploy Ceph as an active-active (Ceph) cluster? If you want an active-backup cluster, then why use Ceph?
There might be situations however, where this feature can come handy, although I can't think of any right now. Can you sketch up one?
Signature · 1 line
cc
Hi Szabolcs,
2012/1/6 Székelyi Szabolcs <[email protected]>:
Quoted 10 lines · On 2011. December 29. 20:58:00 Florian Haas wrote:
Quoted 4 lines
please consider reviewing the following patches. These add OCF-compliant cluster resource agent functionality to Ceph, allowing MDS, OSD and MON to run as cluster resources under compliant managers (such as Pacemaker, http://www.clusterlabs.org).
Nice work, however, I don't really see the point of running Ceph in a HA cluster. If you have more than one machine, then why not deploy Ceph as an active-active (Ceph) cluster? If you want an active-backup cluster, then why use Ceph?
What makes you think that Pacemaker doesn't support active/active?
Quoted 2 lines
There might be situations however, where this feature can come handy, although I can't think of any right now. Can you sketch up one?
As far as I'm informed, there's currently no "official" method of recovering Ceph daemons in place when they die. And I suppose (correct me if I'm wrong) that there would be two ways of achieving that.
1. systemd integration. systemd, via Restart=on-failure (or maybe even Restart=always) in a .service definition, could recover a failed daemon. As far as I can see, such service definitions don't exist for any of the ceph daemons, and systemd is not exactly my home turf, so I can't really contribute to ceph/systemd integration. That being said, systemd is currently far from ubiquitous on most platforms, and specifically in the Debian/Ubuntu corner I wonder if we're going to see widespread systemd integration anytime soon. (It still would be cool to have, needless to say.)
2. Pacemaker integration. Pacemaker has the ability of recovering daemons in-place via its monitor operations and automatic resource recovery, and has no systemd dependency (it doesn't need to interface with any of the init daemons for resource management, really). Pacemaker is available across all Linux distros, today.
Pacemaker integration has an added benefit: since Pacemaker is aware of the services in a cluster, we can always tell the cluster, i want this many mon instances, or this many OSDs, and Pacemaker can ensure exactly that. Pacemaker is also unique among cluster managers that it supports clones, a configuration facility that comes in very handy for Ceph daemon management.
Pacemaker (or more specifically its underlying communications/messaging layer) is, obviously, not without limitations. Specifically, most people deploy clusters of less than 10 nodes in size, with 32 nodes in one cluster membership being the current maximum that any QA/QE organization frequently tests for reliability. But still, say a 20-node Pacemaker cluster, where 8 nodes hold RADOS storage and the other 12 are hypervisor hosts consuming the storage via libvirt/RBD -- such a thing can still manage an ample number of Terabytes worth of storage, and host a pretty large array of virtual machines, don't you think?
Cheers,
Florian
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Florian Haas
Pacemaker integration has an added benefit: since Pacemaker is aware of the services in a cluster, we can always tell the cluster, i want this many mon instances, or this many OSDs, and Pacemaker can ensure exactly that. Pacemaker is also unique among cluster managers that it
We already talked on IRC, but just to clarify this to all:
How many OSDs to run (on what hosts) is a question about the available & correctly-functioning storage devices, not really about the administrators wishes. If you want to run more, plug in more hard drives; starting OSDs without them having a backing store is not helpful.
The planned architecture handles this automatically, triggering based on the udev "new block device detected" hook. And that's one of the reasons /etc/init.d/ceph-osd just isn't good enough for the brave new world.