Deployment overview
A KDSS cluster is deployed in five stages. Finish and verify each stage before moving on to the next.
Prepare the MongoDB replica set
Metadata and Master leader election both rely on the MongoDB replica set, which acknowledges writes by majority. Run the replica-set members on SSD.
Deploy the Masters
A typical deployment runs 5 Masters, which can share hosts with Storage on nodes whose system disk is RAID1. All Masters connect to the same replica set and elect a leader automatically. Default ports: gRPC 6700, metrics 6701.
Format and start Storage
Data disks are handed to KDSS as JBOD pass-through. Formatting writes the primary and backup superblocks and the disk identity (node ID, disk ID, disk UUID) at the start of each disk, so later slot moves or device renames are recognized automatically.
Start the storage service (default ports: gRPC 6800, metrics 6801); the node and its disks then appear in the console.
Initialize the administrator
Open the web console (default port 8081) and create the administrator account. Add storage_admin or readonly users as needed and configure alert channels (Lark or email).
Mount ksfs or configure S3
For file workloads, mount ksfs on the application hosts. For object workloads, create a bucket and access keys in the console and connect through the S3 gateway (default port 9000).
Recommended hardware
The configuration below comes from production. Redundancy is provided across nodes by erasure coding, so data disks do not need RAID.
| Item | Recommendation |
|---|---|
| Data disks | 36 × 16 TB enterprise HDDs per node, JBOD pass-through |
| CPU | 20-core-class Xeon |
| Memory | 64 GB |
| Network | 2 × 10 GbE bonded (20 Gbps) |
| System disk | RAID1 |
| Master | Typically 5, co-located with Storage on nodes with a RAID1 system disk |
| MongoDB | Replica set on SSD |
Minimum cluster size
At least 8 nodes, using EC 5+2. More nodes unlock higher schemes with better storage efficiency; the minimum node count for each scheme is listed in the scheme table below.
Capacity planning
Plan usable capacity with both the erasure-coding overhead and the cluster's usable watermark in mind:
- Efficiency: k is the number of data shards and m the number of parity shards. For 29+3, efficiency is 29 ÷ 32 ≈ 90.6%.
- Usable watermark: at the cluster reject line (99% by default) new writes stop and only repair continues, so plan with 99% as the ceiling.
- Deleted data still in the recycle bin keeps using space until its freeze period and retention window have passed.
Worked examples
| Nodes × disks × size | Scheme | Raw (TB) | Usable (TB) |
|---|---|---|---|
| 8 × 36 × 16 TB | 5+2 | 4,608 | ≈ 3,259 |
| 12 × 36 × 16 TB | 9+2 | 6,912 | ≈ 5,599 |
| 22 × 36 × 16 TB | 18+3 | 12,672 | ≈ 10,753 |
| 33 × 36 × 16 TB | 29+3 | 19,008 | ≈ 17,054 |
Last row: 19,008 TB × 29/32 × 99% ≈ 17,054 TB.
df usually report binary units (TiB), which read about 9% lower. The console's "max writable now / conservative writable" figures combine the reject line, per-node headroom and placement constraints into a live writable estimate.Erasure-coding schemes
| Scheme | Mode | Min. nodes | Efficiency | Tolerates |
|---|---|---|---|---|
| 5+2 | Auto | 8 | 71.4% | 2 |
| 9+2 | Auto | 12 | 81.8% | 2 |
| 18+3 | Auto | 22 | 85.7% | 3 |
| 29+3 | Auto | 33 | 90.6% | 3 |
| 19+3 | Manual | 23 | 86.4% | 3 |
| 21+3 | Manual | 25 | 87.5% | 3 |
| 22+3 | Manual | 26 | 88.0% | 3 |
| 31+3 | Manual | 35 | 91.2% | 3 |
| 31+2 | Manual | 34 | 93.9% | 2 |
"Tolerates" is the number of shards (disks or nodes) a stripe can lose at the same time. Automatic schemes follow the node count and are conservative defaults. For manual schemes, the minimum node count is the total number of shards plus one.
S3-compatible API
The S3 gateway listens on port 9000 by default and supports the core S3 API. Verified clients: AWS CLI, boto3 and s3cmd (configured as shown in this section). Requests are signed with AWS SigV4; clients use path-style addressing with region us-east-1. Create access keys under "Buckets & access keys" in the web console. Replace <gateway> in the examples with your gateway address.
Supported operations
| Category | Operations |
|---|---|
| Bucket | ListBuckets, CreateBucket, DeleteBucket, HeadBucket, ListObjectsV2 |
| Object | PutObject, GetObject (including Range), HeadObject, DeleteObject, CopyObject |
| Multipart upload | CreateMultipartUpload, UploadPart, CompleteMultipartUpload, AbortMultipartUpload, ListParts, ListMultipartUploads |
- Large objects are streamed: up to 64 MB is buffered whole, anything larger is streamed in segments, so gateway memory use stays bounded.
- If you need S3 features beyond this list, please check with support first.
AWS CLI
# Configure access keys (created in the web console) / 配置访问密钥(在 Web 控制台创建) aws configure set aws_access_key_id <ACCESS_KEY> aws configure set aws_secret_access_key <SECRET_KEY> aws configure set region us-east-1 EP=http://<gateway>:9000 # Create and list buckets / 创建并列出 Bucket aws --endpoint-url $EP s3 mb s3://my-bucket aws --endpoint-url $EP s3 ls # Upload and download; large files use multipart upload automatically # 上传与下载;大文件自动走分段上传 aws --endpoint-url $EP s3 cp ./video.mp4 s3://my-bucket/media/video.mp4 aws --endpoint-url $EP s3 cp s3://my-bucket/media/video.mp4 ./video.mp4 aws --endpoint-url $EP s3 ls s3://my-bucket/media/ # Read the first 1 MiB only (Range) / 只读取前 1 MiB(范围读) aws --endpoint-url $EP s3api get-object --bucket my-bucket \ --key media/video.mp4 --range bytes=0-1048575 head.bin # Delete an object / 删除对象 aws --endpoint-url $EP s3 rm s3://my-bucket/media/video.mp4
Python (boto3)
import boto3
from botocore.config import Config
s3 = boto3.client(
"s3",
endpoint_url="http://<gateway>:9000",
aws_access_key_id="<ACCESS_KEY>",
aws_secret_access_key="<SECRET_KEY>",
region_name="us-east-1",
config=Config(s3={"addressing_style": "path"}),
)
# Create a bucket and upload (multipart for large files) / 创建 Bucket 并上传(大文件自动分段)
s3.create_bucket(Bucket="my-bucket")
s3.upload_file("dataset.tar", "my-bucket", "raw/dataset.tar")
# List objects under a prefix / 按前缀列出对象
for obj in s3.list_objects_v2(Bucket="my-bucket", Prefix="raw/").get("Contents", []):
print(obj["Key"], obj["Size"])
# Range read, server-side copy, delete / 范围读、服务端复制、删除
part = s3.get_object(Bucket="my-bucket", Key="raw/dataset.tar", Range="bytes=0-1023")["Body"].read()
s3.copy_object(Bucket="my-bucket", Key="raw/dataset-copy.tar",
CopySource={"Bucket": "my-bucket", "Key": "raw/dataset.tar"})
s3.delete_object(Bucket="my-bucket", Key="raw/dataset-copy.tar")
s3cmd
~/.s3cfg
[default] access_key = <ACCESS_KEY> secret_key = <SECRET_KEY> host_base = <gateway>:9000 host_bucket = <gateway>:9000 use_https = False signature_v2 = False
# Bucket and object operations / Bucket 与对象操作
s3cmd mb s3://my-bucket
s3cmd put ./backup.tar.gz s3://my-bucket/backup/
s3cmd ls s3://my-bucket/backup/
s3cmd get s3://my-bucket/backup/backup.tar.gz ./
s3cmd del s3://my-bucket/backup/backup.tar.gz
http://<gateway>:9000/<bucket>/<key>) is the simplest way to reach the gateway; the boto3 and s3cmd settings above use it.Mounting ksfs
ksfs is the KDSS FUSE client. It mounts the cluster as a local directory, so applications need no changes. In production, about 99% of reads and writes go through ksfs.
- POSIX semantics: access data through the standard file interface; existing programs and scripts work as they are.
- Real capacity:
df -hreports the cluster's actual capacity, not the local disk. - Durability: data is persisted once the application calls
fsync. Callfsyncafter writing data you need confirmed on disk. - Client-side encoding: writes are buffered into 256 MB blocks on the client, encoded into shards and written out in parallel; EC verification can run in parallel with the write.
# Check cluster capacity from the mount point / 在挂载点查看集群真实容量
df -h /mnt/kdss
Tunable settings
| Setting | Purpose |
|---|---|
| Read/write buffers | How much data the client buffers in memory; write buffering is organized in 256 MB blocks. Reduce it on memory-constrained hosts. |
| Concurrency | How many shard reads and writes run at once. Raise it for more throughput when network and CPU allow. |
| Rate limits | Cap a client's read and write bandwidth so it does not crowd out other traffic on the same network. |
Exact setting names and defaults are documented in the configuration reference that ships with each release.
Day-to-day operations
Most fault handling in KDSS is automatic. Operations come down to three things: reading alerts correctly, replacing disks at a steady pace and following the upgrade procedure.
Rolling upgrades
- Put the node into maintenance mode (cordon) so it stops accepting new writes.
- Wait for in-flight writes to drain.
- Replace the binary, restart and confirm the node is healthy.
- Exit maintenance mode and move on to the next node (one node at a time by default).
Handling failed disks
- Isolate first, then replace: a sliding window of I/O errors isolates a failing disk automatically and takes it out of service; disks with transient faults return on their own.
- Repair runs by itself: missing shards are rebuilt on the storage node, worst-first by number of missing shards.
- Write back in place: after a disk swap, in-place repair writes the data back to the same location on the new disk.
- Limit concurrent failures: keep the number of missing shards in any stripe below the number of parity shards; when several disks need replacing, do it in batches.
Disk health checks
- Periodic SMART collection: watch the trend of reallocated and pending sectors.
- Kernel log scanning: surfaces I/O errors quickly, with debounced confirmation.
- Stall watchdog: a read with no response for 120 s, or a write for 300 s, is treated as stalled.
- Background CRC scrub: rate-limited (20 MB/s per node by default) with an adjustable cycle.
Alert severity
The built-in alerting system uses P0 / P1 / P2 severities with debouncing and reminder intervals, sends notifications to Lark and email, and keeps an alert history. Each release also ships 62 Prometheus alert-rule templates.
| Severity | Suggested response |
|---|---|
| P0 | Act immediately — for example, too few writable nodes or MongoDB unavailable, anything that blocks writes or metadata. |
| P1 | Handle the same day — for example, a failed disk or capacity nearing the reject line. |
| P2 | Track in routine reviews and watch the trend. |
The severity of each rule is set in the console's alert-rule configuration and can be adjusted.
Capacity and data protection
- Plan writes against the console's "max writable now / conservative writable" figures rather than free space alone.
- Accidentally deleted data can be restored from the recycle bin; garbage collection has a configurable retention window.
Support
If you run into problems with deployment, upgrades, expansion or a fault, get in touch.
Please include
- Your KDSS version (CalVer, for example 26.11.2)
- Node count, disks per node and erasure-coding scheme
- What happened and when, with screenshots of related alerts
- Relevant log excerpts from the affected components