注意

本文档适用于 Ceph 开发版本。

radosgw-admin -- rados REST gateway user administration utility

概要

radosgw-admin 命令 [ 选项 ]

描述

radosgw-admin是一个 Ceph 对象网关用户管理工具。它用于创建和修改用户。

命令

radosgw-admin该工具提供以下管理命令:

user create

创建一个新用户。

user modify

修改用户。

user info

显示用户信息,包括任何子用户和密钥。

user rename

重命名用户。

user rm

删除用户。

user suspend

暂停用户。

user enable

恢复暂停后的用户。

user check

检查用户信息。

user stats

显示配额子系统统计的用户统计信息。

user list

列出所有用户。

caps add

添加用户功能。

caps rm

删除用户功能。

subuser create

创建一个新的子用户(主要适用于使用 Swift API 的客户端)。

subuser modify

修改子用户。

subuser rm

删除子用户。

key create

创建访问密钥。

key rm

删除访问密钥。

bucket list

列出桶,或者,如果使用 --bucket=<bucket> 指定了桶,则列出其对象。添加 --allow-unordered 会移除排序要求,可能为具有大量对象的桶更快地生成结果。

bucket limit check

显示桶分片统计信息。

bucket link

将桶链接到指定用户。

bucket unlink

从指定用户中解除链接桶。

bucket chown

将桶所有权更改为指定用户并更新对象 ACL。

bucket stats

列出桶统计信息以及其他有关桶的内部信息。

bucket rm

删除桶。

bucket check

检查桶索引。

bucket rewrite

重写指定桶中的所有对象。

bucket radoslist

列出包含指定桶所有对象数据的 RADOS 对象,如果 --bucket=<bucket> 指定了桶。否则,列出包含所有桶数据的 RADOS 对象。

bucket reshard

重分片桶的索引。

bucket sync disable

禁用桶同步。

bucket sync enable

启用桶同步。

bi get

检索桶索引对象条目。

bi put

存储桶索引对象条目。

bi list

列出原始桶索引条目。

bi purge

清理桶索引条目。

object rm

删除 S3/Swift 对象。包括 “--yes-i-really-mean-it” 来删除桶索引中的对象条目,例如如果它已损坏。

object stat

统计 S3/Swift 对象的元数据。

object manifest

显示 S3/Swift 对象的清单,生成包含数据的 RADOS 对象列表。

object unlink

从桶索引中解除链接 S3/Swift 对象。

object rewrite

重写指定的 S3/Swift 对象。

object reindex

将 S3/Swift 对象添加到其桶的索引中。很少用于紧急修复。

objects expire

运行过期对象清理。

period rm

删除一个周期。

period get

获取周期信息。

period get-current

获取当前周期信息。

period pull

拉取一个周期。

period push

推送一个周期。

period list

列出所有周期。

period update

更新暂存周期。

period commit

提交暂存周期。

quota set

设置配额参数。

quota enable

启用配额。

quota disable

禁用配额。

global quota get

查看全局配额参数。

global quota set

设置全局配额参数。

global quota enable

启用全局配额。

global quota disable

禁用全局配额。

realm create

创建一个新的区域。

realm rm

删除区域。

realm get

显示区域信息。

realm get-default

获取默认区域名称。

realm list

列出所有区域。

realm list-periods

列出所有区域周期。

realm rename

重命名区域。

realm set

设置区域信息(需要 infile)。

realm default

将区域设置为默认。

realm pull

拉取区域及其当前周期。

zonegroup add

将区域添加到区域组。

zonegroup create

创建新的区域组信息。

zonegroup default

设置默认区域组。

zonegroup rm

删除区域组信息。

zonegroup get

显示区域组信息。

zonegroup modify

修改现有的区域组。

zonegroup set

设置区域组信息(需要 infile)。

zonegroup remove

从区域组中删除区域。

zonegroup rename

重命名区域组。

zonegroup list

列出集群上设置的 所有区域组。

zonegroup placement list

列出区域组的放置目标。

zonegroup placement add

向区域组添加放置目标 ID。

zonegroup placement modify

修改特定区域组的放置目标。

zonegroup placement rm

从区域组中删除放置目标。

zonegroup placement default

设置区域组的默认放置目标。

zone create

创建一个新的区域。

zone rm

删除区域。

zone get

显示区域集群参数。

zone set

设置区域集群参数(需要 infile)。

zone modify

修改现有区域。

zone list

列出集群上设置的 所有区域。

metadata sync status

获取元数据同步状态。

metadata sync init

初始化元数据同步。

metadata sync run

运行元数据同步。

data sync status

获取指定源区域的 数据同步状态。

data sync init

初始化指定源区域的数据同步。

data sync run

运行指定源区域的数据同步。

sync error list

列出同步错误。

sync error trim

修剪同步错误。

zone rename

重命名区域。

zone placement list

列出区域的放置目标。

zone placement add

添加区域放置目标。

zone placement modify

修改区域放置目标。

zone placement rm

删除区域放置目标。

pool add

添加用于数据放置的现有存储池。

pool rm

从数据放置集中删除现有存储池。

pools list

列出放置活动集。

policy

显示桶/对象策略(例如权限/ACL 等)。

log list

列出日志对象。

log show

从特定对象或(桶 + 日期 + 桶 ID)转储日志。

log rm

删除日志对象。

usage show

显示使用信息(可选用户和日期范围)。

usage trim

修剪使用信息(可选用户和日期范围)。

gc list

转储过期垃圾回收对象(指定 --include-all 列出所有条目,包括未过期的)。

gc process

手动处理垃圾。

lc get

获取桶的生命周期配置。

lc list

列出所有桶的生命周期进度。

lc process

手动处理生命周期转换。如果指定了桶(例如,通过 --bucket_id 或通过 --bucket 和可选的 --tenant),则仅处理该桶。

metadata get

获取元数据信息。

metadata put

存储元数据信息。

metadata rm

删除元数据信息。

metadata list

列出元数据信息。

mdlog list

列出多站点部署所需的元数据日志。

mdlog trim

手动修剪元数据日志,而不是依赖网关的集成日志同步。

mdlog status

读取元数据日志状态。

bilog list

列出多站点部署所需的桶索引日志。

bilog trim

手动修剪桶索引日志(使用 start-marker, end-marker)而不是依赖网关的集成日志同步。

datalog list

列出多站点部署所需的数据日志。

datalog trim

手动修剪数据日志,而不是依赖网关的集成日志同步。

datalog status

读取数据日志状态。

orphans find

初始化并运行泄露的 RADOS 对象的搜索。

orphans finish

清理泄露的 RADOS 对象的搜索。

orphans list-jobs

列出当前孤儿搜索作业 ID。

role create

创建一个新的用于 STS(安全令牌服务)的角色。

role rm

删除角色。

role get

获取角色。

role list

列出具有指定路径前缀的角色。

role modify

修改现有角色的假设角色策略。

role-policy put

向角色添加/更新权限策略。

role-policy list

列出附加到角色的策略。

role-policy get

获取给定角色中嵌入的指定内联策略文档。

role-policy rm

删除附加到角色的策略

reshard add

安排桶的重分片

reshard list

列出所有正在重分片或计划重分片的桶

reshard process

安排重分片作业的处理过程

reshard status

桶的重分片状态

reshard cancel

取消桶的重分片

topic list

列出桶通知主题

topic get

获取桶通知主题

topic rm

删除桶通知主题

topic stats

获取持久主题的桶通知统计信息(即保留、条目和大小)

topic dump

以 JSON 格式转储所有待处理的桶通知

选项

-c ceph.conf, --conf=ceph.conf

使用ceph.conf配置文件而不是默认的/etc/ceph/ceph.conf在启动期间确定监控地址。

-m monaddress[:port]

连接到指定的监控器(而不是从 ceph.conf 中选择一个)。

--tenant=<tenant>

租户的名称。

--uid=uid

要操作的用户。

--new-uid=uid

用户的新的 ID。与“user rename”命令一起使用。

--subuser=<name>

子用户的名称。

--access-key=<key>

S3 访问密钥。

--email=email

用户的电子邮件地址。

--secret/--secret-key=<key>

密钥。

--gen-access-key

生成随机访问密钥(用于 S3)。

--gen-secret

生成随机密钥。

--generate-key

创建带有或不带凭证的用户。

--key-type=<type>

密钥类型,选项为:swift, s3。

--temp-url-key[-2]=<key>

临时 URL 密钥。

--max-buckets

用户最大桶数(0 表示无限制,负值表示禁用桶创建)。

--access=<access>

设置子用户的访问权限。

--display-name=<name>

用户的显示名称。

--admin

在用户上设置管理员标志。

--system

在用户上设置系统标志。

--bucket=[tenant-id/]bucket

指定桶名称。如果未指定 tenant-id,则使用用户 (--uid) 的 tenant-id。

--pool=<pool>

指定存储池名称。orphans find作为扫描泄露 RADOS 对象的数据池。

--object=object

指定对象名称。

--date=yyyy-mm-dd

日期格式为 yyyy-mm-dd。

--start-date=yyyy-mm-dd

开始日期格式为 yyyy-mm-dd。

--end-date=yyyy-mm-dd

结束日期格式为 yyyy-mm-dd。

--bucket-id=<bucket-id>

指定桶 ID。

--bucket-new-name=[tenant-id/]<bucket>

对于bucket link使用来重命名桶。

--shard-id=<shard-id>

对于 mdlog list, bi list, data sync status 是可选的。对于mdlog trim.

--max-entries=<entries>

对于列出操作,指定最大条目数。

--purge-data

指定后,删除用户时也会清除用户的数据。

--purge-keys

指定后,删除子用户时也会清除子用户的密钥。

--purge-objects

指定后,删除桶时也会清除其中的所有对象。

--metadata-key=<key>

从其中检索元数据的密钥,与metadata get.

--remote=<remote>

远程网关的区域或区域组 ID。

--period=<id>

周期 ID。

--url=<url>

推送/拉取周期或区域的 URL。

--epoch=<number>

周期纪元。

--commit

在“period update”期间提交周期。

--staging

获取暂存周期信息。

--master

设置为主。

--master-zone=<id>

主区域 ID。

--rgw-realm=<name>

区域名称。

--realm-id=<id>

区域 ID。

--realm-new-name=<name>

区域的新名称。

--rgw-zonegroup=<name>

区域组名称。

--zonegroup-id=<id>

区域组 ID。

--zonegroup-new-name=<name>

区域组的新名称。

--rgw-zone=<zone>

网关运行的区域。

--zone-id=<id>

区域 ID。

--zone-new-name=<name>

区域的新名称。

--source-zone

数据同步的源区域。

--default

将实体(区域、区域组、区域)设置为默认。

--只读

将区域设置为只读,当添加到区域组时。

--placement-id

区域组放置命令的放置 ID。

--tags=<list>

区域组放置添加和修改命令的标签列表。

--tags-add=<list>

区域组放置修改命令要添加的标签列表。

--tags-rm=<list>

区域组放置修改命令要删除的标签列表。

--endpoints=<list>

区域端点。

--index-pool=<pool>

放置目标索引存储池。

--data-pool=<pool>

放置目标数据存储池。

--data-extra-pool=<pool>

放置目标数据额外(非 EC)存储池。

--placement-index-type=<type>

