Data Fails to Be Imported to ClickHouse and Error "Table is in readonly mode" Is Reported
Symptom
Data fails to be imported from Hive to ClickHouse, and error message "Table is in readonly mode(zookeeper path:...)" is displayed.
Cause Analysis
- ZooKeeper is faulty and becomes read-only.
- 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
- Run the following command on the faulty node to check whether there is a read-only table:
select database,table from system.replicas where is_readonly;
- Check ClickHouse Server logs. If the ClickHouse cluster becomes read only due to the 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.