~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to doc/architecture.rst

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
======================
 
2
 Architecture of Ceph
 
3
======================
 
4
 
 
5
Ceph is a distributed network storage and file system with distributed
 
6
metadata management and POSIX semantics.
 
7
 
 
8
RADOS is a reliable object store, used by Ceph, but also directly
 
9
accessible.
 
10
 
 
11
``radosgw`` is an S3-compatible RESTful HTTP service for object
 
12
storage, using RADOS storage.
 
13
 
 
14
RBD is a Linux kernel feature that exposes RADOS storage as a block
 
15
device. Qemu/KVM also has a direct RBD client, that avoids the kernel
 
16
overhead.
 
17
 
 
18
 
 
19
.. index:: monitor, ceph-mon
 
20
.. _monitor:
 
21
 
 
22
Monitor cluster
 
23
===============
 
24
 
 
25
``ceph-mon`` is a lightweight daemon that provides a consensus for
 
26
distributed decisionmaking in a Ceph/RADOS cluster.
 
27
 
 
28
It also is the initial point of contact for new clients, and will hand
 
29
out information about the topology of the cluster, such as the
 
30
``osdmap``.
 
31
 
 
32
You normally run 3 ``ceph-mon`` daemons, on 3 separate physical machines,
 
33
isolated from each other; for example, in different racks or rows.
 
34
 
 
35
You could run just 1 instance, but that means giving up on high
 
36
availability.
 
37
 
 
38
You may use the same hosts for ``ceph-mon`` and other purposes.
 
39
 
 
40
``ceph-mon`` processes talk to each other using a Paxos_\-style
 
41
protocol. They discover each other via the ``[mon.X] mon addr`` fields
 
42
in ``ceph.conf``.
 
43
 
 
44
.. todo:: What about ``monmap``? Fact check.
 
45
 
 
46
Any decision requires the majority of the ``ceph-mon`` processes to be
 
47
healthy and communicating with each other. For this reason, you never
 
48
want an even number of ``ceph-mon``\s; there is no unambiguous majority
 
49
subgroup for an even number.
 
50
 
 
51
.. _Paxos: http://en.wikipedia.org/wiki/Paxos_algorithm
 
52
 
 
53
.. todo:: explain monmap
 
54
 
 
55
 
 
56
.. index:: RADOS, OSD, ceph-osd, object
 
57
.. _rados:
 
58
 
 
59
RADOS
 
60
=====
 
61
 
 
62
``ceph-osd`` is the storage daemon that provides the RADOS service. It
 
63
uses ``ceph-mon`` for cluster membership, services object read/write/etc
 
64
request from clients, and peers with other ``ceph-osd``\s for data
 
65
replication.
 
66
 
 
67
The data model is fairly simple on this level. There are multiple
 
68
named pools, and within each pool there are named objects, in a flat
 
69
namespace (no directories). Each object has both data and metadata.
 
70
 
 
71
The data for an object is a single, potentially big, series of
 
72
bytes. Additionally, the series may be sparse, it may have holes that
 
73
contain binary zeros, and take up no actual storage.
 
74
 
 
75
The metadata is an unordered set of key-value pairs. It's semantics
 
76
are completely up to the client; for example, the Ceph filesystem uses
 
77
metadata to store file owner etc.
 
78
 
 
79
.. todo:: Verify that metadata is unordered.
 
80
 
 
81
Underneath, ``ceph-osd`` stores the data on a local filesystem. We
 
82
recommend using Btrfs_, but any POSIX filesystem that has extended
 
83
attributes should work.
 
84
 
 
85
.. _Btrfs: http://en.wikipedia.org/wiki/Btrfs
 
86
 
 
87
.. todo:: write about access control
 
88
 
 
89
.. todo:: explain osdmap
 
90
 
 
91
.. todo:: explain plugins ("classes")
 
92
 
 
93
 
 
94
.. index:: Ceph filesystem, Ceph Distributed File System, MDS, ceph-mds
 
