Overview
Cluster Types
KWDB supports the following cluster deployment types:
| Category | Multi-Replica Cluster | Single-Replica Cluster |
|---|---|---|
| Definition | KWDB runs on multiple nodes within the same data center. Each data range has 3 replicas by default, distributed across different nodes. | KWDB runs on multiple nodes within the same data center. Each data range has only one replica; all data storage and update operations are handled by that single replica. |
| Performance | - Writes: Lower than single node and single-replica clusters - Reads: - Simple queries: slightly lower than single node - Complex queries: same as single-replica clusters Tip: You can optimize write performance with the following parameters: - ts.raft_log.sync_period: Extends the disk flush cycle for time-series data raft logs- ts.raftlog_combine_wal.enabled: Enables merging of time-series data raft logs and WALFor more information, see Cluster Parameters. Note: After enabling these optimizations, unflushed data may be lost if a node crashes unexpectedly. | - Writes: Higher than multi-replica clusters but slightly lower than single node - Reads: - Simple queries: slightly lower than single node - Complex queries: same as multi-replica clusters |
| Cluster Scaling | Supports cluster scale-out and scale-in. For more information, see Cluster Scaling. | Supports only cluster scale-out. For more information, see Cluster Scaling. |
| High Availability | Supports high availability with automatic failover and strong data consistency. For more information, see Cluster High Availability. Note: After extending the disk flush cycle for time-series data raft logs, unflushed data may be lost if a node crashes unexpectedly. | - Does not support high availability. - When cluster nodes fail, write operations, queries, and DDL statements may fail. - When the number of failed nodes exceeds half of the total nodes, all operations will be suspended. |
| Data Balancing | Supports automatic data balancing after scaling operations. | Does not support automatic data balancing after scaling out the cluster. |
Single-node deployment differs slightly from cluster deployment. For more information, see Single-node Deployment.
Deployment Process
Preparation
Before deploying a KWDB cluster, follow Preparation to verify that the hardware and software environments on the target nodes meet the requirements.
Cluster Deployment
KWDB provides multiple cluster deployment methods to meet different user needs and scenarios:
| Deployment Method | Characteristics | Target Users/Scenarios | Technical Requirements | Supported Environments |
|---|---|---|---|---|
| Script Deployment (Recommended) | Simplest cluster deployment method with built-in fault detection and node recovery mechanisms | Users who need to quickly set up test or production environments | Basic Linux operation experience | Bare metal, Containerized |
| Docker Run | Containerized technology deployment | Users who prefer containerized technology | Familiar with Docker command-line operations | Containerized |
| kwbase CLI | Supports deep customization of the deployment process | Users with technical background who want deep customization | Familiar with database deployment process and command-line operations | Bare metal |
Cluster Management
- To stop or restart individual nodes in the cluster, see Start and Stop KWDB Service.
- To uninstall the cluster, see Uninstall KWDB.