注意
本文档适用于 Ceph 的开发版本。
ceph -- ceph管理工具
概要
描述
ceph is a control utility which is used for manual deployment and maintenance of a Ceph cluster. It provides a diverse set of commands that allows deployment of monitors, OSDs, placement groups, MDS and overall maintenance, administration of the cluster.
Commands
auth
管理认证密钥。它用于添加、删除、导出或更新特定实体的认证密钥,例如监控器或OSD。它使用一些额外的子命令。
Subcommandadd
从输入文件中为特定实体添加认证信息,如果没有输入或任何caps在命令中指定,则添加随机密钥。
用法:
ceph auth add <entity> {<caps> [<caps>...]}
Subcommandcaps
更新命令中指定的caps。名称 from caps specified in the command.
用法:
ceph auth caps <entity> <caps> [<caps>...]
Subcommanddel
删除所有为指定实体的caps。name
.
用法:
ceph auth del <entity>
Subcommandexport
为请求的实体写入密钥环,如果没有给出,则为主密钥环。
用法:
ceph auth export {<entity>}
Subcommandget
写入带有请求密钥的密钥环文件。
用法:
ceph auth get <entity>
Subcommandget-key
显示请求的密钥。
用法:
ceph auth get-key <entity>
Subcommandget-or-create
从输入文件中为特定实体添加认证信息,如果没有输入和/或命令中指定的任何caps。
用法:
ceph auth get-or-create <entity> {<caps> [<caps>...]}
Subcommandget-or-create-key
获取或添加为命令中指定的系统/caps对中的密钥。如果密钥已存在,则任何给定的caps必须与该密钥的现有caps匹配。name
from system/caps
pairs specified in the command. If key already exists, any given caps must match
the existing caps for that key.
用法:
ceph auth get-or-create-key <entity> {<caps> [<caps>...]}
Subcommandimport
从输入文件中读取密钥环。
用法:
ceph auth import
Subcommandls
列出认证状态。
用法:
ceph auth ls
Subcommandprint-key
显示请求的密钥。
用法:
ceph auth print-key <entity>
Subcommandprint_key
显示请求的密钥。
用法:
ceph auth print_key <entity>
compact
导致监控器的RocksDB存储进行压缩。
用法:
ceph compact
config
配置集群。默认情况下,Ceph守护程序和客户端在启动时从监控器检索其配置选项,如果运行时跟踪的任何选项发生变化,则会更新。它使用以下额外的子命令。
Subcommanddump
列出集群的所有选项。
用法:
ceph config dump
Subcommandls
列出集群的所有选项名称。
用法:
ceph config ls
Subcommandhelp
描述指定的配置选项。
用法:
ceph config help <option>
Subcommandget
列出指定实体的选项。
用法:
ceph config get <who> {<option>}
Subcommandshow
显示指定实体的运行配置。请注意,与get
不同,它只显示由监控器管理的选项,show
显示所有正在积极使用的配置。ceph.conf
主机上的文件。这些选项甚至可以在运行时被覆盖。因此,输出show
中的配置选项可能与输出get
.
用法:
ceph config show {<who>}
Subcommandshow-with-defaults
显示指定实体的运行配置以及编译默认值。
用法:
ceph config show {<who>}
Subcommandset
为一个或多个指定实体设置选项。
用法:
ceph config set <who> <option> <value> {--force}
Subcommandrm
为一个或多个实体清除选项。
用法:
ceph config rm <who> <option>
Subcommandlog
显示配置更改的最近历史记录。如果count选项省略,则默认值为10。
用法:
ceph config log {<count>}
Subcommandreset
将配置还原到指定的历史版本
用法:
ceph config reset <version>
Subcommandassimilate-conf
从stdin中同化选项,并返回一个新的最小配置文件
用法:
ceph config assimilate-conf -i <input-config-path> > <output-config-path>
ceph config assimilate-conf < <input-config-path>
Subcommandgenerate-minimal-conf
生成一个最小ceph.conf
文件,可用于引导守护程序或客户端。
用法:
ceph config generate-minimal-conf > <minimal-config-path>
config-key
管理配置密钥。Config-key是由监控器提供的一般用途的键值服务。该服务主要由Ceph工具和守护程序用于持久化各种设置。其中,ceph-mgr模块使用它来存储它们的选项。它使用一些额外的子命令。
Subcommandrm
删除配置密钥。
用法:
ceph config-key rm <key>
Subcommandexists
检查配置密钥是否存在。
用法:
ceph config-key exists <key>
Subcommandget
获取配置密钥。
用法:
ceph config-key get <key>
Subcommandls
列出配置密钥。
用法:
ceph config-key ls
Subcommanddump
列出配置密钥和值。
用法:
ceph config-key dump
Subcommandset
放置配置密钥和值。
用法:
ceph config-key set <key> {<val>}
daemon
提交admin-socket命令。
用法:
ceph daemon {daemon_name|socket_path} {command} ...
示例:
ceph daemon osd.0 help
daemonperf
监控来自Ceph守护程序的性能计数器。
用法:
ceph daemonperf {daemon_name|socket_path} [{interval} [{count}]]
df
显示集群的空闲空间状态。
用法:
ceph df {detail}
features
显示集群中所有连接的守护程序和客户端的版本和功能,以及按相应的功能/版本分组的每个桶中的数量。每个Ceph版本都支持不同的功能集,由功能掩码表示。新集群功能需要客户端支持该功能,否则它们不被允许连接到这些新功能。随着升级后启用新功能或功能,旧客户端将无法连接。
用法:
ceph features
fs
管理cephfs文件系统。它使用一些额外的子命令。
Subcommandadd_data_pool
向FS添加一个新的数据池。这个池可以用作文件布局的备用位置来存储文件数据。
用法:
ceph fs add_data_pool <fs-name> <pool name/id>
Subcommandauthorize
创建一个新的客户端(如果客户端在集群上不存在),它将被授权给<fs_name>
中的给定路径。/
授权整个FS。<perms>
下面可以r
,
rw
or rwp
.
运行它以现有的客户端可以授予客户端新的功能
用法:
ceph fs authorize <fs_name> client.<client_id> <path> <perms> [<path> <perms>...]
Subcommanddump
displays the FSMap at the given epoch (default: current).
This includes all file system settings, MDS daemons and the ranks they hold
and list of standby MDS daemons.
用法:
ceph fs dump [epoch]
Subcommandfeature ls
lists all CephFS features supported by current
version of Ceph.
用法:
ceph fs feature ls
Subcommandflag set
sets a global CephFS flag. Right now the only flag
is enable_multiple
which allows multiple CephFSs on a Ceph cluster.
用法:
ceph fs flag set <flag-name> <flag-val> --yes-i-really-mean-it
Subcommandget
displays the information about FS, including settings and
ranks. Information printed here in subset of same information from the
fs dump
command.
用法:
ceph fs get <fs-name>
Subcommandls
to list file systems
用法:
ceph fs ls
Subcommandlsflags
displays all the flags set on the given FS.
用法:
ceph fs lsflags <fs-name>
Subcommandnew
to make a new file system using named pools <metadata> and <data>
用法:
ceph fs new <fs_name> <metadata> <data>
Subcommandrename
assigns a new name to CephFS and also updates
application tags on the pools of this CephFS.
用法:
ceph fs rename <fs-name> <new-fs-name> {--yes-i-really-mean-it}
Subcommandrequired_client_features
disables a client that doesn’t
possess a certain feature from connecting. This subcommand has two
subcommands, one to add a requirement and other to remove the requirement.
用法:
ceph fs required_client_features <fs name> add <feature-name>
ceph fs required_client_features <fs name> rm <feature-name>
Subcommandreset
is used for disaster recovery only: reset to a single-MDS
map
用法:
ceph fs reset <fs_name> {--yes-i-really-mean-it}
Subcommandrm
to disable the named file system
用法:
ceph fs rm <fs_name> {--yes-i-really-mean-it}
Subcommandrm_data_pool
removes the specified pool from FS’s list of
data pools. File data on this pool will become unavailable. Default data pool
cannot be removed.
用法:
ceph fs rm_data_pool <fs-name> <pool name/id>
Subcommandset
sets or updates a FS setting value for given FS name.
用法:
ceph fs set <fs-name> <fs-setting> <value>
Subcommandswap
swaps the names of two Ceph file system and updates
application tags on the pool of the file systems accordingly. Optionally,
FSIDs of the filesystems can also be swapped along with names by passing
--swap-fscids
.
用法:
ceph fs swap <fs1-name> <fs1-id> <fs2-name> <fs2-id> [--swap-fscids] {--yes-i-really-meant-it}
fsid
Show cluster’s FSID/UUID.
用法:
ceph fsid
health
Show cluster’s health.
用法:
ceph health {detail}
heap
Show heap usage info (available only if compiled with tcmalloc)
用法:
ceph tell <name (type.id)> heap dump|start_profiler|stop_profiler|stats
Subcommandrelease
to make TCMalloc to releases no-longer-used memory back to the kernel at once.
用法:
ceph tell <name (type.id)> heap release
Subcommand(get|set)_release_rate
get or set the TCMalloc memory release rate. TCMalloc releases
no-longer-used memory back to the kernel gradually. the rate controls how quickly this happens.
Increase this setting to make TCMalloc to return unused memory more frequently. 0 means never return
memory to system, 1 means wait for 1000 pages after releasing a page to system. It is 1.0
by default..
用法:
ceph tell <name (type.id)> heap get_release_rate|set_release_rate {<val>}
injectargs
Inject configuration arguments into monitor.
用法:
ceph injectargs <injected_args> [<injected_args>...]
log
Log supplied text to the monitor log.
用法:
ceph log <logtext> [<logtext>...]
mds
Manage metadata server configuration and administration. It uses some additional subcommands.
Subcommandcompat
manages compatible features. It uses some additional
subcommands.
Subcommandrm_compat
removes compatible feature.
用法:
ceph mds compat rm_compat <int[0-]>
Subcommandrm_incompat
removes incompatible feature.
用法:
ceph mds compat rm_incompat <int[0-]>
Subcommandshow
shows mds compatibility settings.
用法:
ceph mds compat show
Subcommandfail
forces mds to status fail.
用法:
ceph mds fail <role|gid>
Subcommandrm
removes inactive mds.
用法:
ceph mds rm <int[0-]> <name> (type.id)>
Subcommandrmfailed
removes failed mds.
用法:
ceph mds rmfailed <int[0-]>
Subcommandset_state
sets mds state of <gid> to <numeric-state>.
用法:
ceph mds set_state <int[0-]> <int[0-20]>
Subcommandstat
shows MDS status.
用法:
ceph mds stat
Subcommandrepaired
mark a damaged MDS rank as no longer damaged.
用法:
ceph mds repaired <role>
mon
Manage monitor configuration and administration. It uses some additional subcommands.
Subcommandadd
adds new monitor named <name> at <addr>.
用法:
ceph mon add <name> <IPaddr[:port]>
Subcommanddump
dumps formatted monmap (optionally from epoch)
用法:
ceph mon dump {<int[0-]>}
Subcommandgetmap
gets monmap.
用法:
ceph mon getmap {<int[0-]>}
Subcommandenable_stretch_mode
enables stretch mode, changing the peering
rules and failure handling on all pools. For a given PG to successfully peer
and be marked active, min_size
replicas will now need to be active under all
(currently two) CRUSH buckets of type <dividing_bucket>.
<tiebreaker_mon> is the tiebreaker mon to use if a network split happens.
<dividing_bucket> is the bucket type across which to stretch.
This will typically be datacenter
or other CRUSH hierarchy bucket type that
denotes physically or logically distant subdivisions.
<new_crush_rule> will be set as CRUSH rule for all pools.
用法:
ceph mon enable_stretch_mode <tiebreaker_mon> <new_crush_rule> <dividing_bucket>
Subcommandremove
removes monitor named <name>.
用法:
ceph mon remove <name>
Subcommandstat
summarizes monitor status.
用法:
ceph mon stat
mgr
Ceph manager daemon configuration and management.
Subcommanddump
dumps the latest MgrMap, which describes the active
and standby manager daemons.
用法:
ceph mgr dump
Subcommandfail
will mark a manager daemon as failed, removing it
from the manager map. If it is the active manager daemon a standby
will take its place.
用法:
ceph mgr fail <name>
Subcommandmodule ls
will list currently enabled manager modules (plugins).
用法:
ceph mgr module ls
Subcommandmodule enable
will enable a manager module. Available modules are included in MgrMap and visible via mgr dump
.
用法:
ceph mgr module enable <module>
Subcommandmodule disable
will disable an active manager module.
用法:
ceph mgr module disable <module>
Subcommandmetadata
will report metadata about all manager daemons or, if the name is specified, a single manager daemon.
用法:
ceph mgr metadata [name]
Subcommandversions
will report a count of running daemon versions.
用法:
ceph mgr versions
Subcommandcount-metadata
will report a count of any daemon metadata field.
用法:
ceph mgr count-metadata <field>
osd
Manage OSD configuration and administration. It uses some additional subcommands.
Subcommandblocklist
manage blocklisted clients. It uses some additional
subcommands.
Subcommandadd
add <addr> to blocklist (optionally until <expire> seconds
from now)
用法:
ceph osd blocklist add <EntityAddr> {<float[0.0-]>}
Subcommandls
show blocklisted clients
用法:
ceph osd blocklist ls
Subcommandrm
remove <addr> from blocklist
用法:
ceph osd blocklist rm <EntityAddr>
Subcommandblocked-by
prints a histogram of which OSDs are blocking their peers
用法:
ceph osd blocked-by
Subcommandcreate
creates new osd (with optional UUID and ID).
This command is DEPRECATED as of the Luminous release, and will be removed in a future release.
Subcommandnew
should instead be used.
用法:
ceph osd create {<uuid>} {<id>}
Subcommandnew
can be used to create a new OSD or to recreate a previously
destroyed OSD with a specific id. The new OSD will have the specified uuid,
and the command expects a JSON file containing the base64 cephx key for auth
entity client.osd.<id>, as well as optional base64 cepx key for dm-crypt
lockbox access and a dm-crypt key. Specifying a dm-crypt requires specifying
the accompanying lockbox cephx key.
用法:
ceph osd new {<uuid>} {<id>} -i {<params.json>}
The parameters JSON file is optional but if provided, is expected to maintain a form of the following format:
{
"cephx_secret": "AQBWtwhZdBO5ExAAIDyjK2Bh16ZXylmzgYYEjg==",
"crush_device_class": "myclass"
}
Or:
{
"cephx_secret": "AQBWtwhZdBO5ExAAIDyjK2Bh16ZXylmzgYYEjg==",
"cephx_lockbox_secret": "AQDNCglZuaeVCRAAYr76PzR1Anh7A0jswkODIQ==",
"dmcrypt_key": "<dm-crypt key>",
"crush_device_class": "myclass"
}
Or:
{
"crush_device_class": "myclass"
}
The “crush_device_class” property is optional. If specified, it will set the initial CRUSH device class for the new OSD.
Subcommandcrush
is used for CRUSH management. It uses some additional
subcommands.
Subcommandadd
adds or updates crushmap position and weight for <name> with
<weight> and location <args>.
用法:
ceph osd crush add <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]
Subcommandadd-bucket
adds no-parent (probably root) crush bucket <name> of
type <type>.
用法:
ceph osd crush add-bucket <name> <type>
Subcommandcreate-or-move
creates entry or moves existing entry for <name>
<weight> at/to location <args>.
用法:
ceph osd crush create-or-move <osdname (id|osd.id)> <float[0.0-]> <args>
[<args>...]
Subcommanddump
dumps crush map.
用法:
ceph osd crush dump
Subcommandget-tunable
get crush tunable straw_calc_version
用法:
ceph osd crush get-tunable straw_calc_version
Subcommandlink
links existing entry for <name> under location <args>.
用法:
ceph osd crush link <name> <args> [<args>...]
Subcommandmove
moves existing entry for <name> to location <args>.
用法:
ceph osd crush move <name> <args> [<args>...]
Subcommandremove
removes <name> from crush map (everywhere, or just at
<ancestor>).
用法:
ceph osd crush remove <name> {<ancestor>}
Subcommandrename-bucket
renames bucket <srcname> to <dstname>
用法:
ceph osd crush rename-bucket <srcname> <dstname>
Subcommandreweight
change <name>’s weight to <weight> in crush map.
用法:
ceph osd crush reweight <name> <float[0.0-]>
Subcommandreweight-all
recalculate the weights for the tree to
ensure they sum correctly
用法:
ceph osd crush reweight-all
Subcommandreweight-subtree
changes all leaf items beneath <name>
to <weight> in crush map
用法:
ceph osd crush reweight-subtree <name> <weight>
Subcommandrm
removes <name> from crush map (everywhere, or just at
<ancestor>).
用法:
ceph osd crush rm <name> {<ancestor>}
Subcommandrule
is used for creating crush rules. It uses some additional
subcommands.
Subcommandcreate-erasure
creates crush rule <name> for erasure coded pool
created with <profile> (default default).
用法:
ceph osd crush rule create-erasure <name> {<profile>}
Subcommandcreate-simple
creates crush rule <name> to start from <root>,
replicate across buckets of type <type>, using a choose mode of <firstn|indep>
(default firstn; indep best for erasure pools).
用法:
ceph osd crush rule create-simple <name> <root> <type> {firstn|indep}
Subcommanddump
dumps crush rule <name> (default all).
用法:
ceph osd crush rule dump {<name>}
Subcommandls
lists crush rules.
用法:
ceph osd crush rule ls
Subcommandrm
removes crush rule <name>.
用法:
ceph osd crush rule rm <name>
Subcommandset
used alone, sets crush map from input file.
用法:
ceph osd crush set
Subcommandset
with osdname/osd.id update crushmap position and weight
for <name> to <weight> with location <args>.
用法:
ceph osd crush set <osdname (id|osd.id)> <float[0.0-]> <args> [<args>...]
Subcommandset-tunable
set crush tunable <tunable> to <value>. The only
tunable that can be set is straw_calc_version.
用法:
ceph osd crush set-tunable straw_calc_version <value>
Subcommandshow-tunables
shows current crush tunables.
用法:
ceph osd crush show-tunables
Subcommandtree
shows the crush buckets and items in a tree view.
用法:
ceph osd crush tree
Subcommandtunables
sets crush tunables values to <profile>.
用法:
ceph osd crush tunables legacy|argonaut|bobtail|firefly|hammer|optimal|default
Subcommandunlink
unlinks <name> from crush map (everywhere, or just at
<ancestor>).
用法:
ceph osd crush unlink <name> {<ancestor>}
Subcommanddf
shows OSD utilization
用法:
ceph osd df {plain|tree}
Subcommanddeep-scrub
initiates deep scrub on specified osd.
用法:
ceph osd deep-scrub <who>
Subcommanddown
sets osd(s) <id> [<id>…] down.
用法:
ceph osd down <ids> [<ids>...]
Subcommanddump
prints summary of OSD map.
用法:
ceph osd dump {<int[0-]>}
Subcommanderasure-code-profile
is used for managing the erasure code
profiles. It uses some additional subcommands.
Subcommandget
gets erasure code profile <name>.
用法:
ceph osd erasure-code-profile get <name>
Subcommandls
lists all erasure code profiles.
用法:
ceph osd erasure-code-profile ls
Subcommandrm
removes erasure code profile <name>.
用法:
ceph osd erasure-code-profile rm <name>
Subcommandset
creates erasure code profile <name> with [<key[=value]> …]
pairs. Add a --force at the end to override an existing profile (IT IS RISKY).
用法:
ceph osd erasure-code-profile set <name> {<profile> [<profile>...]}
Subcommandfind
find osd <id> in the CRUSH map and shows its location.
用法:
ceph osd find <int[0-]>
Subcommandgetcrushmap
gets CRUSH map.
用法:
ceph osd getcrushmap {<int[0-]>}
Subcommandgetmap
gets OSD map.
用法:
ceph osd getmap {<int[0-]>}
Subcommandgetmaxosd
shows largest OSD id.
用法:
ceph osd getmaxosd
Subcommandin
sets osd(s) <id> [<id>…] in.
用法:
ceph osd in <ids> [<ids>...]
Subcommandlost
marks osd as permanently lost. THIS DESTROYS DATA IF NO
MORE REPLICAS EXIST, BE CAREFUL.
用法:
ceph osd lost <int[0-]> {--yes-i-really-mean-it}
Subcommandls
shows all OSD ids.
用法:
ceph osd ls {<int[0-]>}
Subcommandlspools
lists pools.
用法:
ceph osd lspools {<int>}
Subcommandmap
finds pg for <object> in <pool>.
用法:
ceph osd map <poolname> <objectname>
Subcommandmetadata
fetches metadata for osd <id>.
用法:
ceph osd metadata {int[0-]} (default all)
Subcommandout
sets osd(s) <id> [<id>…] out.
用法:
ceph osd out <ids> [<ids>...]
Subcommandok-to-stop
checks whether the list of OSD(s) can be
stopped without immediately making data unavailable. That is, all
data should remain readable and writeable, although data redundancy
may be reduced as some PGs may end up in a degraded (but active)
state. It will return a success code if it is okay to stop the
OSD(s), or an error code and informative message if it is not or if no
conclusion can be drawn at the current time. When --max <num>
is
provided, up to <num> OSDs IDs will return (including the provided
OSDs) that can all be stopped simultaneously. This allows larger sets
of stoppable OSDs to be generated easily by providing a single
starting OSD and a max. Additional OSDs are drawn from adjacent locations
in the CRUSH hierarchy.
用法:
ceph osd ok-to-stop <id> [<ids>...] [--max <num>]
Subcommandpause
pauses osd.
用法:
ceph osd pause
Subcommandperf
prints dump of OSD perf summary stats.
用法:
ceph osd perf
Subcommandpg-temp
set pg_temp mapping pgid:[<id> [<id>…]] (developers
only).
用法:
ceph osd pg-temp <pgid> {<id> [<id>...]}
Subcommandforce-create-pg
forces creation of pg <pgid>.
用法:
ceph osd force-create-pg <pgid>
Subcommandpool
is used for managing data pools. It uses some additional
subcommands.
Subcommandcreate
creates pool.
用法:
ceph osd pool create <poolname> {<int[0-]>} {<int[0-]>} {replicated|erasure}
{<erasure_code_profile>} {<rule>} {<int>} {--autoscale-mode=<on,off,warn>}
Subcommanddelete
deletes pool.
用法:
ceph osd pool delete <poolname> {<poolname>} {--yes-i-really-really-mean-it}
Subcommandget
gets pool parameter <var>.
用法:
ceph osd pool get <poolname> size|min_size|pg_num|pgp_num|crush_rule|write_fadvise_dontneed
Only for tiered pools:
ceph osd pool get <poolname> hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|
target_max_objects|target_max_bytes|cache_target_dirty_ratio|cache_target_dirty_high_ratio|
cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|
min_read_recency_for_promote|hit_set_grade_decay_rate|hit_set_search_last_n
Only for erasure coded pools:
ceph osd pool get <poolname> erasure_code_profile
使用all
to get all pool parameters that apply to the pool’s type:
ceph osd pool get <poolname> all
Subcommandget-quota
obtains object or byte limits for pool.
用法:
ceph osd pool get-quota <poolname>
Subcommandls
list pools
用法:
ceph osd pool ls {detail}
Subcommandmksnap
makes snapshot <snap> in <pool>.
用法:
ceph osd pool mksnap <poolname> <snap>
Subcommandrename
renames <srcpool> to <destpool>.
用法:
ceph osd pool rename <poolname> <poolname>
Subcommandrmsnap
removes snapshot <snap> from <pool>.
用法:
ceph osd pool rmsnap <poolname> <snap>
Subcommandset
sets pool parameter <var> to <val>.
用法:
ceph osd pool set <poolname> size|min_size|pg_num|
pgp_num|crush_rule|hashpspool|nodelete|nopgchange|nosizechange|
hit_set_type|hit_set_period|hit_set_count|hit_set_fpp|debug_fake_ec_pool|
target_max_bytes|target_max_objects|cache_target_dirty_ratio|
cache_target_dirty_high_ratio|
cache_target_full_ratio|cache_min_flush_age|cache_min_evict_age|
min_read_recency_for_promote|write_fadvise_dontneed|hit_set_grade_decay_rate|
hit_set_search_last_n
<val> {--yes-i-really-mean-it}
Subcommandset-quota
sets object or byte limit on pool.
用法:
ceph osd pool set-quota <poolname> max_objects|max_bytes <val>
Subcommandstats
obtain stats from all pools, or from specified pool.
用法:
ceph osd pool stats {<name>}
Subcommandapplication
is used for adding an annotation to the given
pool. By default, the possible applications are object, block, and file
storage (corresponding app-names are “rgw”, “rbd”, and “cephfs”). However,
there might be other applications as well. Based on the application, there
may or may not be some processing conducted.
Subcommanddisable
disables the given application on the given pool.
用法:
ceph osd pool application disable <pool-name> <app> {--yes-i-really-mean-it}
Subcommandenable
adds an annotation to the given pool for the mentioned
application.
用法:
ceph osd pool application enable <pool-name> <app> {--yes-i-really-mean-it}
Subcommandget
displays the value for the given key that is associated
with the given application of the given pool. Not passing the optional
arguments would display all key-value pairs for all applications for all
pools.
用法:
ceph osd pool application get {<pool-name>} {<app>} {<key>}
Subcommandrm
removes the key-value pair for the given key in the given
application of the given pool.
用法:
ceph osd pool application rm <pool-name> <app> <key>
Subcommandset
associates or updates, if it already exists, a key-value
pair with the given application for the given pool.
用法:
ceph osd pool application set <pool-name> <app> <key> <value>
Subcommandprimary-affinity
adjust osd primary-affinity from 0.0 <=<weight>
<= 1.0
用法:
ceph osd primary-affinity <osdname (id|osd.id)> <float[0.0-1.0]>
Subcommandprimary-temp
sets primary_temp mapping pgid:<id>|-1 (developers
only).
用法:
ceph osd primary-temp <pgid> <id>
Subcommandrepair
initiates repair on a specified osd.
用法:
ceph osd repair <who>
Subcommandreweight
reweights osd to 0.0 < <weight> < 1.0.
用法:
osd reweight <int[0-]> <float[0.0-1.0]>
Subcommandreweight-by-pg
reweight OSDs by PG distribution
[overload-percentage-for-consideration, default 120].
用法:
ceph osd reweight-by-pg {<int[100-]>} {<poolname> [<poolname...]}
{--no-increasing}
Subcommandreweight-by-utilization
reweights OSDs by utilization. It only reweights
outlier OSDs whose utilization exceeds the average, eg. the default 120%
limits reweight to those OSDs that are more than 20% over the average.
[overload-threshold, default 120 [max_weight_change, default 0.05 [max_osds_to_adjust, default 4]]]
用法:
ceph osd reweight-by-utilization {<int[100-]> {<float[0.0-]> {<int[0-]>}}}
{--no-increasing}
Subcommandrm
removes osd(s) <id> [<id>…] from the OSD map.
用法:
ceph osd rm <ids> [<ids>...]
Subcommanddestroy
marks OSD id as destroyed, removing its cephx
entity’s keys and all of its dm-crypt and daemon-private config key
entries.
This command will not remove the OSD from crush, nor will it remove the OSD from the OSD map. Instead, once the command successfully completes, the OSD will show marked as destroyed.
In order to mark an OSD as destroyed, the OSD must first be marked as lost.
用法:
ceph osd destroy <id> {--yes-i-really-mean-it}
Subcommandpurge
performs a combination of osd destroy
,
osd rm
和osd crush remove
.
用法:
ceph osd purge <id> {--yes-i-really-mean-it}
Subcommandsafe-to-destroy
checks whether it is safe to remove or
destroy an OSD without reducing overall data redundancy or durability.
It will return a success code if it is definitely safe, or an error
code and informative message if it is not or if no conclusion can be
drawn at the current time.
用法:
ceph osd safe-to-destroy <id> [<ids>...]
Subcommandscrub
initiates scrub on specified osd.
用法:
ceph osd scrub <who>
Subcommandset
sets cluster-wide <flag> by updating OSD map.
The full
flag is not honored anymore since the Mimic release, and
ceph osd set full
is not supported in the Octopus release.
用法:
ceph osd set pause|noup|nodown|noout|noin|nobackfill|
norebalance|norecover|noscrub|nodeep-scrub|notieragent
Subcommandsetcrushmap
sets crush map from input file.
用法:
ceph osd setcrushmap
Subcommandsetmaxosd
sets new maximum osd value.
用法:
ceph osd setmaxosd <int[0-]>
Subcommandset-require-min-compat-client
enforces the cluster to be backward
compatible with the specified client version. This subcommand prevents you from
making any changes (e.g., crush tunables, or using new features) that
would violate the current setting. Please note, This subcommand will fail if
any connected daemon or client is not compatible with the features offered by
the given <version>. To see the features and releases of all clients connected
to cluster, please see ceph features.
用法:
ceph osd set-require-min-compat-client <version>
Subcommandstat
prints summary of OSD map.
用法:
ceph osd stat
Subcommandtier
is used for managing tiers. It uses some additional
subcommands.
Subcommandadd
adds the tier <tierpool> (the second one) to base pool <pool>
(the first one).
用法:
ceph osd tier add <poolname> <poolname> {--force-nonempty}
Subcommandadd-cache
adds a cache <tierpool> (the second one) of size <size>
to existing pool <pool> (the first one).
用法:
ceph osd tier add-cache <poolname> <poolname> <int[0-]>
Subcommandcache-mode
specifies the caching mode for cache tier <pool>.
用法:
ceph osd tier cache-mode <poolname> writeback|proxy|readproxy|readonly|none
Subcommandremove
removes the tier <tierpool> (the second one) from base pool
<pool> (the first one).
用法:
ceph osd tier remove <poolname> <poolname>
Subcommandremove-overlay
removes the overlay pool for base pool <pool>.
用法:
ceph osd tier remove-overlay <poolname>
Subcommandset-overlay
set the overlay pool for base pool <pool> to be
<overlaypool>.
用法:
ceph osd tier set-overlay <poolname> <poolname>
Subcommandtree
prints OSD tree.
用法:
ceph osd tree {<int[0-]>}
Subcommandunpause
unpauses osd.
用法:
ceph osd unpause
Subcommandunset
unsets cluster-wide <flag> by updating OSD map.
用法:
ceph osd unset pause|noup|nodown|noout|noin|nobackfill|
norebalance|norecover|noscrub|nodeep-scrub|notieragent
pg
It is used for managing the placement groups in OSDs. It uses some additional subcommands.
Subcommanddebug
shows debug info about pgs.
用法:
ceph pg debug unfound_objects_exist|degraded_pgs_exist
Subcommanddeep-scrub
starts deep-scrub on <pgid>.
用法:
ceph pg deep-scrub <pgid>
Subcommanddump
shows human-readable versions of pg map (only ‘all’ valid
with plain).
用法:
ceph pg dump {all|summary|sum|delta|pools|osds|pgs|pgs_brief} [{all|summary|sum|delta|pools|osds|pgs|pgs_brief...]}
Subcommanddump_json
shows human-readable version of pg map in json only.
用法:
ceph pg dump_json {all|summary|sum|delta|pools|osds|pgs|pgs_brief} [{all|summary|sum|delta|pools|osds|pgs|pgs_brief...]}
Subcommanddump_pools_json
shows pg pools info in json only.
用法:
ceph pg dump_pools_json
Subcommanddump_stuck
shows information about stuck pgs.
用法:
ceph pg dump_stuck {inactive|unclean|stale|undersized|degraded [inactive|unclean|stale|undersized|degraded...]}
{<int>}
Subcommandgetmap
gets binary pg map to -o/stdout.
用法:
ceph pg getmap
Subcommandls
lists pg with specific pool, osd, state
用法:
ceph pg ls {<int>} {<pg-state> [<pg-state>...]}
Subcommandls-by-osd
lists pg on osd [osd]
用法:
ceph pg ls-by-osd <osdname (id|osd.id)> {<int>}
{<pg-state> [<pg-state>...]}
Subcommandls-by-pool
lists pg with pool = [poolname]
用法:
ceph pg ls-by-pool <poolstr> {<int>} {<pg-state> [<pg-state>...]}
Subcommandls-by-primary
lists pg with primary = [osd]
用法:
ceph pg ls-by-primary <osdname (id|osd.id)> {<int>}
{<pg-state> [<pg-state>...]}
Subcommandmap
shows mapping of pg to osds.
用法:
ceph pg map <pgid>
Subcommandrepair
starts repair on <pgid>.
用法:
ceph pg repair <pgid>
Subcommandscrub
starts scrub on <pgid>.
用法:
ceph pg scrub <pgid>
Subcommandstat
shows placement group status.
用法:
ceph pg stat
quorum
Cause a specific MON to enter or exit quorum.
用法:
ceph tell mon.<id> quorum enter|exit
quorum_status
Reports status of monitor quorum.
用法:
ceph quorum_status
report
Reports full status of cluster, optional title tag strings.
用法:
ceph report {<tags> [<tags>...]}
status
Shows cluster status.
用法:
ceph status
tell
Sends a command to a specific daemon.
用法:
ceph tell <name (type.id)> <command> [options...]
List all available commands.
用法:
ceph tell <name (type.id)> help
版本
Show mon daemon version
用法:
ceph version
选项
- -i infile, --in-file=infile
will specify an input file to be passed along as a payload with the command to the monitor cluster. This is only used for specific monitor commands.
- -o outfile, --out-file=outfile
will write any payload returned by the monitor cluster with its reply to outfile. Only specific monitor commands (e.g. osd getmap) return a payload.
- --setuser user
will apply the appropriate user ownership to the file specified by the option ‘-o’.
- --setgroup group
will apply the appropriate group ownership to the file specified by the option ‘-o’.
- -c ceph.conf, --conf=ceph.conf
Use ceph.conf configuration file instead of the default
/etc/ceph/ceph.conf
在启动期间确定监控器地址。
- --id CLIENT_ID, --user CLIENT_ID
Client id for authentication.
- --name CLIENT_NAME, -n CLIENT_NAME
Client name for authentication.
- --cluster CLUSTER
Name of the Ceph cluster.
- --admin-daemon ADMIN_SOCKET, daemon DAEMON_NAME
Submit admin-socket commands via admin sockets in /var/run/ceph.
- --admin-socket ADMIN_SOCKET_NOPE
You probably mean --admin-daemon
- -s, --status
Show cluster status.
- -w, --watch
Watch live cluster changes on the default ‘cluster’ channel
- -W, --watch-channel
Watch live cluster changes on any channel (cluster, audit, cephadm, or * for all)
- --watch-debug
Watch debug events.
- --watch-info
Watch info events.
- --watch-sec
Watch security events.
- --watch-warn
Watch warning events.
- --watch-error
Watch error events.
- --version, -v
Display version.
- --详细
Make verbose.
- --concise
Make less verbose.
- -f {json,json-pretty,xml,xml-pretty,plain,yaml}, --format
Format of output.
Note: yaml is only valid for orch commands.
- --daemon-output-file OUTPUT_FILE
When using --format=json|json-pretty, you may specify a file name on the host running the daemon to stream output to. Be mindful this is probably not the same machine running the ceph command. So to analyze the output, it will be necessary to fetch the file once the command completes.
OUTPUT_FILE may also be
:tmp:
, indicating that the daemon should create a temporary file (subject to configurations tmp_dir and tmp_file_template).The 9b591a: Ceph 对象存储 9dbb5f: (又名 RGW) 服务提供与 Amazon S3 和 OpenStack Swift 兼容的 RESTful API 接口。
tell
command will output json with the path to the output file written to, the size of the file, the result code of the command, and any output produced by the command.Note: this option is only used for
ceph tell
commands.
- --connect-timeout CLUSTER_TIMEOUT
Set a timeout for connecting to the cluster.
- --no-increasing
--no-increasing
is off by default. So increasing the osd weight is allowed using thereweight-by-utilization
ortest-reweight-by-utilization
commands. If this option is used with these commands, it will help not to increase osd weight even the osd is under utilized.
- --block
block until completion (scrub and deep-scrub only)
可用性
ceph是Ceph的一部分,Ceph是一个大规模可扩展、开源的分布式存储系统。请参阅https://docs.ceph.com中的Ceph文档以获取更多信息。