Configuring Strong Data Consistency Between ClickHouse Replicas
Scenarios
ClickHouse supports multiple replicas. When data is written to a local table, the data on the current node is updated immediately, but the data between other replicas is asynchronously updated.
Configure ClickHouse to ensure strong data consistency between replicas.
Notes and Constraints
This section applies only to MRS 3.3.0-LTS or later.
Parameters

The priority of configuring strong data consistency between ClickHouse replicas is as follows: single statements > sessions > global defaults.
Strong data consistency between replicas must be used together with atomicity. Otherwise, an exception occurs during data insertion and the rollback fails.
- Log in to FusionInsight Manager.
For details, see Accessing FusionInsight Manager.
- Choose Cluster > Services > ClickHouse. Click Configurations then All Configurations, click Reliability, and search for and modify the following parameters.
Parameter
Description
Example Value
profiles.default.insert_quorum
Specifies the write quorum for INSERT queries. This setting determines the number of replicas that must successfully acknowledge an INSERT operation before the operation is considered successful. This improves data consistency and reliability, especially in environments that demand high availability and fault tolerance. The value range is 0-9, auto, or all.
- The default value is 0, which indicates that strong consistency between replicas is disabled, arbitration is not used, and INSERT operations are written to a single replica only.
- If this parameter is set to a number, the INSERT operation can succeed only when ClickHouse attempts to correctly write data to the insert_quorum of replicas during the insert_quorum_timeout period. For example, if this parameter is set to 3, the INSERT operation can succeed only after three replicas have acknowledged the operation.
- auto indicates that the INSERT operation is successful only when data is correctly written to more than half of the replicas.
- all indicates that the INSERT operation is successful only when data is correctly written to all replicas.
3
profiles.default.insert_quorum_timeout
Controls the timeout interval for INSERT operations when waiting for multiple replicas to acknowledge the operation. If the required quorum level is not reached within the specified time, the INSERT operation terminates and an error is returned, preventing indefinite waiting. The unit is millisecond. The value must be greater than 0.
600000
- After the parameter settings are modified, click Save, perform operations as prompted, and wait until the settings are saved successfully.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot