Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ceph-mgr #10328

Merged
merged 78 commits into from Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d2a209f
msg: typedef uint8_t entity_type_t
Jun 1, 2016
51a6105
mon,mds: include 'addr' in daemon metadata
May 17, 2016
3f6676a
mon: drop encoded buffer after decode
May 18, 2016
fbe7ae5
vstart: fix warning when no CEPH_MAX_MDS set
Sep 11, 2016
27fdf87
monc: remove unused AuthAuthorizeHandlerRegistry
May 24, 2016
c5700ce
mon: fix missing osd metadata (again)
May 25, 2016
85ba9a3
mon: add with_monmap to MonClient
Jun 30, 2016
1a33123
common: move ceph_version up into collect_sys_info
May 15, 2016
fefaac7
common: add 'mgr' and 'mgrc' subsystems for logging
May 19, 2016
c4965fd
common: add mgr config settings
Jun 30, 2016
6caae0e
common/cmdparse: additional helpers
Jun 17, 2016
a11ff90
pybind: fix handling bad cmd json
Jun 17, 2016
7e6b4f1
client: refactor command handling
Jun 8, 2016
e3b2225
messages: add ceph-mgr messages
May 19, 2016
eaada77
msg: introduce mgr entity_type_t
May 19, 2016
8450840
mon: add MgrMonitor
May 19, 2016
e32f2a9
vstart: set up and run ceph-mgr
May 25, 2016
bbc6631
auth: add mgr service type
May 25, 2016
ac30e6c
mgr: create ceph-mgr service
Jun 30, 2016
3283b1e
common: accessors for list of perf counters
Jun 30, 2016
88442d2
mgrc: create MgrClient
Jun 30, 2016
10da6d2
osd: embed a MgrClient
May 19, 2016
157f986
librados: expose mgr_command
Jun 8, 2016
3f4d80c
pybind: expose mgr commands
Jun 8, 2016
b3189d6
cmake: update for ceph-mgr
Jun 30, 2016
44c95af
pybind: create mgr python module folder
Jun 30, 2016
b82533f
pybind/mgr: add the `rest` module
Jun 30, 2016
eafe2e9
mgr: api_docs.py: Update for use outside Calamari
tserong Jun 30, 2016
b7c9561
mgr: fix locking in DaemonMetadata
Jun 30, 2016
a53dc64
pybind/mgr: remove unused CalamariConfig
Jun 30, 2016
cc0b8fb
pybind/mgr: fix django request logging
Jun 30, 2016
d9dfb43
mgr: s/DaemonMetadata/DaemonState/g
Jul 3, 2016
c81e542
mgr: enable multiple python modules
Jul 4, 2016
0bff7af
pybind/mgr: implement shutdown() in rest.py
Jul 4, 2016
7845f8d
mgr: flesh out standby/HA
Jul 14, 2016
1643a7f
mgrc: reset send_report timer on session change
Jul 15, 2016
fd537bc
mgr: enable active daemon to return to standby
Jul 16, 2016
96e10e9
mds: embed a MgrClient
Jul 25, 2016
054708a
mgr: Use signed int log level in PyModules::log()
tserong Jul 26, 2016
7eb4572
pybind/mgr: remove unused gevent code
Jul 26, 2016
5366980
pybind/mgr: move rest into dir
Jul 26, 2016
9501bfd
mgr: store some counter history
Jul 26, 2016
e310486
mgrc: fix report sending after failover
Jul 26, 2016
80281ed
pybind/mgr: expose get_counter in MgrModule
Jul 26, 2016
803b66a
mgrc: enable sending pgstats
Jul 31, 2016
30dec8e
osd: send PGStats to mgr as well as mon
Jul 31, 2016
fa147e3
mgr: handle PGStats with a PGMap
Jul 31, 2016
f77276a
pybind/mgr: update rest module for pg_summary
Jul 31, 2016
ab24038
common/TextTable: add include guards
Jul 31, 2016
519a01d
mon: move "df" dump code from PGMonitor to PGMap
Jul 31, 2016
ea46778
mgr: expose "df" to python modules
Jul 31, 2016
e6de53a
pybind/mgr: fix logging
Aug 4, 2016
c38d491
mgrc: mark down connections with dead sessions
Aug 4, 2016
0812669
mgr: dispose of connections after handle_command
Aug 4, 2016
7122fac
mgr: expose osd stats from pgmap
Aug 4, 2016
7b8179b
mon: implement MgrMonitor.preprocess_beacon
Aug 4, 2016
8db0137
mgrc: less vebose logging of messages
Aug 8, 2016
fc3090f
mgr: skip past broken modules and load the rest
Aug 8, 2016
ba64847
pybind/mgr: add fsstatus module
Aug 4, 2016
567b9fb
doc: add initial ceph-mgr docs
Aug 31, 2016
8897757
packaging: add boost-python dependency
Sep 5, 2016
2210772
common: refactor CommandTable
Sep 19, 2016
58dd3db
mgr: update for Dispatcher::ms_handle_refused
Sep 20, 2016
afa7078
mon: refactor PGMap updating code for reuse in mgr
Sep 22, 2016
78b6eeb
mon: remove need for friending OSDMap to PGMapUpdater
Sep 22, 2016
45b3393
mgr: fixup ClusterState with_*map fns
Sep 23, 2016
1bb9edb
mgr: fix OSDMap notifications
Sep 26, 2016
da76c59
pybind/mgr: clean up unused code
Sep 26, 2016
c6972b9
cmake: install ceph-mgr and its python modules
tserong Sep 7, 2016
d8ded57
systemd: add ceph-mgr service and target files
tserong Sep 7, 2016
2e9e21e
ceph.spec.in: add ceph-mgr package
tserong Sep 7, 2016
61d7793
systemd: encourage ceph-mgr to start in sync with ceph-mon
tserong Sep 20, 2016
082199f
systemd: autogenerate ceph-mgr key during daemon startup
tserong Sep 20, 2016
042b6b4
packaging: add debian packaging for ceph-mgr
Sep 26, 2016
f8514ef
mgr: remove hardcoded site-packages
Sep 26, 2016
592bb9c
vstart: include cython mods in PYTHONPATH
Sep 26, 2016
9a33766
pybind/mgr/rest: fix "sync_object" API endpoint
Sep 27, 2016
6537e63
pybind/mgr/rest: remove unused DebugJob
Sep 27, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -329,6 +329,14 @@ option(WITH_RADOSGW "Rados Gateway is enabled" ON)
#option for CephFS
option(WITH_CEPHFS "CephFS is enabled" ON)

