Windows 上直接使用Ceph以及性能测试!


40ddf3ae5c157f155a74e60e00685d70.gif

新钛云服已为您服务1296

4b9438425713141527c4d8654824763d.gif

在 Windows 上本地使用 Ceph

由于Cloudbase SolutionsSuse 的合作,当前Ceph 16 (Pacific)提供了 Windows 原生支持。

Ceph 可能是最常用的软件定义存储解决方案。根据调查(https://www.openstack.org/analytics),超过 70% 的 OpenStack 部署由 Ceph 提供支持。考虑到它可以在商用硬件上运行,而且能够扩展到数百个存储节点并提供不错的性能,这也就不足为奇了。

在 Windows 上使用 Ceph 一直是一个痛点,以往需要iSCSI网关等代理或使用 Samba重新导出CephFS。这些方法提供了次优的性能并使部署架构过于复杂。现在所有麻烦都没有了,因为RBD和 CephFS 可以原生地在 Windows 上使用。

为获得最佳性能和功能,建议使用Windows Server 2019Windows Server 2016也受支持,但有一些已知限制。较旧的 Windows Server 版本以及客户端版本(如 Windows 10)可能也能正常工作,但目前不受支持。

112ab4ddbd11e32883c969bf4f024cc5.png

安装:

这个 MSI 安装程序(https://cloudbase.it/ceph-for-windows/)是在 Windows 上安装 Ceph 的推荐方式。除了 Ceph 二进制文件,它还捆绑了WNBD驱动程序,用于映射 RBD 镜像。

如果您更喜欢手动构建和安装Ceph(https://github.com/ceph/ceph/blob/master/README.windows.rst)和WNBD(https://github.com/cloudbase/wnbd),请参考这些指南。

配置:

在 Windows 上使用 Ceph 需要最少的配置。默认配置文件位置是`C:\ProgramData\ceph\ceph.conf*。

这是一个配置示例。不要忘记填写正确的 Ceph Monitor 地址并在指定位置提供 Ceph 密钥环文件。目前,必须使用斜杠“/”而不是反斜杠“\”作为路径分隔符。

[global]
    log to stderr = true
    ; Uncomment the following to use Windows Event Log
    ; log to syslog = true

    run dir = C:/ProgramData/ceph/out
    crash dir = C:/ProgramData/ceph/out

    ; Use the following to change the cephfs client log level
    ; debug client = 2
[client]
    keyring = C:/ProgramData/ceph/keyring
    ; log file = C:/ProgramData/ceph/out/$name.$pid.log
    admin socket = C:/ProgramData/ceph/out/$name.$pid.asok

    ; client_permissions = true
    ; client_mount_uid = 1000
    ; client_mount_gid = 1000
[global]
    mon host = <ceph_monitor_addresses>

RBD:

Rados 块设备 (RBD)一直是这项工作的主要重点。您可能已经熟悉的相同 CLI 可用于创建 RBD 映像并将它们附加到主机和Hyper-V虚拟机。

以下 PowerShell 示例创建一个 RBD 映像,将其附加到主机并在顶部添加一个NTFS分区。

rbd create blank_image --size=1G
rbd device map blank_image

$mappingJson = rbd-wnbd show blank_image --format=json
$mappingJson = $mappingJson | ConvertFrom-Json
$diskNumber = $mappingJson.disk_number

# The disk must be online before creating or accessing partitions.
Set-Disk -Number $diskNumber -IsOffline $false

# Initialize the disk, partition it and create a fileystem.
Get-Disk -Number $diskNumber | `
    Initialize-Disk -PassThru | `
    New-Partition -AssignDriveLetter -UseMaximumSize | `
    Format-Volume -Force -Confirm:$false

默认情况下,所有 RBD 映射都是持久的。可以使用上述 MSI 安装程序部署的“ ceph-rbd ”服务负责在主机重新启动后重新附加 RBD 映像。这还允许调整 Windows 服务启动顺序,以便在启动可能依赖它的服务之前映射 RBD 映像。

以下屏幕截图显示了附加到 Hyper-V 虚拟机的 RBD 镜像以及基准测试结果。我们将在以后的文章中深入研究基准测试。

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值