Longhorn 使用超过 50% 的预留存储 space

Longhorn using more than 50% of storage as reserved space

我是 运行 RKE1 集群上的 Longhorn v1.2.3(由 rancher 提供),这个集群有 5 个节点,在 /var/lib/longhorn 上安装了专用的 20GiB 磁盘,带有 ext4 文件系统和 0% 保留根 user/group.

的块

在仪表板中,我看到以下统计数据:

Type Size
Schedulable 33.5 Gi
Reserved 58.1 Gi
Used 6.18 Gi
Disabled 0 Bi
Total 97.8 Gi

我将设置中的存储最小可用百分比更改为 5(我记得从 25),但这并没有改变任何东西。当我打开“节点”选项卡时,我在“大小”选项卡中看到以下内容:

7.86 Gi
+11.7 Gi Reserved

具体大小因节点而异,但大约为 8Gi。

这些专用磁盘是在集群配置 longhorn 后添加的,系统磁盘大小为 40 GiB,所以这种过度使用的原因可能是因为在 longhorn 与操作系统一起部署时计算了预留大小,当我把这个文件夹挂载到新磁盘时还没有调整。

为什么我有超过一半的 space “保留”?我该怎么做才能从 longhorn 获得更多可用的 space?谢谢!

在深入挖掘并发现有朝一日可以从 UI 调整这些值后(我没能找到),我搜索了 longhorn CRD,并遇到了 nodes.longhorn.io。在定义中我找到了我搜索的内容:

spec:
  allowScheduling: true
  disks:
    default-disk-fd0000000000:
      allowScheduling: true
      evictionRequested: false
      path: /var/lib/longhorn/
      storageReserved: 536870912
      tags: null

为了以防万一,我在所有节点上将 storageReserved 更改为 536870912 (512 MiB),并且 longhorn 立即应用了此更改。这对我来说没问题,因为这些磁盘是专用的,而且,根据 docs

Reserved: The space reserved for other applications and system.

现在我的存储空间回来了,希望对你有帮助