Stuck at waiting for leader to bootstrap
See original GitHub issueThis is the image I am using:
repository: registry.opensource.zalan.do/acid/spilo-14
tag: 2.1-p3
and the helm chart is https://github.com/helm/charts/tree/master/incubator/patroni
when I am installing it using helm install patroni-postgres .
, the cluster is stuck in the leader election:
🐢 5947 ~> k logs -f patroni-postgres-0
2022-01-20 04:59:09,905 - bootstrapping - INFO - Figuring out my environment (Google? AWS? Openstack? Local?)
2022-01-20 04:59:11,913 - bootstrapping - INFO - Could not connect to 169.254.169.254, assuming local Docker setup
2022-01-20 04:59:11,915 - bootstrapping - INFO - No meta-data available for this provider
2022-01-20 04:59:11,916 - bootstrapping - INFO - Looks like your running local
2022-01-20 04:59:11,959 - bootstrapping - INFO - Configuring crontab
2022-01-20 04:59:11,960 - bootstrapping - INFO - Skipping creation of renice cron job due to lack of SYS_NICE capability
2022-01-20 04:59:11,960 - bootstrapping - INFO - Configuring pgqd
2022-01-20 04:59:11,960 - bootstrapping - INFO - Configuring patroni
2022-01-20 04:59:11,968 - bootstrapping - INFO - Writing to file /run/postgres.yml
2022-01-20 04:59:11,969 - bootstrapping - INFO - Configuring wal-e
2022-01-20 04:59:11,969 - bootstrapping - INFO - Configuring pam-oauth2
2022-01-20 04:59:11,969 - bootstrapping - INFO - No PAM_OAUTH2 configuration was specified, skipping
2022-01-20 04:59:11,969 - bootstrapping - INFO - Configuring certificate
2022-01-20 04:59:11,969 - bootstrapping - INFO - Generating ssl self-signed certificate
2022-01-20 04:59:12,033 - bootstrapping - INFO - Configuring standby-cluster
2022-01-20 04:59:12,033 - bootstrapping - INFO - Configuring log
2022-01-20 04:59:12,033 - bootstrapping - INFO - Configuring bootstrap
2022-01-20 04:59:12,033 - bootstrapping - INFO - Configuring pgbouncer
2022-01-20 04:59:12,033 - bootstrapping - INFO - No PGBOUNCER_CONFIGURATION was specified, skipping
2022-01-20 04:59:12,275 INFO: Selected new K8s API server endpoint https://10.180.13.96:6443
2022-01-20 04:59:12,297 INFO: No PostgreSQL configuration items changed, nothing to reload.
2022-01-20 04:59:12,299 INFO: Lock owner: None; I am patroni-postgres-0
2022-01-20 04:59:12,401 INFO: waiting for leader to bootstrap
2022-01-20 04:59:22,803 INFO: Lock owner: None; I am patroni-postgres-0
2022-01-20 04:59:22,804 INFO: waiting for leader to bootstrap
2022-01-20 04:59:32,804 INFO: Lock owner: None; I am patroni-postgres-0
2022-01-20 04:59:32,804 INFO: waiting for leader to bootstrap
2022-01-20 04:59:42,803 INFO: Lock owner: None; I am patroni-postgres-0
2022-01-20 04:59:42,803 INFO: waiting for leader to bootstrap
2022-01-20 04:59:52,802 INFO: Lock owner: None; I am patroni-postgres-0
/home/postgres/pgdata/pgroot/data
directory is empty.
These are the running processes:
root@patroni-postgres-0:/home/postgres/pgdata/pgroot/data# ps -ef
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 04:59 ? 00:00:00 /usr/bin/dumb-init -c --rewrite 1:0 -- /bin/sh /launch.sh
root 7 1 0 04:59 ? 00:00:00 /bin/sh /launch.sh
root 32 7 0 04:59 ? 00:00:00 /usr/bin/runsvdir -P /etc/service
root 33 32 0 04:59 ? 00:00:00 runsv pgqd
root 34 32 0 04:59 ? 00:00:00 runsv patroni
postgres 35 33 0 04:59 ? 00:00:00 /bin/bash /scripts/patroni_wait.sh --role master -- /usr/bin/pgqd /home/postgres/pgq_ticker.ini
postgres 36 34 0 04:59 ? 00:00:00 /usr/bin/python3 /usr/local/bin/patroni /home/postgres/postgres.yml
root 65 0 0 05:01 pts/0 00:00:00 bash
postgres 97 35 0 05:05 ? 00:00:00 sleep 60
root 98 65 0 05:05 pts/0 00:00:00 ps -ef
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Yet another 'waiting for leader to bootstrap' · Issue #937 - GitHub
Etcd keeps information that cluster was already initialized ( /service/pg-cluster/initialize key). Patroni wont run initdb second time if such ...
Read more >Thread: Patroni configuration issue - Postgres Professional
Hi, After installation and configuration patroni, we are getting below message while checking the patroni status: Waiting for leader to ...
Read more >How to recover a Patroni PostgreSQL instance when it is fails ...
Let's assume this scenario - the member [postgresql2] failed to start and pg_ctl start does not work either:
Read more >Re: Patroni configuration issue - PostgreSQL
*Waiting for leader to bootstrap* > [image: image.png] > So can you please help me to fix it? > > although i have...
Read more >Release notes - Patroni - Crunchy Data
Version 1.5.5. This version introduces the possibility of automatic reinit of the former master, improves patronictl list output and fixes a number of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Patroni relies not only on PGDATA, but also keeps externally (K8s Endpoints or ConfigMaps) the cluster state. These objects are not created by helm chart and hence they are not removed either when you delete everything else.
I did create the cluster with the name
patroni-postgres
on Fri Jan 14 17:40:07 2022 but I deleted the helm deployment usinghelm uninstall patroni-postgres
followed by deleting the PVC and PV (LocalVolume), I thought the Postgres has been completely removed but looks like that is not true.Then I was deploying the helm chart with the same name
patroni-postgres
, however deploying the chart with a different name fixes the issue.I also tried
patronictl remove patroni-postgres
but the outcome is same: