ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

分布式存储Ceph(四) Cephx认证机制

2021-11-22 14:36:35  阅读:328  来源: 互联网

标签:Cephx ceph key caps Ceph client allow osd 分布式


五 cephx认证机制

  • https://docs.ceph.com/en/pacific/rados/configuration/auth-config-ref/   # 配置参考
  • https://docs.ceph.com/en/pacific/architecture/#high-availability-authentication # 高可用认证

5.1 cephx协议

  • ceph使用cephx协议对客户端进行身份认证。
  • cephx用于对ceph保存的数据进行认证访问和授权,用于对访问ceph的请求进行认证和授权检测,与mon通信的请求都要经过ceph认证通过,但是也可以在mon节点关闭ceph认证,但是关闭认证之后任何访问都将被允许,因此无法保证数据的安全性。

5.2 授权流程

  • 每个mon节点都可以对客户端进行身份认证并分发秘钥,因此多个mon节点就不存在单点故障和认证性能瓶颈。
  • mon节点会返回用于身份认证的数据结构,其中包含获取ceph服务时用到的session key,session key通过客户端秘钥进行加密,秘钥是在客户端提前配置好的, /etc/ceph/ceph.client.admin.keying
  • 客户端使用session key向mon请求所需的服务,mon向客户端提供一个tiket,用户向实际处理数据的OSD等服务验证客户端身份,mon和OSD共享一个secret,因此OSD会信息所有mon发放的tiket。 tiket存在有效期。
  • cephx身份验证功能仅限制在ceph的各组件之间,不能扩展到其它非ceph组件,ceph只负责认证授权,不能解决数据传输的加密问题。
  1. 客户端向mon请求认证;
  2. mon生成session key,用key加密后发送给客户端;
  3. 客户端收到后解密key得到session key,向mon申请tikey;
  4. mon收到请求后验证session key,并向客户端发送tikey;
  5. 客户端收到tiket后,用tikey访问OSD;
  6. OSD验证tiket并返回数据。

5.3 访问流程

  • 无论ceph客户端是那种类型,例如块设备、对象存储、文件系统,ceph都会在存储池中将所有数据存储为对象。
  • ceph用户需要拥有存储池访问权限,才能读取和写入数据。
  • ceph用户必须拥有执行权限才能使用ceph的管理命令。

5.4 ceph用户

  • 用户是指个人(ceph管理者)或系统参与者(mon/osd/mds)。
  • 通过创建用户,可以控制用户或那个参与者能够访问ceph存储集群、以及可访问的存储池及存储池的数据。
  • ceph支持多种类型的用户,但可管理的用户都属于client类型。
  • 区分用户类型的原因在于mon/osd/mds等系统组件使用cephx协议,但是他们非为客户端。
  • 通过点号来分割用户类型和用户名,格式为TYPE.ID,例如client.admin.
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ cat /etc/ceph/ceph.client.admin.keyring
[client.admin]
        key = AQALKythrxA6IhAAVDlgRrH+xWLn2FYbXAFRaw==
        caps mds = "allow *"
        caps mgr = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"

5.5 ceph授权和使能

5.5.1 授权基础

  • ceph基于使能/能力(Capabilities,简称caps)来描述用户可针对mon/osd或者mds使用的授权范围或级别。
  • 通常语法格式:daemon-type 'allow caps' [.....]

5.5.2 能力一览表

点击查看代码
r: 向用户授予读取权限。访问监视器(mon)以检索CRUSH运行图时需要由此能力。
w:向用户授予针对对象的写入权限。
x: 授予用户调用类方法(包括读取和写入)的能力,以及在监视器中执行auth操作的能力。
*:授予用户对特定守护进程/存储池的读取、写入和执行权限,以及执行管理命令的能力

class-read: 授予用户调用类读取方法的能力,属于是x能力的子集。
class-write: 授予用户调用类写入方法的能力,属于是x能力的子集。

profile osd: 授予用户以某个OSD身份连接到其它OSD或监视器的权限。授予OSD权限,使OSD能够处理复制检测信号流量和状态报告(获取OSD的状态信息)。
profile mds:授予用户以某个MDS身份连接到其它MDS或监视器权限。
profile bootstrap-osd:授予用户引导OSD的权限(初始化OSD并将OSD加入ceph集群),授权给部署工具,使其在引导OSD时有权添加秘钥。
profile bootstrap-mds:授予用户引导元数据服务器的权限,授权部署工具权限,使其在引导元数据服务器时有权添加秘钥。

5.5.3 MON能力

点击查看代码
#包括r/w/x和allow profile cap(caph的运行图)
例如:
mon 'allow rwx'
mon 'allow profile osd'

5.5.4 OSD能力

#包括r/w/x、clas-read、class-write和profile osd,另外OSD能力还允许进行存储池和名称空间设置。

例如:
osd 'allow capability' [pool=poolname] [namespace=namespace-name]

5.5.5 MDS能力

#只需要allow或空都表示允许

例如:
mds 'allow'

5.6 ceph用户管理

5.6.1 用户管理基础

  • 用户管理功能可以让ceph集群管理员能够直接在ceph集群中创建、更新和删除用户。
  • 在ceph集群中创建或删除用户时,可能需要将秘钥分发到客户端,以便将秘钥添加到秘钥文件中/etc/ceph/ceph.client.admin.keying,此文件种可以包含一个或者多个用户认证信息,凡是拥有此文件的节点,将具有访问ceph的权限,而且可以使用其中任何一个账户的权限,此文件类似于linux系统的/etc/passwd文件。

5.6.2 ceph auth 使用帮助

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth -h
 General usage:
 ==============
usage: ceph [-h] [-c CEPHCONF] [-i INPUT_FILE] [-o OUTPUT_FILE]
            [--setuser SETUSER] [--setgroup SETGROUP] [--id CLIENT_ID]
            [--name CLIENT_NAME] [--cluster CLUSTER]
            [--admin-daemon ADMIN_SOCKET] [-s] [-w] [--watch-debug]
            [--watch-info] [--watch-sec] [--watch-warn] [--watch-error]
            [-W WATCH_CHANNEL] [--version] [--verbose] [--concise]
            [-f {json,json-pretty,xml,xml-pretty,plain,yaml}]
            [--connect-timeout CLUSTER_TIMEOUT] [--block] [--period PERIOD]

Ceph administration tool

optional arguments:
-h, --help request mon help
-c CEPHCONF, --conf CEPHCONF
ceph configuration file
-i INPUT_FILE, --in-file INPUT_FILE
input file, or "-" for stdin
-o OUTPUT_FILE, --out-file OUTPUT_FILE
output file, or "-" for stdout
--setuser SETUSER set user file permission
--setgroup SETGROUP set group file permission
--id CLIENT_ID, --user CLIENT_ID
client id for authentication
--name CLIENT_NAME, -n CLIENT_NAME
client name for authentication
--cluster CLUSTER cluster name
--admin-daemon ADMIN_SOCKET
submit admin-socket commands ("help" for help)
-s, --status show cluster status
-w, --watch watch live cluster changes
--watch-debug watch debug events
--watch-info watch info events
--watch-sec watch security events
--watch-warn watch warn events
--watch-error watch error events
-W WATCH_CHANNEL, --watch-channel WATCH_CHANNEL
watch live cluster changes on a specific channel
(e.g., cluster, audit, cephadm, or '*' for all)
--version, -v display version
--verbose make verbose
--concise make less verbose
-f {json,json-pretty,xml,xml-pretty,plain,yaml}, --format {json,json-pretty,xml,xml-pretty,plain,yaml}
--connect-timeout CLUSTER_TIMEOUT
set a timeout for connecting to the cluster
--block block until completion (scrub and deep-scrub only)
--period PERIOD, -p PERIOD
polling period, default 1.0 second (for polling
commands only)

Local commands

ping <mon.id> Send simple presence/life test to a mon
<mon.id> may be 'mon.*' for all mons
daemon {type.id|path} <cmd>
Same as --admin-daemon, but auto-find admin socket
daemonperf {type.id | path} [stat-pats] [priority] [<interval>] [<count>]
daemonperf {type.id | path} list|ls [stat-pats] [priority]
Get selected perf stats from daemon/admin socket
Optional shell-glob comma-delim match string stat-pats
Optional selection priority (can abbreviate name):
critical, interesting, useful, noninteresting, debug
List shows a table of all available stats
Run <count> times (default forever),
once per <interval> seconds (default 1)

Monitor commands:

auth add <entity> [<caps>...] add auth info for <entity> from input file,
or random key if no input is given, and/or
any caps specified in the command
auth caps <entity> <caps>... update caps for <name> from caps specified
in the command
auth export [<entity>] write keyring for requested entity, or
master keyring if none given
auth get <entity> write keyring file with requested key
auth get-key <entity> display requested key
auth get-or-create <entity> [<caps>...] add auth info for <entity> from input file,
or random key if no input given, and/or any
caps specified in the command
auth get-or-create-key <entity> [<caps>...] get, or add, key for <name> from system/caps
pairs specified in the command. If key
already exists, any given caps must match
the existing caps for that key.
auth import auth import: read keyring file from -i <file>
auth ls list authentication state
auth print-key <entity> display requested key
auth print_key <entity> display requested key
auth rm <entity> remove all caps for <name>

5.6.3 用户管理

5.6.3.1 列出用户

5.6.3.1.1 列出用户
点击查看代码
# 针对用户采用TYPE.ID表示法,例如osd.0指定是osd类并且ID为0的用户(节点),client.admin是针对client类型的用户,其ID为admin。
ceph@ceph-deploy:~/ceph-cluster$ ceph auth ls
osd.0
        key: AQCGsDVhhhXOAxAAD7GOy2/7BctI1wRwHK17OA==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.1
        key: AQAVsTVhp80wCxAA5nJA080MT3BjWtEzgjjwTQ==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.2
        key: AQCA5DVhV53BFRAA/HbGphI7pVsUGIlliF1GYw==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.3
        key: AQDLtDVhbgzOGhAAuxYy1eISS2jAgWNQMKp+Cg==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.4
        key: AQArtTVh67tKIxAA9fR3RaP9tHE2LQ0dHABKqw==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.5
        key: AQCftTVhcVw0ChAAH5oEXBvQ8VEl51tTBJ7gMQ==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.6
        key: AQBZtjVhSeWQGRAAKEt6qSw0JhaS1cXHsH7ZzQ==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
osd.7
        key: AQD4tzVhpmG3JRAAWBQYh+BFXrN82qsQxlrUHw==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *        
osd.8
        key: AQA5uDVhkEoKARAAa6Z4eEcme3yxVUN1hzBplQ==
        caps: [mgr] allow profile osd
        caps: [mon] allow profile osd
        caps: [osd] allow *
client.admin
        key: AQALKythrxA6IhAAVDlgRrH+xWLn2FYbXAFRaw==
        caps: [mds] allow *
        caps: [mgr] allow *
        caps: [mon] allow *
        caps: [osd] allow *
client.bootstrap-mds
        key: AQALKythdSI6IhAAP/QG4NkILRTELptXEMYspA==
        caps: [mon] allow profile bootstrap-mds
client.bootstrap-mgr
        key: AQALKythMS86IhAAYztFGK8yvtXvrhU1GJM2Uw==
        caps: [mon] allow profile bootstrap-mgr
client.bootstrap-osd
        key: AQALKythwDk6IhAA9kqvq3TMGiIkjsS1JWTtLg==
        caps: [mon] allow profile bootstrap-osd
client.bootstrap-rbd
        key: AQALKythB0U6IhAAS4daHonswhJtdbtuWvGk1w==
        caps: [mon] allow profile bootstrap-rbd
client.bootstrap-rbd-mirror
        key: AQALKythSlA6IhAAHuhETKA8j5l+U6kUJHpfZQ==
        caps: [mon] allow profile bootstrap-rbd-mirror
client.bootstrap-rgw
        key: AQALKythNFs6IhAA3fq6Q6KJQpxEZG0OEL2fUA==
        caps: [mon] allow profile bootstrap-rgw
mgr.ceph-mgr-01
        key: AQCCPithsDrjERAArrm5PowGLYrEUnjHlmaA/Q==
        caps: [mds] allow *
        caps: [mon] allow profile mgr
        caps: [osd] allow *
mgr.ceph-mgr-02
        key: AQBbITdh+dHoCxAAAYdKmuFK09dJ9axa0w72cA==
        caps: [mds] allow *
        caps: [mon] allow profile mgr
        caps: [osd] allow *
installed auth entries:
5.6.3.1.2  导出用户信息
ceph@ceph-deploy:~/ceph-cluster$ ceph auth ls -o auth_all.key
installed auth entries:

5.6.3.2  获取指定用户信息

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.admin
[client.admin]
        key = AQALKythrxA6IhAAVDlgRrH+xWLn2FYbXAFRaw==
        caps mds = "allow *"
        caps mgr = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
exported keyring for client.admin

5.6.3.3 ceph auth add

  • 此命令是添加用户的规范方法。它会创建用户、生成秘钥,并添加所有指定的能力。
5.6.3.3.1 添加用户
ceph@ceph-deploy:~/ceph-cluster$ ceph auth add client.wgs mon 'allow r' osd 'allow rwx pool=wgspool'
added key for client.wgs
5.6.3.3.2 验证用户
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs                                 for <entity> from input file, or random key if no input is[client.wgs]                                                                               any caps specified in the command
        key = AQCzwkZhgvOIEhAAJxUykVvuDsqPBfCWDoBG9w==                                    r <name> from caps specified in the command
        caps mon = "allow r"                                                              for requested entity, or master keyring if none given
        caps osd = "allow rwx pool=wgspool"                                               file with requested key