#option for Mgr
option(WITH_MGR "ceph-mgr is enabled" ON)
if(WITH_MGR)
set(Python_ADDITIONAL_VERSIONS 2.7)
find_package(PythonLibs 2.7 REQUIRED)
find_package(Boost COMPONENTS python REQUIRED)
endif(WITH_MGR)

option(WITH_THREAD_SAFE_RES_QUERY "res_query is thread safe" OFF)
if(WITH_THREAD_SAFE_RES_QUERY)
set(HAVE_THREAD_SAFE_RES_QUERY 1 CACHE INTERNAL "Thread safe res_query supported.")
Expand Down
66 changes: 66 additions & 0 deletions ceph.spec.in
Expand Up @@ -83,6 +83,7 @@ ExclusiveArch: x86_64 aarch64
#################################################################################
Requires: ceph-osd = %{epoch}:%{version}-%{release}
Requires: ceph-mds = %{epoch}:%{version}-%{release}
Requires: ceph-mgr = %{epoch}:%{version}-%{release}
Requires: ceph-mon = %{epoch}:%{version}-%{release}
Requires(post): binutils
%if 0%{with cephfs_java}
Expand All @@ -95,6 +96,9 @@ BuildRequires: selinux-policy-devel
BuildRequires: /usr/share/selinux/devel/policyhelp
%endif
BuildRequires: boost-devel
%if ! 0%{?suse_version}
BuildRequires: boost-python
%endif
BuildRequires: cmake
BuildRequires: cryptsetup
BuildRequires: fuse-devel
Expand Down Expand Up @@ -289,6 +293,18 @@ system. One or more instances of ceph-mon form a Paxos part-time
parliament cluster that provides extremely reliable and durable storage
of cluster membership, configuration, and state.