95
.. _cephfs:
 
96
 
 
97
Ceph filesystem
 
98
===============
 
99
 
 
100
The Ceph filesystem service is provided by a daemon called
 
101
``ceph-mds``. It uses RADOS to store all the filesystem metadata
 
102
(directories, file ownership, access modes, etc), and directs clients
 
103
to access RADOS directly for the file contents.
 
104
 
 
105
The Ceph filesystem aims for POSIX compatibility, except for a few
 
106
chosen differences. See :doc:`/appendix/differences-from-posix`.
 
107
 
 
108
``ceph-mds`` can run as a single process, or it can be distributed out to
 
109
multiple physical machines, either for high availability or for
 
110
scalability.
 
111
 
 
112
For high availability, the extra ``ceph-mds`` instances can be `standby`,
 
113
ready to take over the duties of any failed ``ceph-mds`` that was
 
114
`active`. This is easy because all the data, including the journal, is
 
115
stored on RADOS. The transition is triggered automatically by
 
116
``ceph-mon``.
 
117
 
 
118
For scalability, multiple ``ceph-mds`` instances can be `active`, and they
 
119
will split the directory tree into subtrees (and shards of a single
 
120
busy directory), effectively balancing the load amongst all `active`
 
121
servers.
 
122
 
 
123
Combinations of `standby` and `active` etc are possible, for example
 
124
running 3 `active` ``ceph-mds`` instances for scaling, and one `standby`.
 
125
 
 
126
To control the number of `active` ``ceph-mds``\es, see
 
127
:doc:`/ops/manage/grow/mds`.
 
128
 
 
129
.. topic:: Status as of 2011-09:
 
130
 
 
131
   Multiple `active` ``ceph-mds`` operation is stable under normal
 
132
   circumstances, but some failure scenarios may still cause
 
133
   operational issues.
 
134
 
 
135
.. todo:: document `standby-replay`
 
136
 
 
137
.. todo:: mds.0 vs mds.alpha etc details
 
138
 
 
139
 
 
140
.. index:: RADOS Gateway, radosgw
 
141
.. _radosgw:
 
142
 
 
143
``radosgw``
 
144
===========
 
145
 
 
146
``radosgw`` is a FastCGI service that provides a RESTful_ HTTP API to
 
147
store objects and metadata. It layers on top of RADOS with its own
 
148
data formats, and maintains it's own user database, authentication,
 
149
access control, and so on.
 
150
 
 
151
.. _RESTful: http://en.wikipedia.org/wiki/RESTful
 
152
 
 
153
 
 
154
.. index:: RBD, Rados Block Device
 
155
.. _rbd:
 
156
 
 
157
Rados Block Device (RBD)
 
158
========================
 
159
 
 
160
In virtual machine scenarios, RBD is typically used via the ``rbd``
 
161
network storage driver in Qemu/KVM, where the host machine uses
 
162
``librbd`` to provide a block device service to the guest.
 
163
 
 
164
Alternatively, as no direct ``librbd`` support is available in Xen,
 
165
the Linux kernel can act as the RBD client and provide a real block
 
166
device on the host machine, that can then be accessed by the
 
167
virtualization. This is done with the command-line tool ``rbd`` (see
 
168
:doc:`/ops/rbd`).
 
169
 
 
170
The latter is also useful in non-virtualized scenarios.
 
171
 
 
172
Internally, RBD stripes the device image over multiple RADOS objects,
 
173
each typically located on a separate ``ceph-osd``, allowing it to perform
 
174
better than a single server could.
 
175
 
 
176
 
 
177
Client
 
178
======
 
179
 
 
180
.. todo:: cephfs, ceph-fuse, librados, libcephfs, librbd
 
181
 
 
182
 
 
183
.. todo:: Summarize how much Ceph trusts the client, for what parts (security vs reliability).
 
184
 
 
185
 
 
186
TODO
 
187
====
 
188
 
 
189
.. todo:: Example scenarios Ceph projects are/not suitable for