18c2ecf20Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci============================
48c2ecf20Sopenharmony_ciCeph Distributed File System
58c2ecf20Sopenharmony_ci============================
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciCeph is a distributed network file system designed to provide good
88c2ecf20Sopenharmony_ciperformance, reliability, and scalability.
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ciBasic features include:
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci * POSIX semantics
138c2ecf20Sopenharmony_ci * Seamless scaling from 1 to many thousands of nodes
148c2ecf20Sopenharmony_ci * High availability and reliability.  No single point of failure.
158c2ecf20Sopenharmony_ci * N-way replication of data across storage nodes
168c2ecf20Sopenharmony_ci * Fast recovery from node failures
178c2ecf20Sopenharmony_ci * Automatic rebalancing of data on node addition/removal
188c2ecf20Sopenharmony_ci * Easy deployment: most FS components are userspace daemons
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciAlso,
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci * Flexible snapshots (on any directory)
238c2ecf20Sopenharmony_ci * Recursive accounting (nested files, directories, bytes)
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ciIn contrast to cluster filesystems like GFS, OCFS2, and GPFS that rely
268c2ecf20Sopenharmony_cion symmetric access by all clients to shared block devices, Ceph
278c2ecf20Sopenharmony_ciseparates data and metadata management into independent server
288c2ecf20Sopenharmony_ciclusters, similar to Lustre.  Unlike Lustre, however, metadata and
298c2ecf20Sopenharmony_cistorage nodes run entirely as user space daemons.  File data is striped
308c2ecf20Sopenharmony_ciacross storage nodes in large chunks to distribute workload and
318c2ecf20Sopenharmony_cifacilitate high throughputs.  When storage nodes fail, data is
328c2ecf20Sopenharmony_cire-replicated in a distributed fashion by the storage nodes themselves
338c2ecf20Sopenharmony_ci(with some minimal coordination from a cluster monitor), making the
348c2ecf20Sopenharmony_cisystem extremely efficient and scalable.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciMetadata servers effectively form a large, consistent, distributed
378c2ecf20Sopenharmony_ciin-memory cache above the file namespace that is extremely scalable,
388c2ecf20Sopenharmony_cidynamically redistributes metadata in response to workload changes,
398c2ecf20Sopenharmony_ciand can tolerate arbitrary (well, non-Byzantine) node failures.  The
408c2ecf20Sopenharmony_cimetadata server takes a somewhat unconventional approach to metadata
418c2ecf20Sopenharmony_cistorage to significantly improve performance for common workloads.  In
428c2ecf20Sopenharmony_ciparticular, inodes with only a single link are embedded in
438c2ecf20Sopenharmony_cidirectories, allowing entire directories of dentries and inodes to be
448c2ecf20Sopenharmony_ciloaded into its cache with a single I/O operation.  The contents of
458c2ecf20Sopenharmony_ciextremely large directories can be fragmented and managed by
468c2ecf20Sopenharmony_ciindependent metadata servers, allowing scalable concurrent access.
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciThe system offers automatic data rebalancing/migration when scaling
498c2ecf20Sopenharmony_cifrom a small cluster of just a few nodes to many hundreds, without
508c2ecf20Sopenharmony_cirequiring an administrator carve the data set into static volumes or
518c2ecf20Sopenharmony_cigo through the tedious process of migrating data between servers.
528c2ecf20Sopenharmony_ciWhen the file system approaches full, new nodes can be easily added
538c2ecf20Sopenharmony_ciand things will "just work."
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ciCeph includes flexible snapshot mechanism that allows a user to create
568c2ecf20Sopenharmony_cia snapshot on any subdirectory (and its nested contents) in the
578c2ecf20Sopenharmony_cisystem.  Snapshot creation and deletion are as simple as 'mkdir
588c2ecf20Sopenharmony_ci.snap/foo' and 'rmdir .snap/foo'.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciCeph also provides some recursive accounting on directories for nested
618c2ecf20Sopenharmony_cifiles and bytes.  That is, a 'getfattr -d foo' on any directory in the
628c2ecf20Sopenharmony_cisystem will reveal the total number of nested regular files and
638c2ecf20Sopenharmony_cisubdirectories, and a summation of all nested file sizes.  This makes
648c2ecf20Sopenharmony_cithe identification of large disk space consumers relatively quick, as
658c2ecf20Sopenharmony_cino 'du' or similar recursive scan of the file system is required.
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ciFinally, Ceph also allows quotas to be set on any directory in the system.
688c2ecf20Sopenharmony_ciThe quota can restrict the number of bytes or the number of files stored
698c2ecf20Sopenharmony_cibeneath that point in the directory hierarchy.  Quotas can be set using
708c2ecf20Sopenharmony_ciextended attributes 'ceph.quota.max_files' and 'ceph.quota.max_bytes', eg::
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci setfattr -n ceph.quota.max_bytes -v 100000000 /some/dir
738c2ecf20Sopenharmony_ci getfattr -n ceph.quota.max_bytes /some/dir
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ciA limitation of the current quotas implementation is that it relies on the
768c2ecf20Sopenharmony_cicooperation of the client mounting the file system to stop writers when a
778c2ecf20Sopenharmony_cilimit is reached.  A modified or adversarial client cannot be prevented
788c2ecf20Sopenharmony_cifrom writing as much data as it needs.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ciMount Syntax
818c2ecf20Sopenharmony_ci============
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ciThe basic mount syntax is::
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci # mount -t ceph monip[:port][,monip2[:port]...]:/[subdir] mnt
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ciYou only need to specify a single monitor, as the client will get the
888c2ecf20Sopenharmony_cifull list when it connects.  (However, if the monitor you specify
898c2ecf20Sopenharmony_cihappens to be down, the mount won't succeed.)  The port can be left
908c2ecf20Sopenharmony_cioff if the monitor is using the default.  So if the monitor is at
918c2ecf20Sopenharmony_ci1.2.3.4::
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci # mount -t ceph 1.2.3.4:/ /mnt/ceph
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ciis sufficient.  If /sbin/mount.ceph is installed, a hostname can be
968c2ecf20Sopenharmony_ciused instead of an IP address.
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ciMount Options
1018c2ecf20Sopenharmony_ci=============
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci  ip=A.B.C.D[:N]
1048c2ecf20Sopenharmony_ci	Specify the IP and/or port the client should bind to locally.
1058c2ecf20Sopenharmony_ci	There is normally not much reason to do this.  If the IP is not
1068c2ecf20Sopenharmony_ci	specified, the client's IP address is determined by looking at the
1078c2ecf20Sopenharmony_ci	address its connection to the monitor originates from.
1088c2ecf20Sopenharmony_ci
1098c2ecf20Sopenharmony_ci  wsize=X
1108c2ecf20Sopenharmony_ci	Specify the maximum write size in bytes.  Default: 64 MB.
1118c2ecf20Sopenharmony_ci
1128c2ecf20Sopenharmony_ci  rsize=X
1138c2ecf20Sopenharmony_ci	Specify the maximum read size in bytes.  Default: 64 MB.
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci  rasize=X
1168c2ecf20Sopenharmony_ci	Specify the maximum readahead size in bytes.  Default: 8 MB.
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci  mount_timeout=X
1198c2ecf20Sopenharmony_ci	Specify the timeout value for mount (in seconds), in the case
1208c2ecf20Sopenharmony_ci	of a non-responsive Ceph file system.  The default is 60
1218c2ecf20Sopenharmony_ci	seconds.
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci  caps_max=X
1248c2ecf20Sopenharmony_ci	Specify the maximum number of caps to hold. Unused caps are released
1258c2ecf20Sopenharmony_ci	when number of caps exceeds the limit. The default is 0 (no limit)
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci  rbytes
1288c2ecf20Sopenharmony_ci	When stat() is called on a directory, set st_size to 'rbytes',
1298c2ecf20Sopenharmony_ci	the summation of file sizes over all files nested beneath that
1308c2ecf20Sopenharmony_ci	directory.  This is the default.
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci  norbytes
1338c2ecf20Sopenharmony_ci	When stat() is called on a directory, set st_size to the
1348c2ecf20Sopenharmony_ci	number of entries in that directory.
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci  nocrc
1378c2ecf20Sopenharmony_ci	Disable CRC32C calculation for data writes.  If set, the storage node
1388c2ecf20Sopenharmony_ci	must rely on TCP's error correction to detect data corruption
1398c2ecf20Sopenharmony_ci	in the data payload.
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci  dcache
1428c2ecf20Sopenharmony_ci        Use the dcache contents to perform negative lookups and
1438c2ecf20Sopenharmony_ci        readdir when the client has the entire directory contents in
1448c2ecf20Sopenharmony_ci        its cache.  (This does not change correctness; the client uses
1458c2ecf20Sopenharmony_ci        cached metadata only when a lease or capability ensures it is
1468c2ecf20Sopenharmony_ci        valid.)
1478c2ecf20Sopenharmony_ci
1488c2ecf20Sopenharmony_ci  nodcache
1498c2ecf20Sopenharmony_ci        Do not use the dcache as above.  This avoids a significant amount of
1508c2ecf20Sopenharmony_ci        complex code, sacrificing performance without affecting correctness,
1518c2ecf20Sopenharmony_ci        and is useful for tracking down bugs.
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci  noasyncreaddir
1548c2ecf20Sopenharmony_ci	Do not use the dcache as above for readdir.
1558c2ecf20Sopenharmony_ci
1568c2ecf20Sopenharmony_ci  noquotadf
1578c2ecf20Sopenharmony_ci        Report overall filesystem usage in statfs instead of using the root
1588c2ecf20Sopenharmony_ci        directory quota.
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci  nocopyfrom
1618c2ecf20Sopenharmony_ci        Don't use the RADOS 'copy-from' operation to perform remote object
1628c2ecf20Sopenharmony_ci        copies.  Currently, it's only used in copy_file_range, which will revert
1638c2ecf20Sopenharmony_ci        to the default VFS implementation if this option is used.
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci  recover_session=<no|clean>
1668c2ecf20Sopenharmony_ci	Set auto reconnect mode in the case where the client is blocklisted. The
1678c2ecf20Sopenharmony_ci	available modes are "no" and "clean". The default is "no".
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci	* no: never attempt to reconnect when client detects that it has been
1708c2ecf20Sopenharmony_ci	  blocklisted. Operations will generally fail after being blocklisted.
1718c2ecf20Sopenharmony_ci
1728c2ecf20Sopenharmony_ci	* clean: client reconnects to the ceph cluster automatically when it
1738c2ecf20Sopenharmony_ci	  detects that it has been blocklisted. During reconnect, client drops
1748c2ecf20Sopenharmony_ci	  dirty data/metadata, invalidates page caches and writable file handles.
1758c2ecf20Sopenharmony_ci	  After reconnect, file locks become stale because the MDS loses track
1768c2ecf20Sopenharmony_ci	  of them. If an inode contains any stale file locks, read/write on the
1778c2ecf20Sopenharmony_ci	  inode is not allowed until applications release all stale file locks.
1788c2ecf20Sopenharmony_ci
1798c2ecf20Sopenharmony_ciMore Information
1808c2ecf20Sopenharmony_ci================
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ciFor more information on Ceph, see the home page at
1838c2ecf20Sopenharmony_ci	https://ceph.com/
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ciThe Linux kernel client source tree is available at
1868c2ecf20Sopenharmony_ci	- https://github.com/ceph/ceph-client.git
1878c2ecf20Sopenharmony_ci	- git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client.git
1888c2ecf20Sopenharmony_ci
1898c2ecf20Sopenharmony_ciand the source for the full system is at
1908c2ecf20Sopenharmony_ci	https://github.com/ceph/ceph.git
191