This guide moves ClickHouse in Self-Hosted SigNoz on SigNoz Helm Chart 1.0.0 from the bundled ZooKeeper to ClickHouse Keeper. It:
- Converts the ZooKeeper coordination tree into a ClickHouse Keeper snapshot with
clickhouse keeper-converter. - Seeds every ClickHouse Keeper volume with it.
- Repoints ClickHouse by patching its ClickHouseInstallation and restarting its Pods.
- Removes ZooKeeper from the release.
Table data never moves; only the coordination tree does.
Prerequisites
Release:
- The release is already on SigNoz Helm Chart 1.0.0 with
zookeeper.enabled: true, and ClickHouse still runs on ZooKeeper. This guide does not cover a release still on SigNoz Helm Chart 0.151.0: upgrade first, then migrate. See also the ClickHouse Keeper and ZooKeeper notes. keeper.replicaCountis1, the default, until the migration is done. The ClickHouse Operator creates one StatefulSet per ClickHouse Keeper replica, which step 6 and step 8 do not cover. Raise it afterwards withhelm upgrade.zookeeper.dataLogDiris unset, the default, so the ZooKeeper snapshots and transaction logs share one volume.
Tools and access:
kubectl, for scaling, the ClickHouseInstallation patch and the converter Job, andhelm, forhelm upgradein step 2 and step 11.clickhouse-clientis in the ClickHouse server image.- Permission to:
kubectl execinto the release namespace- Create Jobs
- Scale StatefulSets and Deployments
- Patch the ClickHouseInstallation
- Run
helm upgradeon the release - Run ClickHouse DDL and
SYSTEMcommands
Set the variables
Every step uses these variables. Some are set from the output of step 1 and step 2:
export NS="<namespace>"
export RELEASE="<release>"
export ZK_STS="<zookeeper-statefulset>"
export ZK_REPLICAS="<zookeeper-replica-count>"
export ZK_LEADER_PVC="<zookeeper-leader-pvc>"
export CHK_STS="<keeper-statefulset>"
export CHK_REPLICAS="<keeper-replica-count>"
export CHK_PVCS="<keeper-pvc-0>"
export CHI_NAME="<clickhouse-installation>"
export CH_PODS="<clickhouse-pod-0> <clickhouse-pod-1>"
export CH_POD="<clickhouse-pod-0>"
export CH_USER="<clickhouse-user>"
export CH_PASSWORD="$(kubectl -n "$NS" get secret "$CHI_NAME-credentials" -o jsonpath='{.data.password}' | base64 -d)"
export KEEPER_HOST="<keeper-service>"
export COLLECTOR_DEPLOY="<collector-deployment>"
export COLLECTOR_REPLICAS="<collector-replica-count>"
export CONVERTER_IMAGE="<clickhouse-server-image>"Verify these values:
<namespace>: The namespace the release runs in.<release>: Your Helm release name, fromhelm list -n <namespace>.<zookeeper-statefulset>: The ZooKeeper StatefulSet, set from step 1, for example<release>-zookeeper.<zookeeper-replica-count>: Its current replica count, set from step 1. A rollback needs it to scale ZooKeeper back.<zookeeper-leader-pvc>: The PVC of the ZooKeeper leader, set from step 1, for exampledata-<release>-zookeeper-1. The leader holds the most current snapshot and log, and the conversion reads this volume.<keeper-statefulset>: The ClickHouse Keeper StatefulSet, set from step 2, for examplechk-<release>-keeper-cluster-0-0.<keeper-replica-count>: The ClickHouse Keeper replica count,1(see Prerequisites).<keeper-pvc-0>: A space-separated list of every ClickHouse Keeper PVC, set from step 2, for exampledefault-chk-<release>-keeper-cluster-0-0-0.<clickhouse-installation>: The ClickHouseInstallation name, for example<release>-clickhouse.<clickhouse-pod-0> <clickhouse-pod-1>: A space-separated list of every ClickHouse Pod, one per replica of every shard, namedchi-<clickhouse-installation>-<cluster>-<shard>-<replica>-0. Step 9 restarts all of them.<clickhouse-pod-0>inCH_POD: Any one ClickHouse Pod, used for the cluster-wide queries.<clickhouse-user>: The ClickHouse user,clickhouse.userin your values,adminby default.<keeper-service>: The ClickHouse Keeper Service name as the SigNoz Helm Chart renders it, set from step 2, for examplekeeper-<release>-keeper. Use this short name, not the FQDN, so the upgrade in step 11 renders the same host.<collector-deployment>: The SigNoz OTel Collector Deployment, fromkubectl -n <namespace> get deploy | grep otel-collector.<collector-replica-count>: The replica count of the SigNoz OTel Collector Deployment before step 3, needed to scale it back in step 10.<clickhouse-server-image>: Aclickhouse/clickhouse-serverimage matching the cluster's version, for exampleclickhouse/clickhouse-server:25.12.5.44. The slimclickhouse-keeperimage does not carry the converter.
The loops use $(echo $CH_PODS), which splits the list into words in both bash and zsh.
Migrate to ClickHouse Keeper
Step 1: Find the ZooKeeper leader
Confirm that the release runs on ZooKeeper, and find the volumes and the leader node the conversion reads from. The loop asks each ZooKeeper Pod for its mode with the srvr four-letter command:
kubectl get statefulset -n "$NS"
kubectl get pvc -n "$NS"
for i in $(seq 0 $((ZK_REPLICAS - 1))); do
echo -n "$ZK_STS-$i: "
kubectl -n "$NS" exec "$ZK_STS-$i" -- sh -c 'echo srvr | nc 127.0.0.1 2181' | grep Mode
doneNAME READY AGE
chi-signoz-clickhouse-cluster-0-0 1/1 6m50s
chk-signoz-keeper-cluster-0-0 1/1 3m31s
signoz 1/1 19m
signoz-zookeeper 1/1 19m
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
data-signoz-zookeeper-0 Bound pvc-1fc40997-cf3d-4329-8752-88f23c84241d 8Gi RWO standard <unset> 19m
data-volumeclaim-template-chi-signoz-clickhouse-cluster-0-0-0 Bound pvc-773ce07a-b66b-4fb3-b95a-6d998368edc4 20Gi RWO standard <unset> 17m
default-chk-signoz-keeper-cluster-0-0-0 Bound pvc-e784fd28-2a2e-418e-a1ba-679055aa9667 10Gi RWO standard <unset> 3m31s
signoz-db-signoz-0 Bound pvc-e9aad854-14b8-43ae-bcbf-97cde69b7ff8 1Gi RWO standard <unset> 19m
signoz-zookeeper-0: Mode: standaloneFrom this output:
- Convert from the Pod that reports
Mode: leader, orMode: standaloneon a single node; the others reportMode: follower. - Set
ZK_STSandZK_REPLICASfrom the StatefulSet listing. - Set
ZK_LEADER_PVCto the leader Pod'sdata-prefixed PVC (Bitnami-compatible layout).
Then check the PVC and the current coordination connection in system.zookeeper_connection:
kubectl -n "$NS" get pvc "$ZK_LEADER_PVC"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT host, port, is_expired FROM system.zookeeper_connection"hostis a ZooKeeper Pod's headless name, such as<release>-zookeeper-0.<release>-zookeeper-headless, andis_expiredis0.- With several ZooKeeper Pods,
hostcan differ between ClickHouse Pods: each reports the one it is connected to.
If no ZooKeeper StatefulSet exists, or system.zookeeper_connection already points at ClickHouse Keeper, this guide does not apply. See Getting help.
Step 2: Turn on ClickHouse Keeper
Create the ClickHouse Keeper StatefulSet, Services and volumes now, so the target volumes exist before the outage window opens.
Set this in your values file. If ClickHouse Keeper is already on, skip the upgrade:
keeper:
enabled: truehelm upgrade "$RELEASE" signoz/signoz --version 1.0.0 -n "$NS" -f values.yaml
kubectl -n "$NS" get chk
kubectl -n "$NS" get pvc | grep keeper
kubectl -n "$NS" get svc | grep keeperNAME STATUS CLUSTERS HOSTS HOSTS-COMPLETED AGE SUSPEND
signoz-keeper Completed 1 1 4m8s
data-signoz-zookeeper-0 Bound pvc-1fc40997-cf3d-4329-8752-88f23c84241d 8Gi RWO standard <unset> 19m
default-chk-signoz-keeper-cluster-0-0-0 Bound pvc-e784fd28-2a2e-418e-a1ba-679055aa9667 10Gi RWO standard <unset> 3m37s
chk-signoz-keeper-cluster-0-0 ClusterIP None <none> 2181/TCP,9444/TCP 3m37s
chk-signoz-keeper-cluster-0-0-client ClusterIP None <none> 2181/TCP 3m37s
keeper-signoz-keeper ClusterIP None <none> 2181/TCP,9444/TCP 2m22s
signoz-zookeeper ClusterIP 10.96.180.26 <none> 2181/TCP,2888/TCP,3888/TCP 19m
signoz-zookeeper-headless ClusterIP None <none> 2181/TCP,2888/TCP,3888/TCP 19m
signoz-zookeeper-metrics ClusterIP 10.96.254.85 <none> 9141/TCP 19mFrom this output:
- The ClickHouseKeeperInstallation reports
Completed(Altinity examples). - The listings show the volumes and Services of both stores.
- Set
CHK_STS,CHK_REPLICAS,CHK_PVCS(every ClickHouse Keeper PVC listed) andKEEPER_HOST.
Then check that ClickHouse Keeper answers ruok:
kubectl -n "$NS" exec "$CHK_STS-0" -- sh -c 'echo ruok | nc 127.0.0.1 2181'imokIf the ClickHouse Keeper Pods are not running, see The ClickHouse Keeper Pod is not running in step 2.
Step 3: Stop data ingestion and background tasks
Stop data ingestion and the ClickHouse background tasks that modify coordination metadata (pre-migration preparation), so nothing is written to ZooKeeper between the conversion and the swap:
kubectl -n "$NS" scale deployment "$COLLECTOR_DEPLOY" --replicas=0
kubectl -n "$NS" get pods | grep -E 'otel-collector'
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "SYSTEM STOP MERGES"No SigNoz OTel Collector Pods remain. The first listing can still show the SigNoz OTel Collector Pod; repeat it until it prints nothing.
Then check that system.replication_queue and the unfinished system.mutations have drained:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "SELECT count() FROM system.replication_queue"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "SELECT count() FROM system.mutations WHERE NOT is_done"0
0Run both on every Pod in $CH_PODS; each query reports only the Pod it runs on.
If the mutations count will not drain to 0, or an entry is still running, do not proceed, because an in-flight mutation converted mid-flight comes back inconsistent. See Getting help.
Step 4: Record the pre-migration baseline
Record the baseline the migration is verified against: the shape of the tree from system.zookeeper, and how many replicated tables must come back, from system.replicas:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "
SELECT
path,
name,
numChildren
FROM system.zookeeper
WHERE path IN ('/', '/clickhouse', '/clickhouse/$CHI_NAME', '/clickhouse/$CHI_NAME/task_queue')
ORDER BY
path ASC,
name ASC
FORMAT PrettyCompact"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replicas" ┌─path─────────────────────────────────────┬─name──────────────┬─numChildren─┐
1. │ / │ clickhouse │ 4 │
2. │ / │ zookeeper │ 2 │
3. │ /clickhouse │ sessions │ 1 │
4. │ /clickhouse │ signoz-clickhouse │ 1 │
5. │ /clickhouse │ tables │ 56 │
6. │ /clickhouse │ task_queue │ 1 │
7. │ /clickhouse/signoz-clickhouse │ task_queue │ 2 │
8. │ /clickhouse/signoz-clickhouse/task_queue │ ddl │ 354 │
9. │ /clickhouse/signoz-clickhouse/task_queue │ replicas │ 3 │
└──────────────────────────────────────────┴───────────────────┴─────────────┘
56- Write down
numChildrenfortablesunder/clickhouseand thesystem.replicascount. Both must match after the swap, and step 12 compares against them. - The tree is the same from any Pod, but
system.replicasreports only the Pod it runs on, so record its count for every Pod in$CH_PODS.
Then check that no replica is read-only:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replicas WHERE is_readonly"0- Run this on every Pod in
$CH_PODS. - If any replica is already read-only before the migration starts, fix that first. See Getting help.
Step 5: Check the ClickHouse Keeper storage paths
Find where in the ClickHouse Keeper volume the snapshot must land, so the converter writes where ClickHouse Keeper reads at startup:
kubectl -n "$NS" exec "$CHK_STS-0" -- id
kubectl -n "$NS" exec "$CHK_STS-0" -- ls -la /var/lib/clickhouse-keeper/coordination/
kubectl -n "$NS" exec "$CHK_STS-0" -- \
grep -E 'snapshot_storage_path|log_storage_path|server_id' /etc/clickhouse-keeper/keeper_config.xmluid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel),11(floppy),20(dialout),26(tape),27(video),101(clickhouse)
total 0
drwxr-xr-x 1 clickhouse clickhouse 32 Nov 17 08:38 .
drwxrwxrwx 1 clickhouse clickhouse 82 Nov 17 08:38 ..
drwxr-xr-x 1 clickhouse clickhouse 0 Nov 17 08:38 log
drwxr-x--- 1 clickhouse clickhouse 44 Nov 17 08:38 logs
drwxr-xr-x 1 clickhouse clickhouse 0 Nov 17 08:38 snapshots
<server_id>1</server_id>
<log_storage_path>/var/lib/clickhouse/coordination/logs</log_storage_path>
<snapshot_storage_path>/var/lib/clickhouse/coordination/snapshots</snapshot_storage_path>- The prefix in
keeper_config.xmland the mount point can differ, but relative to the volume root the path iscoordination/snapshotseither way, which is where step 7 writes. - Files must end up owned by UID and GID
101(clickhouse).
Check the state of ClickHouse Keeper with mntr:
kubectl -n "$NS" exec "$CHK_STS-0" -- sh -c 'echo mntr | nc 127.0.0.1 2181' | grep -E 'zk_server_state|zk_znode_count'zk_server_state standalone
zk_znode_count 4- A near-empty znode count is expected: this ClickHouse Keeper has never held the real tree.
- One replica reports
standalone; with several, one reportsleaderand the restfollower. - If
mntris refused, seemntris refused in step 5.
Step 6: Scale ZooKeeper and ClickHouse Keeper down
Stop all ZooKeeper and ClickHouse Keeper nodes by scaling their StatefulSets to 0:
- The conversion is offline and file-level, so both must be stopped to leave the files consistent and unclaimed.
- Scale every node down, or another one may be promoted to leader.
kubectl -n "$NS" scale statefulset "$CHK_STS" --replicas=0
kubectl -n "$NS" scale statefulset "$ZK_STS" --replicas=0statefulset.apps/chk-signoz-keeper-cluster-0-0 scaled
statefulset.apps/signoz-zookeeper scaledCheck that the Pods are gone. The first listing can still show them terminating; repeat it until it prints nothing:
kubectl -n "$NS" get pods | grep -E 'keeper|zookeeper'Step 7: Convert the ZooKeeper data
Convert the ZooKeeper snapshot, plus the transaction logs written after it, into one ClickHouse Keeper snapshot (Migration from ZooKeeper), and copy it to all ClickHouse Keeper nodes. One Job mounts the ZooKeeper leader volume and every ClickHouse Keeper volume, converts into the first, and copies to the rest:
CHK_MOUNTS=""; CHK_VOLUMES=""; SEED_CMDS=""; i=0
for PVC in $(echo $CHK_PVCS); do
CHK_MOUNTS="$CHK_MOUNTS
- name: chk$i
mountPath: /chk$i"
CHK_VOLUMES="$CHK_VOLUMES
- name: chk$i
persistentVolumeClaim:
claimName: $PVC"
[ "$i" -gt 0 ] && SEED_CMDS="$SEED_CMDS
cp /chk0/coordination/snapshots/snapshot_*.bin.zstd /chk$i/coordination/snapshots/"
i=$((i + 1))
done
kubectl -n "$NS" delete job keeper-converter --ignore-not-found
cat <<EOF | kubectl apply -f -
apiVersion: batch/v1
kind: Job
metadata:
name: keeper-converter
namespace: $NS
spec:
backoffLimit: 0
template:
spec:
restartPolicy: Never
securityContext:
fsGroup: 101
containers:
- name: converter
image: $CONVERTER_IMAGE
command: ["/bin/bash", "-c"]
args:
- |
set -euo pipefail
rm -rf /chk*/coordination/log/* /chk*/coordination/logs/* /chk*/coordination/snapshots/*
mkdir -p /chk*/coordination/snapshots
clickhouse keeper-converter --zookeeper-logs-dir /zk/data/version-2 --zookeeper-snapshots-dir /zk/data/version-2 --output-dir /chk0/coordination/snapshots$SEED_CMDS
chown -R 101:101 /chk*/coordination
md5sum /chk*/coordination/snapshots/snapshot_*.bin.zstd
volumeMounts:
- name: zk
mountPath: /zk$CHK_MOUNTS
volumes:
- name: zk
persistentVolumeClaim:
claimName: $ZK_LEADER_PVC$CHK_VOLUMES
EOF
kubectl -n "$NS" wait --for=condition=complete job/keeper-converter --timeout=600s
kubectl -n "$NS" logs job/keeper-converter | tail -n 5job.batch/keeper-converter created
job.batch/keeper-converter condition met
Deserialized txns log: 53000
Deserialized txns log: 54000
Finished /zk/data/version-2/log.400000001 deserialization, totally read 54887 records
Snapshot serialized to path:"/chk0/coordination/snapshots/snapshot_17179924071.bin.zstd"
f9fb8e866b35b0aa907fea7bbeb62ab6 /chk0/coordination/snapshots/snapshot_17179924071.bin.zstd- Expect one
md5sumline per ClickHouse Keeper PVC, with the same hash andsnapshot_<zxid>name on each. - A stale ZooKeeper snapshot is fine: the converter replays the logs written after it, which is where the ZXID in the output name comes from.
- A
Totally have 0 snapshotsline is a failure: the converter found nothing to read.
The Totally line sits above the last five lines. To see it, run:
kubectl -n "$NS" logs job/keeper-converter | grep -E 'Totally|Finished'Check the output, then delete the Job:
kubectl -n "$NS" logs job/keeper-converter | grep -c 'coordination/snapshots/snapshot_'
kubectl -n "$NS" delete job keeper-converterThe count is the number of PVCs in $CHK_PVCS, plus one for the converter's own Snapshot serialized line.
Step 8: Start ClickHouse Keeper on the converted tree
Confirm that quorum forms and that ClickHouse Keeper serves the real ClickHouse tree, not an empty one, before any client points at it:
kubectl -n "$NS" scale statefulset "$CHK_STS" --replicas="$CHK_REPLICAS"
kubectl -n "$NS" rollout status statefulset "$CHK_STS" --timeout=300s
for i in $(seq 0 $((CHK_REPLICAS - 1))); do
echo -n "$CHK_STS-$i: "
kubectl -n "$NS" exec "$CHK_STS-$i" -- sh -c 'echo mntr | nc 127.0.0.1 2181' \
| grep -E 'zk_server_state|zk_znode_count' | tr '\n' ' '
echo
donestatefulset.apps/chk-signoz-keeper-cluster-0-0 scaled
Waiting for 1 pods to be ready...
statefulset rolling update complete 1 pods at revision chk-signoz-keeper-cluster-0-0-555bfc9db4...
chk-signoz-keeper-cluster-0-0-0: zk_server_state standalone zk_znode_count 25306- The state reads as in step 5.
zk_znode_countis now in the same order of magnitude as the ZooKeeper tree from step 4, not a handful of nodes.
Check that ClickHouse Keeper started from the converted snapshot:
kubectl -n "$NS" exec "$CHK_STS-0" -- ls /var/lib/clickhouse-keeper/coordination/snapshots /var/lib/clickhouse-keeper/coordination/logs/var/lib/clickhouse-keeper/coordination/logs:
changelog_17179924072_17180024071.bin
/var/lib/clickhouse-keeper/coordination/snapshots:
snapshot_17179924071.bin.zstdsnapshotsholds the convertedsnapshot_<zxid>.bin.zstdfrom step 7.logsholds achangelog_<zxid+1>_...binthat starts right after it.
Step 9: Point ClickHouse at ClickHouse Keeper
Point ClickHouse at the new ClickHouse Keeper cluster, and force a new session against the converted tree. Patch the live ClickHouseInstallation's coordination nodes (spec.configuration.zookeeper) to the ClickHouse Keeper Service:
- A Helm install has no ClickHouseInstallation manifest to edit, and
helm upgradecannot run inside the window. Step 11 brings the release in line afterwards. - The section keeps the name
zookeeper; only the hosts change:
spec:
configuration:
zookeeper:
nodes:
- host: keeper-<release>-keeper
port: 2181Patch it:
kubectl -n "$NS" patch chi "$CHI_NAME" --type merge -p '{"spec":{"configuration":{"zookeeper":{"nodes":[{"host":"'"$KEEPER_HOST"'","port":2181}]}}}}'clickhouseinstallation.clickhouse.altinity.com/signoz-clickhouse patchedThen delete the Pods and wait for them:
for P in $(echo $CH_PODS); do
kubectl -n "$NS" delete pod "$P"
done
kubectl -n "$NS" wait --for=condition=Ready pod -l clickhouse.altinity.com/chi="$CHI_NAME" --timeout=300spod "chi-signoz-clickhouse-cluster-0-0-0" deleted
pod "chi-signoz-clickhouse-cluster-0-1-0" deleted
pod "chi-signoz-clickhouse-cluster-1-0-0" deleted
pod "chi-signoz-clickhouse-cluster-1-1-0" deleted
pod/chi-signoz-clickhouse-cluster-0-0-0 condition met
pod/chi-signoz-clickhouse-cluster-0-1-0 condition met
pod/chi-signoz-clickhouse-cluster-1-0-0 condition met
pod/chi-signoz-clickhouse-cluster-1-1-0 condition metOne deleted line and one condition met line print per ClickHouse Pod.
Check the new session in system.zookeeper_connection and the read-only replicas in system.replicas:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT host, port, is_expired, connected_time FROM system.zookeeper_connection"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replicas WHERE is_readonly"hostis$KEEPER_HOSTandis_expiredis0.connected_timeis after the restart.- The read-only count is
0.
Step 10: Resume background tasks and data ingestion
Resume background tasks and restart data ingestion, and let the SigNoz OTel Collector drain the lag built up during the window:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "SYSTEM START MERGES"
kubectl -n "$NS" scale deployment "$COLLECTOR_DEPLOY" --replicas="$COLLECTOR_REPLICAS"deployment.apps/signoz-otel-collector scaledCheck that the SigNoz OTel Collector is back and data arrives:
kubectl -n "$NS" get pods | grep -E 'otel-collector'
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM signoz_traces.signoz_index_v3 WHERE timestamp > now() - INTERVAL 5 MINUTE"- The SigNoz OTel Collector Pods are
Running. - The row count climbs between two runs while agents are sending. With nothing sending, the five-minute window makes it fall, which is not a failure. Agents can take a while to reconnect after the SigNoz OTel Collector comes back, so give them time before you treat a flat count as a failure.
- If it stays flat, see The row count stays flat after step 10.
Step 11: Remove ZooKeeper from the release
Bring the release's values in line with the live ClickHouseInstallation. Until this runs, any helm upgrade with zookeeper.enabled: true renders ZooKeeper's hosts back into it. Set this in your values file:
zookeeper:
enabled: falsehelm upgrade "$RELEASE" signoz/signoz --version 1.0.0 -n "$NS" -f values.yamlRelease "signoz" has been upgraded. Happy Helming!
NAME: signoz
LAST DEPLOYED: Tue Nov 17 14:15:12 2026
NAMESPACE: signoz
STATUS: deployed
REVISION: 4- The SigNoz Helm Chart renders the same ClickHouse Keeper host that step 9 patched in, so the ClickHouseInstallation does not change and no ClickHouse Pod restarts.
- Helm removes the ZooKeeper StatefulSet and its Services, and the PVCs are retained.
Check the result:
kubectl -n "$NS" get statefulset "$ZK_STS"
kubectl -n "$NS" get pvc "$ZK_LEADER_PVC"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT host FROM system.zookeeper_connection"- The StatefulSet lookup returns
NotFound. - The PVC is still
Bound. hostis still$KEEPER_HOST.- If the ZooKeeper StatefulSet is still there, see The ZooKeeper StatefulSet is still there after step 11.
Step 12: Verify the migration
Compare against the step 4 baseline (Verifying the migration). The migration is complete when all of the following hold.
Every replica is writable and no session is expired:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "
SELECT
count(),
countIf(is_readonly),
countIf(is_session_expired)
FROM system.replicas"56 0 0The first number matches the system.replicas count recorded in step 4. Run this on every Pod in $CH_PODS.
The coordination tree carried over intact:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "
SELECT
name,
numChildren
FROM system.zookeeper
WHERE path = '/clickhouse'
FORMAT PrettyCompact"tables has the same numChildren as in step 4.
ClickHouse is talking to ClickHouse Keeper, not ZooKeeper:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT host, is_expired FROM system.zookeeper_connection"host is $KEEPER_HOST on every ClickHouse Pod.
Queues are moving and nothing is stuck:
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replication_queue WHERE num_tries > 10"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT name, value FROM system.errors WHERE name IN ('TABLE_IS_READ_ONLY','KEEPER_EXCEPTION') AND value > 0"The first prints 0 and the second prints no rows, on every Pod in $CH_PODS. Error counters in system.errors are cumulative since start, so check that they stop climbing rather than that they read zero.
After the migration
- Step 11 removed the ZooKeeper StatefulSet, and its PVCs are retained. Keep them until the installation has run a full retention cycle on ClickHouse Keeper, then delete them separately.
- To run more ClickHouse Keeper replicas, raise
keeper.replicaCountwithhelm upgrade.
Roll back
Before step 9
Nothing has been repointed before step 9. Scale ClickHouse Keeper back to 0 and ZooKeeper back to $ZK_REPLICAS (Scale a StatefulSet), and the cluster returns to exactly where step 6 left it:
kubectl -n "$NS" scale statefulset "$CHK_STS" --replicas=0
kubectl -n "$NS" scale statefulset "$ZK_STS" --replicas="$ZK_REPLICAS"After step 9, before ingestion resumes
Rollback is still clean after step 9, until ingestion resumes. The ZooKeeper PVCs were never touched, and its state is still current, because writes were frozen in step 3.
-
Patch the ClickHouseInstallation back to the ZooKeeper hosts that step 1 showed, with
kubectl patch:kubectl -n "$NS" patch chi "$CHI_NAME" --type merge -p '{"spec":{"configuration":{"zookeeper":{"nodes":[{"host":"'"$ZK_STS-0.$ZK_STS-headless"'","port":2181}]}}}}' -
Scale ZooKeeper back up, and wait for it with
kubectl rollout status:kubectl -n "$NS" scale statefulset "$ZK_STS" --replicas="$ZK_REPLICAS" kubectl -n "$NS" rollout status statefulset "$ZK_STS" --timeout=300s -
Restart the ClickHouse Pods, and wait for them:
for P in $(echo $CH_PODS); do kubectl -n "$NS" delete pod "$P" done kubectl -n "$NS" wait --for=condition=Ready pod -l clickhouse.altinity.com/chi="$CHI_NAME" --timeout=300s -
Check every Pod with the check from step 1:
hostis a ZooKeeper Pod andis_expiredis0.
After ingestion resumes
Recover when the tree did not carry over
If tables came up read-only against an empty ClickHouse Keeper, with Table is in readonly mode since table metadata was not found in zookeeper or No node, path /clickhouse/tables/<uuid>/0/log, the coordination metadata can be rebuilt from the parts already on disk, with no re-ingest and no re-replication:
SYSTEM RESTART REPLICASacquires a fresh session and is cluster-wide, run once per server.SYSTEM RESTORE REPLICAis what actually writes/clickhouse/tables/<uuid>/0back and re-enumerates the active parts, so it runs per table.
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "SYSTEM RESTART REPLICAS"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q "
SELECT concat('SYSTEM RESTORE REPLICA ', database, '.', table, ';')
FROM system.replicas
WHERE is_readonly
FORMAT TabSeparatedRaw" \
| kubectl -n "$NS" exec -i "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -n
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replicas WHERE is_readonly"- The last query returns
0. - Run this on every ClickHouse Pod that reports read-only tables.
- For background, see the Altinity Knowledge Base article Recovering from complete metadata loss in ZooKeeper.
Troubleshooting
The ClickHouse Keeper Pod is not running in step 2
Fix: Check the node pool taints, and check that the PVCs land in the same zone as the ZooKeeper volumes. Then run step 2 again.
mntr is refused in step 5
Cause: The SigNoz Helm Chart sets keeper_server/four_letter_word_white_list to * under keeper.settings, so your values override it (Four letter word commands).
Fix: Remove the override, then go back to step 2.
The row count stays flat after step 10
Fix: If the count stays flat while the SigNoz OTel Collector is healthy, go back to step 9 and re-check the coordination connection in system.zookeeper_connection.
The ZooKeeper StatefulSet is still there after step 11
Cause: The values still enable ZooKeeper.
Fix: Go back to step 11, and check the values file you pass to helm upgrade.
Replicated tables are read-only after an upgrade without zookeeper.enabled: true
An installation that already has the ClickHouse Keeper CRD, upgraded with values that drop zookeeper.enabled without migrating, ends up with ClickHouse Keeper starting with an empty tree and ClickHouse left without its coordination store, so every replicated table is read-only. Helm has removed the ZooKeeper StatefulSet and Services, and the ZooKeeper PVCs are retained. No data is lost.
An upgrade to SigNoz Helm Chart 1.0.0 with zookeeper.enabled: true and keeper.enabled: false installs the ClickHouse Keeper CRD through its pre-upgrade hook. So every release already on SigNoz Helm Chart 1.0.0 has the CRD, and a later upgrade that drops zookeeper.enabled reaches this state. Before SigNoz Helm Chart 1.0.0, the missing CRD makes the same mistake fail safely.
Fix: To go back, turn ZooKeeper on again in your values file:
zookeeper:
enabled: trueThe schema migrator cannot run while the tables are read-only, so the upgrade below turns it off for this one revision with telemetryStoreMigrator.enabled=false (schema migrator notes). The next helm upgrade without that --set runs it again:
helm upgrade "$RELEASE" signoz/signoz --version 1.0.0 -n "$NS" -f values.yaml --set telemetryStoreMigrator.enabled=false
kubectl -n "$NS" rollout status statefulset "$ZK_STS" --timeout=300s
for P in $(echo $CH_PODS); do
H="${P%-0}"; CM="chi-$CHI_NAME-deploy-confd-${H#chi-$CHI_NAME-}"
until kubectl -n "$NS" get configmap "$CM" -o jsonpath='{.data.chop-generated-zookeeper\.xml}' | grep -q "<host>$ZK_STS-0.$ZK_STS-headless</host>"; do sleep 2; done
echo "$CM: $ZK_STS-0.$ZK_STS-headless"
done
for P in $(echo $CH_PODS); do
kubectl -n "$NS" delete pod "$P"
done
kubectl -n "$NS" wait --for=condition=Ready pod -l clickhouse.altinity.com/chi="$CHI_NAME" --timeout=300s
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT host, port, is_expired FROM system.zookeeper_connection"
kubectl -n "$NS" exec "$CH_POD" -c clickhouse -- clickhouse-client --user "$CH_USER" --password "$CH_PASSWORD" -q \
"SELECT count() FROM system.replicas WHERE is_readonly"Run both checks on every Pod in $CH_PODS. host is the ZooKeeper host and the read-only count is 0. When you are ready, start this guide from step 1.
Getting help
Open an issue on SigNoz/charts with the outputs of step 4, step 7 and step 8, and the current system.zookeeper_connection. Get help when:
- The converter Job fails to deserialize, or cannot be scheduled against both volumes.
- ClickHouse Keeper comes up without the converted tree twice.
- Replicas stay read-only after
SYSTEM RESTORE REPLICA. - Ingestion does not resume after step 10.
- The outage window exceeds 15 minutes.
You can also reach us through: