07-存储服务测试(Ceph Pacific)

1. 块存储服务测试

1.1 查看镜像列表

rbd list

1.2 映射镜像

格式:rbd device map {pool-name}/{image-name} --id {user-name}
示例:rbd device map rbd/myimage --id admin

格式:rbd device map rbd/myimage --id admin --keyring /path/to/keyring
示例:rbd device map rbd/myimage --id admin --keyfile /path/to/file

1.3 查看映射的镜像列表

rbd device list

注:镜像映射为本地磁盘后,可以进行格式化并挂载使用测试。

1.4 取消映射

格式:rbd device unmap /dev/rbd/{poolname}/{imagename}
示例:rbd device unmap /dev/rbd/rbd/foo

2. 文件存储服务测试

2.1 CEPHFS客户端功能

使用 Ceph 身份验证功能将文件系统客户端限制为所需的尽可能低的权限级别。

为了仅授予对指定目录的 rw 访问权限,使用以下语法为客户端创建密钥时提及指定的目录:

ceph fs authorize <fs_name> client.<client_id> <path-in-cephfs> rw

例如,要将客户端 foo 限制为仅在文件系统cephfs_a的 bar 目录中写入数据,请使用以下命令:

ceph fs authorize cephfs_a client.foo / r /bar rw

要将客户端完全限制在 bar 目录,请省略根目录:

ceph fs authorize cephfs_a client.foo /bar rw

请注意,如果客户端的读取访问权限仅限于路径,则只有在 mount 命令中指定可读路径时,它们才能挂载文件系统(见下文)。

2.2 挂载CEPHFS

为了将客户端限制为仅指定的子目录,我们在挂载时使用以下语法提及指定的目录:

ceph-fuse -n client.<client_id> <mount-path> -r *directory_to_be_mounted*

例如,要将客户端 foo 限制为 /bar 目录,我们将使用:

ceph-fuse -n client.foo /mnt -r /bar

3. 对象存储服务器测试

3.1 创建用户

格式:radosgw-admin user create --uid={username} --display-name="{display-name}" [--email={email}]
示例:radosgw-admin user create --uid=johndoe --display-name="John Doe" --email=john@example.com

3.2 s3cmd配置示例

[default]
access_key = 
secret_key = 
host_base = osstest.test.com
host_bucket = osstest.test.com/%(bucket)
cloudfront_host = osstest.test.com
use_https = True
signature_v2 = True
human_readable_sizes = True

 

posted @ 2023-02-21 08:57  Varden  阅读(117)  评论(0编辑  收藏  举报