放置目标索引类型(normal, indexless 或 #id)。

--placement-inline-data=<true>

放置目标配置为在头部对象中内联存储数据块的标志。

--tier-type=<type>

区域层类型。

--tier-config=<k>=<v>[,...]

设置区域层配置键,值。

--tier-config-rm=<k>[,...]

清除区域层配置键。

--sync-from-all[=false]

设置/重置区域是否从所有区域组对等方同步。

--sync-from=[zone-name][,...]

设置要同步的区域列表。

--sync-from-rm=[zone-name][,...]

从要同步的区域列表中删除区域。

生成新的用户:

Override a zone’s or zonegroup’s default number of bucket index shards. This option is accepted by the ‘zone create’, ‘zone modify’, ‘zonegroup add’, and ‘zonegroup modify’ commands, and applies to buckets that are created after the zone/zonegroup changes take effect.

--fix

Fix the bucket index in addition to checking it.

--check-objects

Bucket check: Rebuilds the bucket index according to actual object state.

--format=<format>

Specify output format for certain operations. Supported formats: xml, json.

--sync-stats

Option for the ‘user stats’ command. When specified, it will update user stats with the current stats reported by the user’s buckets indexes.

--show-config

Show configuration.

--show-log-entries=<flag>

Enable/disable dumping of log entries on log show.

--show-log-sum=<flag>

Enable/disable dump of log summation on log show.

--skip-zero-entries

Log show only dumps entries that don’t have zero value in one of the numeric field.

--infile

Specify a file to read when setting data.

--categories=<list>

Comma separated list of categories, used in usage show.

--caps=<caps>

List of capabilities (e.g., “usage=read, write; user=read”).

--compression=<compression-algorithm>

Placement target compression algorithm (lz4|snappy|zlib|zstd).

--yes-i-really-mean-it

Required as a guardrail for certain destructive operations.

--min-rewrite-size

Specify the minimum object size for bucket rewrite (default 4M).

--max-rewrite-size

Specify the maximum object size for bucket rewrite (default ULLONG_MAX).

--min-rewrite-stripe-size

Specify the minimum stripe size for object rewrite (default 0). If the value is set to 0, then the specified object will always be rewritten when restriping.

--warnings-only

When specified with bucket limit check, list only buckets nearing or over the current max objects per shard value.

--bypass-gc

When specified with bucket deletion, triggers object deletion without involving GC.

--inconsistent-index

When specified with bucket deletion and bypass-gc set to true, ignores bucket index consistency.

--max-concurrent-ios

Maximum concurrent bucket operations. Affects operations that scan the bucket index, e.g., listing, deletion, and all scan/search operations such as finding orphans or checking the bucket index. The default is 32.

配额选项

--max-objects

Specify the maximum number of objects (negative value to disable).

--max-size

Specify the maximum object size (in B/K/M/G/T, negative value to disable).

--quota-scope

The scope of quota (bucket, user).

孤儿搜索选项

--num-shards

Number of shards to use for temporary scan info

--orphan-stale-secs

Number of seconds to wait before declaring an object to be an orphan. The efault is 86400 (24 hours).

--job-id

Set the job id (for orphans find)

孤儿 list-jobs 选项

--extra-info

Provide extra info in the job list.

角色选项

--role-name

The name of the role to create.

--path

The path to the role.

--assume-role-policy-doc

The trust relationship policy document that grants an entity permission to assume the role.

--policy-name

The name of the policy document.

--policy-doc

The permission policy document.

--path-prefix

The path prefix for filtering the roles.

桶通知/PubSub 选项

--topic

The bucket notifications/pubsub topic name.

--subscription

The pubsub subscription name.

--event-id

The event id in a pubsub subscription.

示例

Generate a new user:

$ radosgw-admin user create --display-name="johnny rotten" --uid=johnny
{ "user_id": "johnny",
  "rados_uid": 0,
  "display_name": "johnny rotten",
  "email": "",
  "suspended": 0,
  "subusers": [],
  "keys": [
        { "user": "johnny",
          "access_key": "TCICW53D9BQ2VGC46I44",
          "secret_key": "tfm9aHMI8X76L3UdgE+ZQaJag1vJQmE6HDb5Lbrz"}],
  "swift_keys": []}

删除用户:

$ radosgw-admin user rm --uid=johnny

重命名用户:

$ radosgw-admin user rename --uid=johnny --new-uid=joe

删除用户及其所有相关桶及其内容:

$ radosgw-admin user rm --uid=johnny --purge-data

删除桶:

$ radosgw-admin bucket rm --bucket=foo

将桶链接到指定用户:

$ radosgw-admin bucket link --bucket=foo --bucket_id=<bucket id> --uid=johnny

从指定用户中解除链接桶:

$ radosgw-admin bucket unlink --bucket=foo --uid=johnny

重命名桶:

$ radosgw-admin bucket link --bucket=foo --bucket-new-name=bar --uid=johnny

将桶从旧的全局租户空间移动到指定的租户:

$ radosgw-admin bucket link --bucket=foo --uid='12345678$12345678'

将桶链接到指定用户并更改对象 ACL:

$ radosgw-admin bucket chown --bucket=foo --uid='12345678$12345678'

显示桶从 2012 年 4 月 1 日的日志:

$ radosgw-admin log show --bucket=foo --date=2012-04-01-01 --bucket-id=default.14193.1

显示用户从 2012 年 2012 年 3 月 1 日到(但不包括)4 月 1 日的使用信息:

$ radosgw-admin usage show --uid=johnny \
                --start-date=2012-03-01 --end-date=2012-04-01

仅显示所有用户的摘要使用信息:

$ radosgw-admin usage show --show-log-entries=false

修剪用户的使用信息直到 2012 年 3 月 9 日:

$ radosgw-admin usage trim --uid=johnny --end-date=2012-04-01

可用性

radosgw-admin是Ceph的一部分,Ceph是一个大规模可扩展、开源的分布式存储系统。请参考Ceph文档https://docs.ceph.com

参见

ceph(8)radosgw(8)

由 Ceph 基金会提供

Ceph 文档是一个由非盈利Ceph 基金会资助和托管的社会资源。。如果您想支持此项目和其他工作,请考虑现在加入.