admin管理员组文章数量:1602084
新钛云服已为您服务1296天
在 Windows 上本地使用 Ceph
由于Cloudbase Solutions和Suse 的合作,当前Ceph 16 (Pacific)提供了 Windows 原生支持。
Ceph 可能是最常用的软件定义存储解决方案。根据调查(https://www.openstack/analytics),超过 70% 的 OpenStack 部署由 Ceph 提供支持。考虑到它可以在商用硬件上运行,而且能够扩展到数百个存储节点并提供不错的性能,这也就不足为奇了。
在 Windows 上使用 Ceph 一直是一个痛点,以往需要iSCSI网关等代理或使用 Samba重新导出CephFS。这些方法提供了次优的性能并使部署架构过于复杂。现在所有麻烦都没有了,因为RBD和 CephFS 可以原生地在 Windows 上使用。
为获得最佳性能和功能,建议使用Windows Server 2019。Windows Server 2016也受支持,但有一些已知限制。较旧的 Windows Server 版本以及客户端版本(如 Windows 10)可能也能正常工作,但目前不受支持。
安装:
这个 MSI 安装程序(https://cloudbase.it/ceph-for-windows/)是在 Windows 上安装 Ceph 的推荐方式。除了 Ceph 二进制文件,它还捆绑了WNBD驱动程序,用于映射 RBD 镜像。
如果您更喜欢手动构建和安装Ceph(https://github/ceph/ceph/blob/master/README.windows.rst)和WNBD(https://github/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 镜像以及基准测试结果。我们将在以后的文章中深入研究基准测试。
版权声明:本文标题:Windows 上直接使用Ceph以及性能测试! 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728380704a1156459.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论