Help Center/ MapReduce Service/ Troubleshooting/ Using ClickHouse/ "Table is in readonly mode" Is Reported When Data Is Imported to ClickHouse
Updated on 2025-08-19 GMT+08:00

"Table is in readonly mode" Is Reported When Data Is Imported to ClickHouse

Symptom

When data is imported from Hive to ClickHouse, error message "Table is in readonly mode(zookeeper path:...)" is displayed, indicating that the data import task fails.

Cause Analysis

  • ZooKeeper is faulty and enters the read-only mode.
  • The SQL statement for setting the table to read-only mode has been executed in the environment.

    ALTER TABLE {table_name} MODIFY SETTING only_allow_select_statement = true

  • Operations such as data migration, one-click balancing, decommissioning, and capacity reduction are being performed on the ClickHouse cluster.

Solution

  1. Run the following command on the faulty node to check whether there is a read-only mode table:
    select database,table from system.replicas where is_readonly;
  2. Check ClickHouse Server logs. If the read-only mode is caused due to failure to merge large volumes of data in a timely manner, the data import task will automatically recover after all data is merged. In this case, you need to optimize data writing.