SlideShare a Scribd company logo
January 2019
Automation & Management of
PostgreSQL with ClusterControl
Sebastian Insausti
Presenter
sebastian@severalnines.com
Copyright 2018 Severalnines AB
I'm Jean-Jérôme from the Severalnines Team and
I'm your host for today's webinar!
Feel free to ask any questions in the Questions
section of this application or via the Chat box.
You can also contact me directly via the chat box
or via email: info@severalnines.com during or
after the webinar.
Your host & some logistics
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
Free to download
Initial 30 days Enterprise trial
Converts into free Community Edition
Enterprise / paid versions available
Copyright 2018 Severalnines AB
Automation & Management
Deployment (Free Community)
● Deploy a Cluster in Minutes
○ On-Prem
○ Cloud (AWS/Azure/Google) - paid
Monitoring (Free Community)
● Systems View with 1 sec Resolution
● DB / OS stats & Performance Advisors
● Configurable Dashboards
● Query Analyzer
● Agentless & agent-based
Management (Paid Features)
● Backup Management
● Upgrades & Patching
● Security & Compliance
● Operational Reports
● Automatic Recovery & Repair
● Performance Management
● Automatic Performance Advisors
Copyright 2018 Severalnines AB
Supported Databases
Copyright 2018 Severalnines AB
Our Customers
Poll - multiple choice
Copyright 2018 Severalnines AB
Which method do you use to perform your DBA tasks?
● Manual actions
● Custom scripts
● External tools and utilities
● ClusterControl
● Others (please specify in the chat box)
January 2019
Automation & Management of
PostgreSQL with ClusterControl
Sebastian Insausti
Presenter
sebastian@severalnines.com
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Managing PostgreSQL
● Requirements for managing production
databases
“The Old Way”
● Labour intensive, manual operations
● Scripts, tools and utilities
● What happens when the DBA leaves?
Agenda
Automation and Management with ClusterControl
● Deployment
● Monitoring & Alerting
● Performance Management
● Backup management
● High Availability setups
● Single VIP endpoint with Load Balancer
● Automatic Failover
Live Demo
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
Requirements for managing production
databases
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Deployment
● Install
○ The first step to begin the game
● Secure
○ Keep your data safe and secure
● Configure
○ Environment requirements
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Monitoring & Alerting
● Define metrics
○ Database
○ Operating System
● Configure monitoring
○ Custom Monitoring
○ System Monitoring
● Configure alerts
○ Email alerts
○ Tool Integrations
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Important but complex task
● PostgreSQL is configured with compatibility and stability by default
● Depends on the hardware and on the system itself
● Performance queries
Performance Management
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Backups Methods:
○ Logical backup: Plain text files with SQL statements
○ Physical backup: A copy of the datafiles
● Backup tasks:
○ Schedule
○ Rotation / Retention
○ Secure Backup
○ Verify Backup
○ Point-in-time recovery backup
○ Upload to external datacenter, e.g., cloud storage
○ Reporting
Backup Management
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Define topology
○ Master-Slave
○ Master-Master
● Define replication type
○ Synchronous: There is no loss of data even if our master node is lost. The commits
in the master must wait for a confirmation from the slave.
○ Asynchronous: There is a possibility of data loss in case we lose our master node. If
the replica is not updated at the time of the incident, the information that has not
been copied may be lost.
○ Logical Replication: Performed via SQL statements.
○ Physical Replication: Performed via internal data structure.
● Failover
● Single endpoint for application
High Availability setups
Poll - multiple choice
Copyright 2018 Severalnines AB
According to you, what are your most challenging tasks in production?
● A well tuned and secure configuration
● Monitoring uptime & Alerting
● Managing performance / queries
● Backup management
● Failover & High Availability
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
"The Old Way"
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Deployment
● Installation:
○ Repositories or packages
○ Some packages dependencies could be required
● Secure installation:
○ Configuration files (pg_hba.conf or postgresql.conf)
○ Authentication
● Basic configuration:
○ For example: Listen address or wal_level
○ Require DBA or Sysadmin skills
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
What to monitor
● Database
○ Queries
○ Sessions
○ Locks
○ IO
○ Replication
○ Backups
● System
○ CPU
○ Memory
○ Load Average
○ Network
Monitoring & Alerting
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Performance Management
● Time consuming task
● There is not a standard configuration for this task
● Check charts
○ e.g: max_connections
● Database commands
○ EXPLAIN: Check the query plan
○ VACUUM: For several maintenance tasks
● Parameters
○ shared_buffers: Amount of memory that the database uses for shared memory
○ work_mem: Amount of memory used by internal operations like ORDER BY, DISTINCT, JOIN,
among others
● Require deep DBA knowledge
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Backup Management
● Typically done using custom scripts
● Some just copy the datafiles (!)
● Schedule using cron
● Manual rotation
● No backup verification or PITR backup
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Master-Slave Topology
● Asynchronous replication
● Manual setup of slave
○ Install a new server
○ Copy data from master
○ Configure replication
High Availability Setups
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Automatic Failover
● We need to know when we need the failover
● PostgreSQL itself does not include an automatic failover mechanism
● After failover, the applications need to know about the new master
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Load Balancer:
○ Balancing traffic
○ Redirect traffic to available nodes
○ Specify ports for different roles
○ It's an external component that requires installation,
configuration and monitoring
● Virtual IP:
○ Keepalived is a linux service that allows to configure a
virtual IP within an active/passive group of servers
○ Another external component that requires installation,
configuration and monitoring
Single VIP endpoint with Load Balancer
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
● Where is the documentation?
● How do all these scripts hang together?
● It is often hard to know how the database is managed
● There is nobody to take over what you did
● It can be a mess
What happens when the DBA leaves?
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
ClusterControl - PostgreSQL automation
and management
Copyright 2018 Severalnines AB
ClusterControl
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Deployment
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Monitoring & Alerting
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Monitoring & Alerting
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Performance Management
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Backup Management
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
High Availability Setups
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Single VIP endpoint with Load Balancer
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
Automatic Failover
Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB
ClusterControl CLI
$ s9s cluster --list --long
ID STATE TYPE OWNER GROUP NAME COMMENT
1 FAILURE galera system admins Galera1 Cluster failed to start.
2 STARTED postgresql_single system admins PostgreSQL1 All nodes are operational.
5 FAILURE replication system admins MySQL1 Cluster failed to start.
Total: 3
$ s9s node --list --cluster-id=2 --long
STAT VERSION CID CLUSTER HOST PORT COMMENT
coC- 1.7.1.2965 2 PostgreSQL1 192.168.100.110 9500 Up and running.
?o-- 2.3.2 2 PostgreSQL1 192.168.100.110 9090 Process 'prometheus' is running.
ho-- 1.5.18 2 PostgreSQL1 192.168.100.114 9600 Process 'haproxy' is running.
koM- 1.3 2 PostgreSQL1 192.168.100.114 112 Process 'keepalived' is running.
ho-- 1.5.18 2 PostgreSQL1 192.168.100.115 9600 Process 'haproxy' is running.
ko-- 1.3 2 PostgreSQL1 192.168.100.115 112 Process 'keepalived' is running.
poM- 10.5 2 PostgreSQL1 192.168.100.123 5432 Up and running.
poS- 10.5 2 PostgreSQL1 192.168.100.124 5432 Up and running.
poS- 10.5 2 PostgreSQL1 192.168.100.125 5432 Up and running.
Total: 9
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
Live Demo
● Deployment
● Add replication slave
● Add load balancer
● Deploy keepalived
● Monitoring
● Performance
● Backup
● Topology view
● CLI
Cluster Control PostgreSQL Management
Demo
Copyright 2018 Severalnines AB
Poll - multiple choice (choose one of below)
Copyright 2018 Severalnines AB
Where do you need the most improvements in your environment?
● Monitoring & Alerting
● Performance Management
● Backups
● High Availability & Automatic Failover
● Other (please specify in the chat box)
Copyright 2018 Severalnines AB
Copyright 2018 Severalnines AB
Q & A
Links & Resources
● ClusterControl for PostgreSQL
● Download / install ClusterControl
● ClusterControl Community Edition Page
● Contact us: info@severalnines.com

More Related Content

What's hot (20)

PDF
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Severalnines
 
PPTX
Performance Tuning Cheat Sheet for MongoDB
Severalnines
 
PDF
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 
PPTX
Advanced MySql Data-at-Rest Encryption in Percona Server
Severalnines
 
PDF
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
PDF
How QBerg scaled to store data longer, query it faster
MariaDB plc
 
PPTX
CCV: migrating our payment processing system to MariaDB
MariaDB plc
 
PPTX
How Pixid dropped Oracle and went hybrid with MariaDB
MariaDB plc
 
PPTX
How we switched to columnar at SpendHQ
MariaDB plc
 
PDF
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
PDF
Introducing the R2DBC async Java connector
MariaDB plc
 
PDF
Webinar slides: How to Measure Database Availability?
Severalnines
 
PDF
The architecture of SkySQL
MariaDB plc
 
PDF
What to expect from MariaDB Platform X5, part 1
MariaDB plc
 
PDF
Faster, better, stronger: The new InnoDB
MariaDB plc
 
PDF
What to expect from MariaDB Platform X5, part 2
MariaDB plc
 
PDF
MariaDB Enterprise Tools introduction
MariaDB plc
 
PDF
Under the hood: SkySQL monitoring
MariaDB plc
 
PDF
Getting started in the cloud for developers
MariaDB plc
 
PDF
Using Pentaho with MariaDB ColumnStore
MariaDB plc
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Severalnines
 
Performance Tuning Cheat Sheet for MongoDB
Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Severalnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Severalnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
Severalnines
 
How QBerg scaled to store data longer, query it faster
MariaDB plc
 
CCV: migrating our payment processing system to MariaDB
MariaDB plc
 
How Pixid dropped Oracle and went hybrid with MariaDB
MariaDB plc
 
How we switched to columnar at SpendHQ
MariaDB plc
 
Introducing the ultimate MariaDB cloud, SkySQL
MariaDB plc
 
Introducing the R2DBC async Java connector
MariaDB plc
 
Webinar slides: How to Measure Database Availability?
Severalnines
 
The architecture of SkySQL
MariaDB plc
 
What to expect from MariaDB Platform X5, part 1
MariaDB plc
 
Faster, better, stronger: The new InnoDB
MariaDB plc
 
What to expect from MariaDB Platform X5, part 2
MariaDB plc
 
MariaDB Enterprise Tools introduction
MariaDB plc
 
Under the hood: SkySQL monitoring
MariaDB plc
 
Getting started in the cloud for developers
MariaDB plc
 
Using Pentaho with MariaDB ColumnStore
MariaDB plc
 

Similar to Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl (20)

PDF
Webinar slides: How to Get Started with Open Source Database Management
Severalnines
 
PDF
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
Umair Shahid
 
PDF
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
PDF
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
PDF
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
PPTX
20240515 - Chicago PUG - Clustering in PostgreSQL: Because one database serve...
Umair Shahid
 
PDF
Clustering in PostgreSQL - Because one database server is never enough (and n...
Umair Shahid
 
PDF
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
PPTX
Community vs. Commercial Open Source
Justin Reock
 
PDF
PGConf.ASIA 2019 Bali - Modern PostgreSQL Monitoring & Diagnostics - Mahadeva...
Equnix Business Solutions
 
PDF
Patroni - HA PostgreSQL made easy
Alexander Kukushkin
 
PDF
Postgres in Production - Best Practices 2014
EDB
 
PDF
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
VMware Tanzu
 
PDF
The Accidental DBA
PostgreSQL Experts, Inc.
 
PDF
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
PPTX
Postgre sql best_practices
Jacques Kostic
 
PDF
Best Practices & Lessons Learned from Deployment of PostgreSQL
EDB
 
PPTX
Postgre sql best_practices
Emiliano Fusaglia
 
PPTX
TechEvent PostgreSQL Best Practices
Trivadis
 
PDF
Creating customized openSUSE versions with SUSE Studio
elliando dias
 
Webinar slides: How to Get Started with Open Source Database Management
Severalnines
 
20230511 - PGConf Nepal - Clustering in PostgreSQL_ Because one database serv...
Umair Shahid
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Severalnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Severalnines
 
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
20240515 - Chicago PUG - Clustering in PostgreSQL: Because one database serve...
Umair Shahid
 
Clustering in PostgreSQL - Because one database server is never enough (and n...
Umair Shahid
 
What’s the Best PostgreSQL High Availability Framework? PAF vs. repmgr vs. Pa...
ScaleGrid.io
 
Community vs. Commercial Open Source
Justin Reock
 
PGConf.ASIA 2019 Bali - Modern PostgreSQL Monitoring & Diagnostics - Mahadeva...
Equnix Business Solutions
 
Patroni - HA PostgreSQL made easy
Alexander Kukushkin
 
Postgres in Production - Best Practices 2014
EDB
 
Cloud-Native Patterns and the Benefits of MySQL as a Platform Managed Service
VMware Tanzu
 
The Accidental DBA
PostgreSQL Experts, Inc.
 
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
Postgre sql best_practices
Jacques Kostic
 
Best Practices & Lessons Learned from Deployment of PostgreSQL
EDB
 
Postgre sql best_practices
Emiliano Fusaglia
 
TechEvent PostgreSQL Best Practices
Trivadis
 
Creating customized openSUSE versions with SUSE Studio
elliando dias
 
Ad

More from Severalnines (14)

PDF
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
Severalnines
 
PPTX
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
Severalnines
 
PDF
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
Severalnines
 
PDF
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
Severalnines
 
PDF
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
Severalnines
 
PDF
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
Severalnines
 
PDF
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
Severalnines
 
PDF
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
PPTX
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Severalnines
 
PDF
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
PDF
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
PDF
Cloud's future runs through Sovereign DBaaS
Severalnines
 
PPTX
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
PPTX
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Severalnines
 
The Long Term Cost of Managed DBaaS vs Sovereign DBaaS
Severalnines
 
Sovereign DBaaS_ A Practical Vision for Self-Implementation of DBaaS.pptx
Severalnines
 
PostgreSQL on AWS Aurora/Azure Cosmos VS EC2/Azure VMs
Severalnines
 
Localhost Conference 2024_ Building a Flexible and Scalable Database Strategy...
Severalnines
 
SREDAY London 2024 | Cloud Native Technologies: The Building Blocks of Modern...
Severalnines
 
Building a Sovereign DBaaS on K8s OpenInfra Summit Asia 2024.pdf
Severalnines
 
S-DBaaS Community Call | Introduction to Sovereign DBaaS: The why, what and how
Severalnines
 
WEBINAR SLIDES: CCX for Cloud Service Providers
Severalnines
 
LIVE DEMO: CCX for CSPs, a drop-in DBaaS solution
Severalnines
 
Kubernetes at Scale: Going Multi-Cluster with Istio
Severalnines
 
DIY DBaaS: A guide to building your own full-featured DBaaS
Severalnines
 
Cloud's future runs through Sovereign DBaaS
Severalnines
 
Tips to drive maria db cluster performance for nextcloud
Severalnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Severalnines
 
Ad

Recently uploaded (20)

PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PPTX
Orchestrating things in Angular application
Peter Abraham
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PDF
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
Cerebraix Technologies
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
PPTX
internet básico presentacion es una red global
70965857
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
PDF
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Orchestrating things in Angular application
Peter Abraham
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
L1A Season 1 ENGLISH made by A hegy fixed
toszolder91
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
Cerebraix Technologies
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
internet básico presentacion es una red global
70965857
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
ONLINE BIRTH CERTIFICATE APPLICATION SYSYTEM PPT.pptx
ShyamasreeDutta
 
𝐁𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓
hokimamad0
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 

Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl

  • 1. January 2019 Automation & Management of PostgreSQL with ClusterControl Sebastian Insausti Presenter [email protected]
  • 2. Copyright 2018 Severalnines AB I'm Jean-Jérôme from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions in the Questions section of this application or via the Chat box. You can also contact me directly via the chat box or via email: [email protected] during or after the webinar. Your host & some logistics
  • 5. Copyright 2018 Severalnines AB Free to download Initial 30 days Enterprise trial Converts into free Community Edition Enterprise / paid versions available
  • 6. Copyright 2018 Severalnines AB Automation & Management Deployment (Free Community) ● Deploy a Cluster in Minutes ○ On-Prem ○ Cloud (AWS/Azure/Google) - paid Monitoring (Free Community) ● Systems View with 1 sec Resolution ● DB / OS stats & Performance Advisors ● Configurable Dashboards ● Query Analyzer ● Agentless & agent-based Management (Paid Features) ● Backup Management ● Upgrades & Patching ● Security & Compliance ● Operational Reports ● Automatic Recovery & Repair ● Performance Management ● Automatic Performance Advisors
  • 7. Copyright 2018 Severalnines AB Supported Databases
  • 8. Copyright 2018 Severalnines AB Our Customers
  • 9. Poll - multiple choice Copyright 2018 Severalnines AB Which method do you use to perform your DBA tasks? ● Manual actions ● Custom scripts ● External tools and utilities ● ClusterControl ● Others (please specify in the chat box)
  • 10. January 2019 Automation & Management of PostgreSQL with ClusterControl Sebastian Insausti Presenter [email protected]
  • 11. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Managing PostgreSQL ● Requirements for managing production databases “The Old Way” ● Labour intensive, manual operations ● Scripts, tools and utilities ● What happens when the DBA leaves? Agenda Automation and Management with ClusterControl ● Deployment ● Monitoring & Alerting ● Performance Management ● Backup management ● High Availability setups ● Single VIP endpoint with Load Balancer ● Automatic Failover Live Demo
  • 12. Copyright 2018 Severalnines AB Copyright 2018 Severalnines AB Requirements for managing production databases
  • 13. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Deployment ● Install ○ The first step to begin the game ● Secure ○ Keep your data safe and secure ● Configure ○ Environment requirements
  • 14. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Monitoring & Alerting ● Define metrics ○ Database ○ Operating System ● Configure monitoring ○ Custom Monitoring ○ System Monitoring ● Configure alerts ○ Email alerts ○ Tool Integrations
  • 15. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Important but complex task ● PostgreSQL is configured with compatibility and stability by default ● Depends on the hardware and on the system itself ● Performance queries Performance Management
  • 16. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Backups Methods: ○ Logical backup: Plain text files with SQL statements ○ Physical backup: A copy of the datafiles ● Backup tasks: ○ Schedule ○ Rotation / Retention ○ Secure Backup ○ Verify Backup ○ Point-in-time recovery backup ○ Upload to external datacenter, e.g., cloud storage ○ Reporting Backup Management
  • 17. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Define topology ○ Master-Slave ○ Master-Master ● Define replication type ○ Synchronous: There is no loss of data even if our master node is lost. The commits in the master must wait for a confirmation from the slave. ○ Asynchronous: There is a possibility of data loss in case we lose our master node. If the replica is not updated at the time of the incident, the information that has not been copied may be lost. ○ Logical Replication: Performed via SQL statements. ○ Physical Replication: Performed via internal data structure. ● Failover ● Single endpoint for application High Availability setups
  • 18. Poll - multiple choice Copyright 2018 Severalnines AB According to you, what are your most challenging tasks in production? ● A well tuned and secure configuration ● Monitoring uptime & Alerting ● Managing performance / queries ● Backup management ● Failover & High Availability
  • 19. Copyright 2018 Severalnines AB Copyright 2018 Severalnines AB "The Old Way"
  • 20. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Deployment ● Installation: ○ Repositories or packages ○ Some packages dependencies could be required ● Secure installation: ○ Configuration files (pg_hba.conf or postgresql.conf) ○ Authentication ● Basic configuration: ○ For example: Listen address or wal_level ○ Require DBA or Sysadmin skills
  • 21. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB What to monitor ● Database ○ Queries ○ Sessions ○ Locks ○ IO ○ Replication ○ Backups ● System ○ CPU ○ Memory ○ Load Average ○ Network Monitoring & Alerting
  • 22. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Performance Management ● Time consuming task ● There is not a standard configuration for this task ● Check charts ○ e.g: max_connections ● Database commands ○ EXPLAIN: Check the query plan ○ VACUUM: For several maintenance tasks ● Parameters ○ shared_buffers: Amount of memory that the database uses for shared memory ○ work_mem: Amount of memory used by internal operations like ORDER BY, DISTINCT, JOIN, among others ● Require deep DBA knowledge
  • 23. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Backup Management ● Typically done using custom scripts ● Some just copy the datafiles (!) ● Schedule using cron ● Manual rotation ● No backup verification or PITR backup
  • 24. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Master-Slave Topology ● Asynchronous replication ● Manual setup of slave ○ Install a new server ○ Copy data from master ○ Configure replication High Availability Setups
  • 25. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Automatic Failover ● We need to know when we need the failover ● PostgreSQL itself does not include an automatic failover mechanism ● After failover, the applications need to know about the new master
  • 26. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Load Balancer: ○ Balancing traffic ○ Redirect traffic to available nodes ○ Specify ports for different roles ○ It's an external component that requires installation, configuration and monitoring ● Virtual IP: ○ Keepalived is a linux service that allows to configure a virtual IP within an active/passive group of servers ○ Another external component that requires installation, configuration and monitoring Single VIP endpoint with Load Balancer
  • 27. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ● Where is the documentation? ● How do all these scripts hang together? ● It is often hard to know how the database is managed ● There is nobody to take over what you did ● It can be a mess What happens when the DBA leaves?
  • 28. Copyright 2018 Severalnines AB Copyright 2018 Severalnines AB ClusterControl - PostgreSQL automation and management
  • 29. Copyright 2018 Severalnines AB ClusterControl
  • 30. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Deployment
  • 31. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Monitoring & Alerting
  • 32. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Monitoring & Alerting
  • 33. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Performance Management
  • 34. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Backup Management
  • 35. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB High Availability Setups
  • 36. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Single VIP endpoint with Load Balancer
  • 37. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB Automatic Failover
  • 38. Copyright 2018 Severalnines ABCopyright 2018 Severalnines AB ClusterControl CLI $ s9s cluster --list --long ID STATE TYPE OWNER GROUP NAME COMMENT 1 FAILURE galera system admins Galera1 Cluster failed to start. 2 STARTED postgresql_single system admins PostgreSQL1 All nodes are operational. 5 FAILURE replication system admins MySQL1 Cluster failed to start. Total: 3 $ s9s node --list --cluster-id=2 --long STAT VERSION CID CLUSTER HOST PORT COMMENT coC- 1.7.1.2965 2 PostgreSQL1 192.168.100.110 9500 Up and running. ?o-- 2.3.2 2 PostgreSQL1 192.168.100.110 9090 Process 'prometheus' is running. ho-- 1.5.18 2 PostgreSQL1 192.168.100.114 9600 Process 'haproxy' is running. koM- 1.3 2 PostgreSQL1 192.168.100.114 112 Process 'keepalived' is running. ho-- 1.5.18 2 PostgreSQL1 192.168.100.115 9600 Process 'haproxy' is running. ko-- 1.3 2 PostgreSQL1 192.168.100.115 112 Process 'keepalived' is running. poM- 10.5 2 PostgreSQL1 192.168.100.123 5432 Up and running. poS- 10.5 2 PostgreSQL1 192.168.100.124 5432 Up and running. poS- 10.5 2 PostgreSQL1 192.168.100.125 5432 Up and running. Total: 9
  • 39. Copyright 2018 Severalnines AB Copyright 2018 Severalnines AB Live Demo
  • 40. ● Deployment ● Add replication slave ● Add load balancer ● Deploy keepalived ● Monitoring ● Performance ● Backup ● Topology view ● CLI Cluster Control PostgreSQL Management Demo Copyright 2018 Severalnines AB
  • 41. Poll - multiple choice (choose one of below) Copyright 2018 Severalnines AB Where do you need the most improvements in your environment? ● Monitoring & Alerting ● Performance Management ● Backups ● High Availability & Automatic Failover ● Other (please specify in the chat box)
  • 42. Copyright 2018 Severalnines AB Copyright 2018 Severalnines AB Q & A
  • 43. Links & Resources ● ClusterControl for PostgreSQL ● Download / install ClusterControl ● ClusterControl Community Edition Page ● Contact us: [email protected]