Summary
Keywords
Full Transcript
Build a full Patroni + etcd PostgreSQL HA cluster in Docker with automatic failover, end-to-end. πβοΈπ Weβll do everything on Ubuntu 24.04 LTS (your server, e.g. 192.168.136.128) using Docker + Docker Compose. ## π Optional: Bring Old Node Back as Replica You can wipe node1-data/ and rejoin node1 as a fresh Patroni member (it will clone from current leader automatically), but for this tutorial the key is: * etcd + Patroni coordinate cluster state * One leader, one replica * Leader crash β automatic promotion * Data preserved and new writes possible ## π§Ύ Quick Recap (great for your slide) 1. Build Patroni+Postgres image from postgres:16 2. Run etcd as DCS in Docker 3. Configure two Patroni nodes via YAML (scope, etcd, bootstrap, postgresql) 4. Start cluster with docker compose up -d 5. Test leader/replica with psql and pg_is_in_recovery() 6. Simulate failure by stopping leader container β Patroni promotes replica automatically -------------------------------------------------------------------- ######## β οΈ Disclaimer / ΰ€ ΰ€Έΰ₯ΰ€΅ΰ₯ΰ€ΰ€°ΰ€£ ######## 1οΈβ£ All trademarks, logos, and names belong to their respective owners. 2οΈβ£ This video is made only for educational & informational purposes under Fair Use (Section 107, Copyright Act 1976). 3οΈβ£ No copyright infringement intended. 4οΈβ£ For any copyright concerns, email π© [email protected] β action will be taken promptly. ## π π Follow & Support: π₯ YouTube: https://www.youtube.com/@ChiragMahtoOfficial π· Instagram: https://www.instagram.com/chirag_._mahto πΌ LinkedIn: https://linkedin.com/in/chittrmahto π Facebook: https://www.facebook.com/chittrmahto π¬ WhatsApp Channel: https://whatsapp.com/channel/0029VbBgm16002T93KB16U12 π¬ Telegram Channel: https://t.me/+GAATbmOU4z1mMDY9 π Note: Follow the process exactly as shown in the video. πΎ DM me for paid PDF/Document β π© [email protected] β¨ Share this tutorial with your friends & colleagues! π¬ Drop your questions in the YouTube comments β Iβll reply personally. π Subscribe for FREE tutorial and Certification Tutorials! π₯ Donβt forget to π LIKE, π SHARE, π COMMENT, & π SUBSCRIBE to @ChiragTutorial π― Thanks & Regards, π« Chitt Ranjan Mahto β βCHIRAGβ π« π https://www.chirags.in #chiragtutorial #chirag #chittranjanmahto #chiragmahto #postgresql #patroni #etcd #docker #highavailability #autofailover #dbacluster #postgresha #devops