%package mgr
Summary: Ceph Manager Daemon
License: LGPL-2.1 and CC-BY-SA-1.0 and GPL-2.0 and BSL-1.0 and GPL-2.0-with-autoconf-exception and BSD-3-Clause and MIT
Group: System Environment/Base
Requires: ceph-base = %{version}-%{release}

%description mgr
ceph-mgr enables python modules that provide services (such as the REST
module derived from Calamari) and expose CLI hooks. ceph-mgr gathers
the cluster maps, the daemon metadata, and performance counters, and
exposes all these to the python modules.

%package fuse
Summary: Ceph fuse-based client
Group: System Environment/Base
Expand Down Expand Up @@ -767,6 +783,7 @@ mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/tmp
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mon
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/osd
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mds
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/mgr
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/radosgw
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-osd
mkdir -p %{buildroot}%{_localstatedir}/lib/ceph/bootstrap-mds
Expand Down Expand Up @@ -1014,6 +1031,55 @@ if [ $FIRST_ARG -ge 1 ] ; then
fi
fi

%files mgr
%{_bindir}/ceph-mgr
%{_libdir}/ceph/mgr
%{_unitdir}/ceph-mgr@.service
%{_unitdir}/ceph-mgr.target
%attr(750,ceph,ceph) %dir %{_localstatedir}/lib/ceph/mgr

%post mgr
%if 0%{?suse_version}
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl preset ceph-mgr@\*.service ceph-mgr.target >/dev/null 2>&1 || :
fi
%endif
%if 0%{?fedora} || 0%{?rhel}
%systemd_post ceph-mgr@\*.service ceph-mgr.target
%endif
if [ $1 -eq 1 ] ; then
/usr/bin/systemctl start ceph-mgr.target >/dev/null 2>&1 || :
fi

%preun mgr
%if 0%{?suse_version}
%service_del_preun ceph-mgr@\*.service ceph-mgr.target
%endif
%if 0%{?fedora} || 0%{?rhel}
%systemd_preun ceph-mgr@\*.service ceph-mgr.target
%endif

%postun mgr
test -n "$FIRST_ARG" || FIRST_ARG=$1
%if 0%{?suse_version}
DISABLE_RESTART_ON_UPDATE="yes"
%service_del_postun ceph-mgr@\*.service ceph-mgr.target
%endif
%if 0%{?fedora} || 0%{?rhel}
%systemd_postun ceph-mgr@\*.service ceph-mgr.target
%endif
if [ $FIRST_ARG -ge 1 ] ; then
# Restart on upgrade, but only if "CEPH_AUTO_RESTART_ON_UPGRADE" is set to
# "yes". In any case: if units are not running, do not touch them.
SYSCONF_CEPH=%{_sysconfdir}/sysconfig/ceph
if [ -f $SYSCONF_CEPH -a -r $SYSCONF_CEPH ] ; then
source $SYSCONF_CEPH
fi
if [ "X$CEPH_AUTO_RESTART_ON_UPGRADE" = "Xyes" ] ; then
/usr/bin/systemctl try-restart ceph-mgr@\*.service > /dev/null 2>&1 || :
fi
fi

%files mon
%{_bindir}/ceph-mon
%{_bindir}/ceph-rest-api
Expand Down
2 changes: 2 additions & 0 deletions debian/.gitignore
Expand Up @@ -8,6 +8,8 @@
/ceph-fs-common
/ceph-mds-dbg
/ceph-mds
/ceph-mgr-dbg
/ceph-mgr
/ceph-mon-dbg
/ceph-mon
/ceph-osd-dbg
Expand Down
1 change: 1 addition & 0 deletions debian/ceph-mgr.dirs
@@ -0,0 +1 @@
var/lib/ceph/mgr
2 changes: 2 additions & 0 deletions debian/ceph-mgr.install
@@ -0,0 +1,2 @@
usr/bin/ceph-mgr
usr/lib/ceph/mgr
51 changes: 51 additions & 0 deletions debian/ceph-mgr.postinst
@@ -0,0 +1,51 @@
#!/bin/sh
# vim: set noet ts=8:
# postinst script for ceph-mgr
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#
# postinst configure <most-recently-configured-version>
# old-postinst abort-upgrade <new-version>
# conflictor's-postinst abort-remove in-favour <package> <new-version>
# postinst abort-remove
# deconfigured's-postinst abort-deconfigure in-favour <failed-install-package> <version> [<removing conflicting-package> <version>]
#

# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

[ -f "/etc/default/ceph" ] && . /etc/default/ceph
[ -z "$SERVER_USER" ] && SERVER_USER=ceph
[ -z "$SERVER_GROUP" ] && SERVER_GROUP=ceph

case "$1" in
configure)
[ -x /sbin/start ] && start ceph-mgr-all || :

if ! dpkg-statoverride --list /var/lib/ceph/mgr >/dev/null
then
chown $SERVER_USER:$SERVER_GROUP /var/lib/ceph/mgr
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
:
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


23 changes: 23 additions & 0 deletions debian/ceph-mgr.prerm
@@ -0,0 +1,23 @@
#!/bin/sh
# vim: set noet ts=8:

set -e

case "$1" in
remove)
[ -x /sbin/stop ] && stop ceph-mgr-all || :
invoke-rc.d ceph stop mgr || {
RESULT=$?
if [ $RESULT != 100 ]; then
exit $RESULT
fi
}
;;

*)
;;
esac

#DEBHELPER#

exit 0
31 changes: 29 additions & 2 deletions debian/control
Expand Up @@ -34,6 +34,7 @@ Build-Depends: btrfs-tools,
libboost-regex-dev,
libboost-random-dev,
libboost-iostreams-dev (>= 1.42),
libboost-python-dev,
libcurl4-gnutls-dev,
libexpat1-dev,
libfcgi-dev,
Expand Down Expand Up @@ -72,6 +73,7 @@ Standards-Version: 3.9.3
Package: ceph
Architecture: linux-any
Depends: ceph-mon (= ${binary:Version}),
ceph-mgr (= ${binary:Version}),
ceph-osd (= ${binary:Version})
Recommends: ceph-mds (= ${binary:Version})
Description: distributed storage and file system
Expand Down Expand Up @@ -110,8 +112,8 @@ Description: common ceph daemon libraries and management tools
block and file system storage.
.
This package contains the libraries and management tools that are common among
the three Ceph server daemons (ceph-mon, ceph-osd, ceph-mds). These tools are
necessary for creating, running, and administering a Ceph storage cluster.
the Ceph server daemons (ceph-mon, ceph-mgr, ceph-osd, ceph-mds). These tools
are necessary for creating, running, and administering a Ceph storage cluster.

Package: ceph-mds
Architecture: linux-any
Expand Down Expand Up @@ -140,6 +142,31 @@ Description: debugging symbols for ceph-mds
.
This package contains the debugging symbols for ceph-mds.

Package: ceph-mgr
Architecture: linux-any
Depends: ceph-base (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
Replaces: ceph (<< 0.93-417)
Breaks: ceph (<< 0.93-417)
Description: metadata server for the ceph distributed file system
Ceph is a massively scalable, open-source, distributed
storage system that runs on commodity hardware and delivers object,
block and file system storage.
.
This package contains the manager daemon, which is used to expose high
level management and monitoring functionality.

Package: ceph-mgr-dbg
Architecture: linux-any
Section: debug
Priority: extra
Depends: ceph-mgr (= ${binary:Version}), ${misc:Depends}
Description: debugging symbols for ceph-mgr
Ceph is a massively scalable, open-source, distributed
storage system that runs on commodity hardware and delivers object,
block and file system storage.
.
This package contains the debugging symbols for ceph-mgr.

Package: ceph-mon
Architecture: linux-any
Depends: ceph-base (= ${binary:Version}),
Expand Down
8 changes: 8 additions & 0 deletions debian/rules
Expand Up @@ -65,6 +65,8 @@ override_dh_installinit:
install -m0644 src/upstart/rbdmap.conf debian/ceph-common/etc/init
install -d -m0755 debian/ceph-mds/etc/init
install -m0644 src/upstart/ceph-mds*.conf debian/ceph-mds/etc/init
install -d -m0755 debian/ceph-mgr/etc/init
install -m0644 src/upstart/ceph-mgr*.conf debian/ceph-mgr/etc/init
install -d -m0755 debian/radosgw/etc/init
install -m0644 src/upstart/radosgw*.conf debian/radosgw/etc/init
install -d -m0755 debian/rbd-mirror/etc/init
Expand Down Expand Up @@ -97,6 +99,11 @@ override_dh_installinit:
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mds/lib/systemd/system/ceph-mds@.service
install -m0644 systemd/ceph-mds.target debian/ceph-mds/lib/systemd/system

install -d -m0755 debian/ceph-mgr/lib/systemd/system
install -m0644 systemd/ceph-mgr@.service debian/ceph-mgr/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/ceph-mgr/lib/systemd/system/ceph-mgr@.service
install -m0644 systemd/ceph-mgr.target debian/ceph-mgr/lib/systemd/system

install -d -m0755 debian/radosgw/lib/systemd/system
install -m0644 systemd/ceph-radosgw@.service debian/radosgw/lib/systemd/system
sed -i s./etc/sysconfig/./etc/default/.g debian/radosgw/lib/systemd/system/ceph-radosgw@.service
Expand All @@ -115,6 +122,7 @@ override_dh_systemd_start:

override_dh_strip:
dh_strip -pceph-mds --dbg-package=ceph-mds-dbg
dh_strip -pceph-mgr --dbg-package=ceph-mgr-dbg
dh_strip -pceph-mon --dbg-package=ceph-mon-dbg
dh_strip -pceph-osd --dbg-package=ceph-osd-dbg
dh_strip -pceph-fuse --dbg-package=ceph-fuse-dbg
Expand Down
1 change: 1 addition & 0 deletions doc/index.rst
Expand Up @@ -98,6 +98,7 @@ about Ceph, see our `Architecture`_ section.
cephfs/index
rbd/rbd
radosgw/index
mgr/index
api/index
architecture
Development <dev/index>
Expand Down
94 changes: 94 additions & 0 deletions doc/mgr/administrator.rst
@@ -0,0 +1,94 @@

ceph-mgr administrator's guide
==============================

Setup
-----

Create an authentication key for your daemon:

::
ceph auth get-or-create mgr.$name mon 'allow *'

Place that key into ``mgr data`` path, which for a cluster "ceph"
and mgr $name "foo" would be ``/var/lib/ceph/mgr/ceph-foo``.

Start the ceph-mgr daemon:

::
ceph-mgr -i $name

Check that the mgr has come up by looking at the output
of ``ceph status``, which should now include a mgr status line:

::
mgr active: $name

High availability
-----------------

In general, you should set up a ceph-mgr on each of the hosts
running a ceph-mon daemon to achieve the same level of availability.

By default, whichever ceph-mgr instance comes up first will be made
active by the monitors, and the others will be standbys. There is
no requirement for quorum among the ceph-mgr daemons.

If the active daemon fails to send a beacon to the monitors for
more than ``mgr beacon period`` (default 30s), then it will be replaced
by a standby.

If you want to pre-empt failover, you can explicitly mark a ceph-mgr
daemon as failed using ``ceph mgr fail <mgr name>``.

Calling module commands
-----------------------

Where a module implements command line hooks, using the Ceph CLI's
``tell`` command to call them like this:

::

ceph tell mgr <command | help>

Note that it is not necessary to address a particular mgr instance,
simply ``mgr`` will pick the current active daemon.

Use the ``help`` command to get a list of available commands from all
modules.

Configuration
-------------

OPTION(mgr_module_path, OPT_STR, CEPH_PKGLIBDIR "/mgr") // where to load python modules from

``mgr module path``

:Description: Path to load modules from
:Type: String
:Default: ``"<library dir>/mgr"``

``mgr modules``

:Description: List of python modules to load
:Type: String
:Default: ``"rest"`` (Load the REST API module only)

``mgr data``

:Description: Path to load daemon data (such as keyring)
:Type: String
:Default: ``"/var/lib/ceph/mgr/$cluster-$id"``

``mgr beacon period``

:Description: How many seconds between mgr beacons to monitors
:Type: Integer
:Default: ``5``

``mon mgr beacon grace``

:Description: How long after last beacon should a mgr be considered failed
:Type: Integer
:Default: ``30``