Search code examples
apache-zookeeperclickhouseposthog

Clickhouse not working after losing zookeeper cluster, how to force it to generate new metadata


I am setting up Posthog which includes Clickhouse and connects to Zookeeper. It was set up and working, but the Zookeeper cluster was destroyed by accident.

Now a new one is set up, but Clickhouse logs that it has issues with the metadata and can't use the new zookeeper, tables are being put in READ_ONLY mode. Because of this no new PostHog events are being saved.

How can I make Clickhouse generate new metadata on this new Zookeeper cluster?


Solution

  • system restore replica 'your_table';
    

    https://clickhouse.com/docs/en/sql-reference/statements/system/#restore-replica