exported keyring for client.wgs   

5.6.3.4 ceph auth get-or-create

  • 此命令是创建用户较为常见方式之一,会返回包含用户名和密钥的密钥文,如果该用户已存在,此命令只以密钥文件格式返回用户名和密钥,还可以使用-o指定文件名选项将输出保存到某个文件。
5.6.3.4.1 创建用户
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get-or-create client.wgs01 mon 'allow r' osd 'allow rwx pool=wgspool'
[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==
5.6.3.4.2 验证用户
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs01[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==                                            
        caps mon = "allow r"                                                              
        caps osd = "allow rwx pool=wgspool"                                              
exported keyring for client.wgs01
5.6.3.4.3 创建已存在的用户
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get-or-create client.wgs01 mon 'allow r' osd 'allow rwx pool=wgspool'
[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==
5.6.3.4.4 导出用户信息
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get-or-create client.wgs01 mon 'allow r' osd 'allow rwx pool=wgspool' -o wgs.key
ceph@ceph-deploy:~/ceph-cluster$ cat wgs.key
[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==

5.6.3.5  ceph auth get-or-cereate-key

  • 此命令是创建用户并返回用户秘钥,对于只需要秘钥的客户端,此命令非常有用。如果该用户已存在,此命令只返回密钥
  • 创建客户端时,科技创建不具有能力的用户。不具有能力的用户可以进行身份验证,但不能执行其它操作,此类客户端无法从监视器检索集群地图,如果希望稍后在添加能力,可以使用ceph auth caps 命令创建一个不具有能力的用户。
  • 典型的用户至少对ceph monitor具有读取功能,并对ceph osd具有读取和写入功能。此外,用户的osd权限通常限制为只能访问特定的存储池。
点击查看代码
#用户有key就显示没有就创建
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get-or-create-key client.wgs01 mon 'allow r' osd 'allow rwx pool=wgspool'
AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==

5.6.3.6 ceph auth print-key

点击查看代码
#只获取单个指定用户key信息
ceph@ceph-deploy:~/ceph-cluster$ ceph auth print-key client.wgs01
AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==

5.6.3.7 ceph auth caps

  • 使用ceph auth caps命令可以指定用户以及更改用户的能力,设置新能力会完全覆盖当前的能力,因此,要加上之前的用户已经拥有的和新的能力,如果看当前能力,可以运行ceph auth get USERTYPE.USERID,如果要添加能力,使用以下格式时还需要指定现有能力
    • ceph auth USERTYPE.ID daemon 'allow [r|w|x] [pool=pool-name] [namespace=namespace-name] '  
5.6.3.7.1 查看用户当前权限
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs01
[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==
        caps mon = "allow r"
        caps osd = "allow rwx pool=wgspool"
exported keyring for client.wgs01
5.6.3.7.2 修改用户权限
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth caps client.wgs01 mon 'allow r' osd 'allow rw pool=wgspool'
updated caps for client.wgs01
5.6.3.7.3 验证权限
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs01
[client.wgs01]
        key = AQCixkZhajt0FBAAB9Tvd938Ntv3zAM7rNjLdw==
        caps mon = "allow r"
        caps osd = "allow rw pool=wgspool"
exported keyring for client.wgs01

5.6.3.8 ceph auth del

  • 要删除用户使用 ceph auth del TYPE.ID,其中TYPE是client、osd、mon或mds之一,ID是用户名或守护进程ID
点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth del client.wgs01
updated

5.7 密钥管理

5.7.1 密钥管理基础

  • ceph密钥环是一个保存了secrets、keys、certificates并且能够让客户端通过认证访问ceph的keyring file(集合文件),一个keyring file可以保存一个或者多个认证信息,每一个key都有一个实体名称加权限,类型为:
    • {client、mon、mds、osd}.name
  • 当客户端访问ceph集群时,ceph会使用以下四个密钥环文件预设密钥环设置
    • /etc/ceph/<$cluster name>.<user $type>.<user.$id>.keyring #保存单个用户的keyring
    • /etc/ceph/cluster.keyring  #保存多个用户的keyring
    • /etc/ceph/keyring #为定义集群名称的多个用户的keyring
    • /etc/ceph/keyring.bin #编译后的二进制文件

5.7.2 创建用户密钥环文件

  • 使用ceph-authtool命令为其创建用户密钥环文件。

5.7.2.1 ceph-authtool使用帮助

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -h
usage: ceph-authtool keyringfile [OPTIONS]...
where the options are:  
  -l, --list                    will list all keys and capabilities present in                                
  								the keyring
  -p, --print-key               will print an encoded key for the specified                                
  								entityname. This is suitable for the
                                'mount -o secret=..' argument
  -C, --create-keyring          will create a new keyring, overwriting any
                                existing keyringfile
  -g, --gen-key                 will generate a new secret key for the
                                specified entityname
  --gen-print-key               will generate a new secret key without set it
                                to the keyringfile, prints the secret to stdout
  --import-keyring FILE         will import the content of a given keyring
                                into the keyringfile
  -n NAME, --name NAME          specify entityname to operate on
  -a BASE64, --add-key BASE64   will add an encoded key to the keyring
  --cap SUBSYSTEM CAPABILITY    will set the capability for given subsystem
  --caps CAPSFILE               will set all of capabilities associated with a
                                given key, for all subsystems
  --mode MODE                   will set the desired file mode to the keyring
                                e.g: '0644', defaults to '0600'

5.7.2.2 创建key文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool --create-keyring wgs.key
creating wgs.key

5.7.2.3 验证文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -l wgs.key
-rw-rw-r-- 1 ceph ceph 0 Sep 19 15:42 wgs.key

5.7.3 导出用户认证信息至keyring文件

5.7.3.1 导出用户认证信息

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs -o ceph.client.wgs.keyring
exported keyring for client.wgs

5.7.3.2 验证认证信息

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -l ceph.client.wgs.keyring
[client.wgs]        
	key = AQCzwkZhgvOIEhAAJxUykVvuDsqPBfCWDoBG9w==        
        caps mon = "allow r"
        caps osd = "allow rwx pool=wgspool"

5.7.4 从keyring文件恢复用户认证信息

  • 可以使用ceph auth import -i指定keyring文件并导入到ceph,其实就是起到用户备份和恢复的目的。

5.7.4.1 验证用户认证文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -l ceph.client.wgs.keyring
[client.wgs]
        key = AQCzwkZhgvOIEhAAJxUykVvuDsqPBfCWDoBG9w==
        caps mon = "allow r"
        caps osd = "allow rwx pool=wgspool"

5.7.4.2 删除用户

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth del client.wgs
updated

5.7.4.3 验证删除用户

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs
Error ENOENT: failed to find client.wgs in keyring

5.7.4.4 导入用户

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth import -i ceph.client.wgs.keyring
imported keyring

5.7.4.5 验证用户

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth get client.wgs
[client.wgs]
        key = AQCzwkZhgvOIEhAAJxUykVvuDsqPBfCWDoBG9w==
        caps mon = "allow r"
        caps osd = "allow rwx pool=wgspool"
exported keyring for client.wgs

5.7.5 密钥环文件包含多用户

5.7.5.1 创建keyring文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool --create-keyring ceph.client.user.keyring
creating ceph.client.user.keyring

5.7.5.2 验证创建keyring文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -l ceph.client.user.keyring

5.7.5.3 创建测试用户信息

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph auth add client.wgs mon 'allow r' osd 'allow rwx pool=wgspool'
added key for client.wgs
ceph@ceph-deploy:~/ceph-cluster$ ceph auth add client.wgs01 mon 'allow r' osd 'allow rwx pool=wgspool'
added key for client.wgs01
ceph@ceph-deploy:~/ceph-cluster$ ceph auth add client.wgs02 mon 'allow r' osd 'allow rwx pool=wgspool'
added key for client.wgs02

5.7.5.4 导出用户信息

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool ceph.client.user.keyring --import-keyring ceph.client.admin.keyring
importing contents of ceph.client.admin.keyring into ceph.client.user.keyring
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool ceph.client.user.keyring --import-keyring ceph.client.wgs.keyring
importing contents of ceph.client.wgs.keyring into ceph.client.user.keyring

5.7.5.5 再次验证keyring文件

点击查看代码
ceph@ceph-deploy:~/ceph-cluster$ ceph-authtool -l ceph.client.user.keyring
[client.admin]
        key = AQALKythrxA6IhAAVDlgRrH+xWLn2FYbXAFRaw==
        caps mds = "allow *"
        caps mgr = "allow *"
        caps mon = "allow *"
        caps osd = "allow *"
[client.wgs]
        key = AQCzwkZhgvOIEhAAJxUykVvuDsqPBfCWDoBG9w==
        caps mon = "allow r"
        caps osd = "allow rwx pool=wgspool"

标签:Cephx,ceph,key,caps,Ceph,client,allow,osd,分布式
来源: https://www.cnblogs.com/wangguishe/p/15311317.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有