首页 产品特性 解决方案 系统架构 文档 关于
核心引擎

纠删码引擎

基于 Reed-Solomon 纠删码,KDSS 将数据分割为可配置的数据分片和校验分片。提供从 EC 5+2 到 EC 29+3 的 4 种预设配置,空间利用率最高可达 90.6%,同时容忍多块磁盘同时故障——远超三副本 33.3% 的利用率。

  • Reed-Solomon 算法,硬件加速伽罗瓦域运算
  • 4 种预设配置:EC 5+2、9+2、18+3、29+3
  • 空间利用率高达 90.6%,对比三副本仅 33.3%
  • 每条带容忍最多 3 块磁盘同时故障
  • 自动跨节点分片分布,实现故障隔离
master.toml
# Erasure Coding Configuration
[ec]
data_shards   = 5      # Number of data shards / 数据分片数
parity_shards = 2      # Number of parity shards / 校验分片数

# Space Efficiency Comparison:
# EC 5+2   = 71.4%  (tolerates 2 failures)
# EC 9+2   = 81.8%  (tolerates 2 failures)
# EC 18+3  = 85.7%  (tolerates 3 failures)
# EC 29+3  = 90.6%  (tolerates 3 failures)
# 3-replica = 33.3%  (tolerates 2 failures)
存储引擎

裸盘引擎

KDSS 完全绕过文件系统,在裸块设备上执行 Direct I/O。追加写模式最大化顺序吞吐量,双 SuperBlock 设计和五级恢复机制确保即使在意外断电或硬件故障后也能保证数据完整性。

  • Direct I/O 绕过操作系统页缓存,延迟可预测
  • 追加写消除随机 I/O 和碎片化,显著延长 HDD 使用寿命、降低故障率
  • 双 SuperBlock + CRC32 校验保护元数据
  • 五级恢复:干净关闭检测、SuperBlock 校验、索引恢复、分片重建、全条带 EC 重建
  • 压缩回收空间,不中断服务
Disk Layout
+----------------------------------------------+
|  SuperBlock A (primary)  |  SuperBlock B (backup) |
+----------------------------------------------+
|  Data Records (append-only)                   |
|  +--------+--------+--------+--------+-----  |
|  | Record | Record | Record | Record | ...   |
|  | Hdr+D  | Hdr+D  | Hdr+D  | Hdr+D  |      |
|  +--------+--------+--------+--------+-----  |
+----------------------------------------------+

Recovery Levels:
  L1: Clean shutdown detection (skip recovery)
  L2: SuperBlock validation & failover
  L3: Index recovery from data records
  L4: Single-shard EC rebuild
  L5: Full stripe EC reconstruction
访问层

S3 兼容 API

KDSS 提供完全 S3 兼容的 HTTP API,可无缝对接现有工具、SDK 和应用。支持 Bucket 操作、大文件分段上传、预签名 URL 安全临时访问以及流式传输。

  • 完整 Bucket CRUD:CreateBucket、ListBuckets、DeleteBucket、HeadBucket
  • 对象操作:PutObject、GetObject、DeleteObject、HeadObject、CopyObject
  • 分段上传:InitiateMultipartUpload、UploadPart、CompleteMultipartUpload
  • 预签名 URL,限时认证访问
  • 兼容 AWS CLI、boto3、MinIO Client 及标准 S3 SDK
bash
# Upload a file via S3 API
curl -X PUT "http://kdss:9000/my-bucket/photo.jpg" \
  -H "Authorization: AWS4-HMAC-SHA256 ..." \
  -T ./photo.jpg

# Multipart upload (large files)
curl -X POST \
  "http://kdss:9000/my-bucket/bigfile?uploads"

# Generate presigned download URL
kdss-cli presign get \
  --bucket my-bucket \
  --key photo.jpg \
  --expires 3600

# List objects with prefix
curl "http://kdss:9000/my-bucket?prefix=photos/&max-keys=100"
POSIX 接口

