У нас вы можете посмотреть бесплатно How to Set a ClickHouse Replica to read-only Mode for a Table или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Learn how to simulate read-only replicas in ClickHouse by making specific table replicas readonly. Step-by-step guide to manage replicas for recovery scenarios. --- This video is based on the question https://stackoverflow.com/q/79436391/ asked by the user 'Pierre Louis' ( https://stackoverflow.com/u/12497744/ ) and on the answer https://stackoverflow.com/a/79439324/ provided by the user 'Slach' ( https://stackoverflow.com/u/1204665/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: How to set clickhouse replica to readonly mode for a given table Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l... The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license. If anything seems off to you, please feel free to drop me a comment under this video. --- Introduction In ClickHouse, each table replica can operate normally or in a read-only mode, which is useful during cluster recovery or maintenance scenarios. This post explains how to set a replica of a specific table to read-only, so that queries like the following return results: [[See Video to Reveal this Text or Code Snippet]] Why Set a Replica to Read-Only? To simulate failure or recovery scenarios. To prevent writes from a replica during maintenance. To control cluster state for troubleshooting. How ClickHouse Handles Replica Read-Only State ClickHouse marks replicas as read-only internally, typically by removing the replica's ownership on ZooKeeper, preventing it from coordinating writes. Step-by-Step: Make a Table Replica Read-Only Find the ZooKeeper path and replica name for your table's replicas. [[See Video to Reveal this Text or Code Snippet]] Detach the table on the replica that you want to set to read-only. [[See Video to Reveal this Text or Code Snippet]] Drop the replica node from ZooKeeper using the DROP REPLICA command. [[See Video to Reveal this Text or Code Snippet]] Make sure to replace 'replica_name' and the ZooKeeper path with the exact values from step 1. Attach the table back so it recognizes the loss of the replica in ZooKeeper. [[See Video to Reveal this Text or Code Snippet]] Verify the replica is read-only. [[See Video to Reveal this Text or Code Snippet]] The affected replica should now show as read-only, preventing it from accepting writes. Important Notes Manipulating ZooKeeper nodes directly affects cluster consistency — proceed carefully. Removing a replica from ZooKeeper signals ClickHouse that this replica is not active for writes. This method specifically targets single table replicas. Conclusion Setting a ClickHouse table replica to read-only mode involves detaching the table, dropping the replica from ZooKeeper, and re-attaching the table. This process is useful for testing recovery scenarios or controlling write permissions at the replica level. Always backup your ZooKeeper data and test on a non-production environment first!