FUSE 文件系统挂载

通过 FUSE 将 KDSS 集群挂载为本地目录。应用可使用标准 POSIX 文件操作——read、write、stat、readdir——KDSS 在后台透明处理纠删码编解码、分片分发和故障恢复。可配置读写缓冲优化不同工作负载的吞吐量。

  • 标准 POSIX 接口:open、read、write、stat、readdir、rename
  • 写入时透明 EC 编码,读取时透明解码
  • 可配置 chunk 大小(默认 256 MB),LRU 读缓存和顺序预取
  • 元数据缓存,减少 Master 节点往返
  • 兼容标准 Linux 工具:cp、rsync、tar 等
bash
# Mount KDSS as a local filesystem
ksfs -c /etc/ksfs/mount.toml

# Now use it like any local directory
ls /mnt/kdss/my-bucket/
cp /var/log/app.log /mnt/kdss/my-bucket/logs/
df -h /mnt/kdss

# Unmount when done
umount /mnt/kdss
可靠性

自动修复与恢复

KDSS 通过 S.M.A.R.T. 指标和心跳信号持续监控磁盘健康。检测到故障时——无论是慢盘、读取错误还是磁盘完全失效——系统自动隔离故障磁盘,使用 EC 校验数据重构缺失分片,并重新分布到健康节点,全程无需人工干预。

  • 三层磁盘健康监控:S.M.A.R.T.、dmesg 错误扫描、IO 错误滑动窗口
  • 心跳超时和 I/O 错误追踪自动检测故障
  • 基于 EC 校验的分片重构,无需完整数据拷贝
  • 分布式修复:所有 Master 节点并行执行修复任务
  • 通过 Web 控制台和 Prometheus 指标追踪修复进度
Auto Repair Flow
  Disk Health Monitor
        |
        v
  +------------------+
  | S.M.A.R.T. Check |---> Normal ---> Continue
  | Heartbeat Check  |                 Monitoring
  +------------------+
        |
      Fault Detected
        |
        v
  +------------------+
  | Isolate Disk     |  Mark disk as "offline"
  | Stop I/O         |  Redirect traffic
  +------------------+
        |
        v
  +------------------+
  | Identify Missing |  Scan stripe metadata
  | Shards           |  for affected data
  +------------------+
        |
        v
  +------------------+
  | EC Reconstruct   |  Rebuild from parity
  | Missing Shards   |  shards (k of n)
  +------------------+
        |
        v
  +------------------+
  | Place on Healthy |  Rebalance across
  | Nodes            |  available disks
  +------------------+
        |
        v
  Repair Complete ---> Resume Normal Operation
运维

数据均衡

随着集群扩展和工作负载变化,磁盘利用率可能不均衡。KDSS 内置利用率感知的数据均衡引擎,非中断地将分片从高利用率磁盘迁移到低利用率磁盘,保持集群健康和存储均匀分布,并提供实时进度监控。

  • 利用率感知调度:不均衡超过可配置阈值时触发
  • 非中断迁移:在线数据移动不影响服务
  • 带宽限流,限制对生产负载的影响
  • 通过 CLI 和 Web 控制台仪表盘监控进度
  • 添加新磁盘或节点时自动再均衡
bash
# Check cluster disk utilization
kdss-cli balance status

Disk Utilization:
  node-01/sda   ████████████░░░  82%
  node-01/sdb   █████████░░░░░░  61%
  node-02/sda   ██████████████░  93%
  node-02/sdb   ███████░░░░░░░░  47%
  node-03/sda   ██████████░░░░░  68%

Imbalance: 46%  (threshold: 20%)

# Start balancing
kdss-cli balance start --max-bandwidth 100MB/s

Balancing in progress...
  Migrated: 128 shards (12.4 GB)
  Remaining: 64 shards (~6.2 GB)
  ETA: 3m 22s
管理

Web 管理控制台

功能完备的 Web 管理控制台,让您对 KDSS 集群拥有完整的可视化和控制。一览集群健康状况、管理节点和磁盘、配置 EC 策略、控制用户访问——全部通过基于角色访问控制 (RBAC) 的直观仪表盘实现。

  • 实时仪表盘:集群健康、容量、吞吐量和 IOPS
  • 节点和磁盘管理:添加、移除、退役,引导式工作流
  • Bucket 和对象浏览器,支持搜索、上传和下载
  • 预定义角色的 RBAC:管理员、存储管理员、只读
  • 告警配置和通知历史
Dashboard Overview
+-----------------------------------------------+
|  KDSS Console            [admin] [Logout]      |
+-----------------------------------------------+
|         |                                      |
| Dash    |  Cluster Health: Healthy             |
| Nodes   |                                      |
| Disks   |  Nodes: 5/5 online                   |
| Buckets |  Disks: 20/20 active                 |
| Users   |  Capacity: 42.8 TB / 60 TB (71%)     |
| Alerts  |                                      |
| Config  |  Throughput   IOPS                    |
|         |  ~~~^~~~      ~~^~~~                  |
|         |  348 MB/s     12.4K                   |
|         |                                      |
|         |  Recent Alerts (3)                    |
|         |  ! Disk node-02/sdc S.M.A.R.T. warn  |
|         |  ! Repair job #47 completed           |
|         |  i Balance job started                |
+-----------------------------------------------+
可观测性

监控与告警

KDSS 开箱即用暴露全面的 Prometheus 指标,覆盖集群健康、磁盘 I/O、EC 操作和 API 延迟。配合 32 条内置告警规则、预配置 Grafana 仪表盘和飞书 Webhook 集成,无需从头搭建监控基础设施即可获得完整可观测性。

  • 每个组件 Prometheus 原生 /metrics 端点
  • 32 条内置告警规则,覆盖磁盘、节点、容量和性能
  • 预构建 Grafana 仪表盘,集群、节点和磁盘级视图
  • 飞书 Webhook 实时告警通知
  • 可配置告警阈值和通知路由
prometheus.yml
# Prometheus scrape config for KDSS
scrape_configs:
  - job_name: 'kdss-master'
    static_configs:
      - targets: ['master-01:6701']
    metrics_path: /metrics

  - job_name: 'kdss-storage'
    static_configs:
      - targets:
          - 'storage-01:6801'
          - 'storage-02:6801'
          - 'storage-03:6801'

# Sample alert rules (32 built-in)
# - DiskSpaceCritical (>90%)
# - DiskSmartWarning
# - NodeHeartbeatLost (>30s)
# - ECRepairQueueHigh (>100)
# - APILatencyP99High (>500ms)
# - ReplicationLagHigh
# ...
生命周期

垃圾回收与空间回收

KDSS 实现安全的两阶段删除流程,支持可配置的回收站保留期。后台自动运行垃圾回收,从已删除对象和过期临时数据中回收空间,同时确保在保留窗口到期前不会永久删除数据。

  • 两阶段删除:先软删到回收站,保留期后永久移除
  • 可配置回收站保留期(默认 7 天)
  • 可配置间隔和时间窗口的自动 GC 调度
  • 可配置超时后自动清理过期分段上传
  • GC 进度和已回收空间指标导出到 Prometheus
master.toml
# Garbage Collection Configuration
[gc]
enabled = true
# Run GC every 6 hours / 每 6 小时运行一次 GC
interval = "6h"
# Only run during low-traffic window
# 仅在低峰期运行
time_window = "02:00-06:00"

[gc.recycle_bin]
# Retain deleted objects for 7 days
# 删除对象保留 7 天
retention = "168h"

[gc.multipart]
# Clean up stale multipart uploads after 24h
# 24 小时后清理过期的分片上传
stale_timeout = "24h"

[gc.compaction]
# Trigger compaction when fragmentation > 30%
# 碎片率超过 30% 时触发压缩
fragmentation_threshold = 0.3