SlideShare a Scribd company logo
;
PostgreSQL 9.0 HA
Julien Pivotto
July 11, 2012
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
Table of content
1 Overview
The mission
Before the migration
2 PostgreSQL 9.0
Intro
Streaming replication
Master configuration
Slave configuration
3 Clustering
Set up of corosync
OCF resource
Synthesis
4 Backups and monitoring
Backups with cron jobs
BackupPC
Nagios
Munin
5 Automation
Puppet module
The node file
6 The end
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
Who am I
• Julien Pivotto
• @roidelapluie
• roidelapluie@inuits.eu
• Consultant at Inuits (Belgium) since May 2011
• FOSS defender since 2005
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
A.R.S.I.A.
• Association Régionale de Santé et d’Identification Animales
(Belgique)
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
A.R.S.I.A.
• Association Régionale de Santé et d’Identification Animales
(Belgique)
• 30 linux servers in several locations
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
A.R.S.I.A.
• Association Régionale de Santé et d’Identification Animales
(Belgique)
• 30 linux servers in several locations
• A lot of Open Source:
• CentOS, Samba, Open-xchange, mailscanner, Cyrus,
• . . . Puppet, jenkins, foreman, OpenVPN, GLPI, rabbitmq,
• . . . BackupPC, CUPS, icinga, trac, zope, plone,
• . . . solr, pentaho, funambol, munin, squid, asterisk,
• . . . and PostgreSQL, . . .
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
C.E.R.I.S.E
• A web application:
• Plone (python)
• 15k+ visits, 500k+ pages and 2.000.000+ hits each month
• Developped by another open-source company, Affinitic
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
C.E.R.I.S.E
• A web application:
• Plone (python)
• 15k+ visits, 500k+ pages and 2.000.000+ hits each month
• Developped by another open-source company, Affinitic
• Several databases:
• PostgreSQL 9.0
• Oracle database
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
C.E.R.I.S.E
• A web application:
• Plone (python)
• 15k+ visits, 500k+ pages and 2.000.000+ hits each month
• Developped by another open-source company, Affinitic
• Several databases:
• PostgreSQL 9.0
• Oracle database
• Several servers/services:
• Reverse proxies
• Application servers
• PostgreSQL servers
• Oracledb server
• Development server
• Pentaho server
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
• No native support of HA
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
• No native support of HA
• High availability with heartbeat 2 and DRBD
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
• No native support of HA
• High availability with heartbeat 2 and DRBD
• Installed on the application servers
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
• No native support of HA
• High availability with heartbeat 2 and DRBD
• Installed on the application servers
• Nothing automated
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
PostgreSQL before the migration
• PostgreSQL 8.3.7
• No native support of HA
• High availability with heartbeat 2 and DRBD
• Installed on the application servers
• Nothing automated
• Failover: Passive node is not even read only
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
Monitoring before the installation
• Icinga
• Check of the DRBD
• Simple connection check to PostgreSQL
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
Monitoring before the installation
• Icinga
• Check of the DRBD
• Simple connection check to PostgreSQL
• Graphing with Cacti:
• Size of the databases
• Connexions to the database
• Checkpoints
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
The mission
Before the migration
Backups before the installation
• Hourly local backups
• External backups (on disk and on tape)
• Made with pg_dump command
• External backups tool: BackupPC
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
PostgreSQL 9.0
• Released in september 2010
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
PostgreSQL 9.0
• Released in september 2010
• First version with native replication
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
PostgreSQL 9.0
• Released in september 2010
• First version with native replication
• No native failover tool
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
PostgreSQL 9.0
• Released in september 2010
• First version with native replication
• No native failover tool
• We need to use PostgreSQL + Corosync
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Write-Ahead Logging
• Every change to datafile is first written into a log file
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Write-Ahead Logging
• Every change to datafile is first written into a log file
• Less disk writes
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Write-Ahead Logging
• Every change to datafile is first written into a log file
• Less disk writes
• More cohesion
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Write-Ahead Logging
• Every change to datafile is first written into a log file
• Less disk writes
• More cohesion
• Logs can be replayed
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
What is streaming replication
• Ship and apply WAL XLOGS to standby servers
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
What is streaming replication
• Ship and apply WAL XLOGS to standby servers
• Possibility to have multiple standby servers
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
What is streaming replication
• Ship and apply WAL XLOGS to standby servers
• Possibility to have multiple standby servers
• Standby servers can be read-only ("Hot standby")
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Disadvantages of streaming replication
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Disadvantages of streaming replication
• Asynchronous log-shipping
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Disadvantages of streaming replication
• Asynchronous log-shipping
• No native HA features in PostgreSQL
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Disadvantages of streaming replication
• Asynchronous log-shipping
• No native HA features in PostgreSQL
• Single-threaded replication
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Specifications of streaming replication
• Asynchronous log-shipping
• Delay is often very close to 0
• No native HA features in PostgreSQL
• Single-threaded replication
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Specifications of streaming replication
• Asynchronous log-shipping
• Delay is often very close to 0
• No native HA features in PostgreSQL
• We will use corosync
• Single-threaded replication
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Specifications of streaming replication
• Asynchronous log-shipping
• Delay is often very close to 0
• No native HA features in PostgreSQL
• We will use corosync
• Single-threaded replication
• Single-threaded replication. . .
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
Only one specific configuration file.
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
Only one specific configuration file.
Configuration related to SR
wal_level = hot_standby
max_wal_senders = 2
wal_keep_segments = 128
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Allows stanby server to be readable
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Allows stanby server to be readable
• max_wal_senders = 2
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Allows stanby server to be readable
• max_wal_senders = 2
We allow up to 2 standby nodes
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Allows stanby server to be readable
• max_wal_senders = 2
We allow up to 2 standby nodes
• wal_keep_segments = 128
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Master configuration
• wal_level = hot_standby
Allows stanby server to be readable
• max_wal_senders = 2
We allow up to 2 standby nodes
• wal_keep_segments = 128
The minimum wal segments to keep
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
• Two configuration files
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
• Two configuration files
• PostgreSQL.conf file
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
• Two configuration files
• PostgreSQL.conf file
• Recovery.conf file
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
• Two configuration files
• PostgreSQL.conf file
• Recovery.conf file
• A trigger file to stop replication can be specified
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
• Two configuration files
• PostgreSQL.conf file
• Recovery.conf file
• A trigger file to stop replication can be specified
PostgreSQL.conf - Configuration related to SR
wal_level = hot_standby
hot_standby = on
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
recovery.conf
standby_mode = ‘on’
primary_conninfo = ‘host=192.168.142.31 user=replicuser’
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
recovery.conf
standby_mode = ‘on’
primary_conninfo = ‘host=192.168.142.31 user=replicuser’
• standby_mode = standby server
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Slave configuration
recovery.conf
standby_mode = ‘on’
primary_conninfo = ‘host=192.168.142.31 user=replicuser’
• standby_mode = standby server
• primary_conninfo = connection to the master
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Replication user
• Super user called replication is created
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Replication user
• Super user called replication is created
SQL query to create super user
CREATE USER replication SUPERUSER LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD ‘foobar’;
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
pg_hba.conf
• pg_hba.conf contains some kind of ACLs for the PostgreSQL
connections
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
pg_hba.conf
• pg_hba.conf contains some kind of ACLs for the PostgreSQL
connections
• Need to add the nodes as trusted.
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
pg_hba.conf
• pg_hba.conf contains some kind of ACLs for the PostgreSQL
connections
• Need to add the nodes as trusted.
pg_hba.conf
hostnossl all all 192.168.142.31/32 trust
hostnossl all all 192.168.142.31/32 trust
hostnossl replication replicuser 192.168.142.32/32 trust
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Setting up a slave
• 3 commands required to add a slave
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Intro
Streaming replication
Master configuration
Slave configuration
Setting up a slave
• 3 commands required to add a slave
Adding a standby server
psql -c "SELECT pg_start_backup(’label’, true)"
rsync -a ${PGDATA}/ standby:/srv/pgsql/standby/ --exclude postmaster.pid --exclude ‘*-master’
--exclude ‘*-slave’
psql -c "SELECT pg_stop_backup()"
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Corosync configuration
• Goal: switching between master/slave
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Corosync configuration
• Goal: switching between master/slave
• One and only one node should be master
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Corosync configuration
• Goal: switching between master/slave
• One and only one node should be master
• Master need to be connected to the router
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Corosync configuration
• Goal: switching between master/slave
• One and only one node should be master
• Master need to be connected to the router
• Custom master/slave ocf resource
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
• Main configuration file of corosync is
/etc/corosync/crm.conf.
• Contains all the resources/nodes/etc. . .
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
• Main configuration file of corosync is
/etc/corosync/crm.conf.
• Contains all the resources/nodes/etc. . .
Defining the nodes
node dupont.demo 
attributes standby="off"
node dupond.demo 
attributes standby="on"
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Primitives
primitive pgsql ocf:inuits:pgsql-ms
primitive virt_ip ocf:heartbeat:IPaddr2 
params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255"

meta target-role="Started" is-managed="true"
primitive ping ocf:pacemaker:ping 
params host_list="192.168.142.1" 
op monitor interval="10s" timeout="10s" 
op start interval="0" timeout="45s" 
op stop interval="0" timeout="50s"
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Primitives
primitive pgsql ocf:inuits:pgsql-ms
primitive virt_ip ocf:heartbeat:IPaddr2 
params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255"

meta target-role="Started" is-managed="true"
primitive ping ocf:pacemaker:ping 
params host_list="192.168.142.1" 
op monitor interval="10s" timeout="10s" 
op start interval="0" timeout="45s" 
op stop interval="0" timeout="50s"
• 3 primitives:
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Primitives
primitive pgsql ocf:inuits:pgsql-ms
primitive virt_ip ocf:heartbeat:IPaddr2 
params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255"

meta target-role="Started" is-managed="true"
primitive ping ocf:pacemaker:ping 
params host_list="192.168.142.1" 
op monitor interval="10s" timeout="10s" 
op start interval="0" timeout="45s" 
op stop interval="0" timeout="50s"
• 3 primitives:
• pgsql, the PostgreSQL primitive
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Primitives
primitive pgsql ocf:inuits:pgsql-ms
primitive virt_ip ocf:heartbeat:IPaddr2 
params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255"

meta target-role="Started" is-managed="true"
primitive ping ocf:pacemaker:ping 
params host_list="192.168.142.1" 
op monitor interval="10s" timeout="10s" 
op start interval="0" timeout="45s" 
op stop interval="0" timeout="50s"
• 3 primitives:
• pgsql, the PostgreSQL primitive
• virt_ip, the floating IP address
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Primitives
primitive pgsql ocf:inuits:pgsql-ms
primitive virt_ip ocf:heartbeat:IPaddr2 
params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255"

meta target-role="Started" is-managed="true"
primitive ping ocf:pacemaker:ping 
params host_list="192.168.142.1" 
op monitor interval="10s" timeout="10s" 
op start interval="0" timeout="45s" 
op stop interval="0" timeout="50s"
• 3 primitives:
• pgsql, the PostgreSQL primitive
• virt_ip, the floating IP address
• ping, the primitive that will check that the servers are
connected to the router
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Configuring the primitives
ms pgsql-ms pgsql 
params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" 
lsb_script="/etc/init.d/postgresql-9.0" 
pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" 
meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false"
clone clone-ping ping 
meta globally-unique="false"
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Configuring the primitives
ms pgsql-ms pgsql 
params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" 
lsb_script="/etc/init.d/postgresql-9.0" 
pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" 
meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false"
clone clone-ping ping 
meta globally-unique="false"
• PostgreSQL M/S configuration: the init script, the
configuration files. . .
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
Configuring the primitives
ms pgsql-ms pgsql 
params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" 
lsb_script="/etc/init.d/postgresql-9.0" 
pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" 
meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false"
clone clone-ping ping 
meta globally-unique="false"
• PostgreSQL M/S configuration: the init script, the
configuration files. . .
• Ping resource as a clone (launched on both servers)
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
group and colocation
group PSQL virt_ip
location connected PSQL 
rule $id="connected-rule" -inf: not_defined pingd or pingd lte 0
colocation ip_psql inf: PSQL pgsql-ms:Master
property $id="cib-bootstrap-options" 
cluster-infrastructure="openais" 
expected-quorum-votes="2" 
stonith-enabled="false" 
no-quorum-policy="ignore" 
default-resource-stickiness="INFINITY"
rsc_defaults $id="rsc_defaults-options" 
migration-threshold="INFINITY" 
failure-timeout="10" 
resource-stickiness="INFINITY"
• Master should always be on the same node as the floating IP
address
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
crm.conf
group and colocation
group PSQL virt_ip
location connected PSQL 
rule $id="connected-rule" -inf: not_defined pingd or pingd lte 0
colocation ip_psql inf: PSQL pgsql-ms:Master
property $id="cib-bootstrap-options" 
cluster-infrastructure="openais" 
expected-quorum-votes="2" 
stonith-enabled="false" 
no-quorum-policy="ignore" 
default-resource-stickiness="INFINITY"
rsc_defaults $id="rsc_defaults-options" 
migration-threshold="INFINITY" 
failure-timeout="10" 
resource-stickiness="INFINITY"
• Master should always be on the same node as the floating IP
address
• Master should be connected to the router
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• Custom OCF resource to manage the master/slave
PostgreSQL
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• Custom OCF resource to manage the master/slave
PostgreSQL
• Based on an example of resource written by Andrew Beekhof
from Clusterlabs
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• Custom OCF resource to manage the master/slave
PostgreSQL
• Based on an example of resource written by Andrew Beekhof
from Clusterlabs
• The file is in /usr/lib/ocf/resource.d/inuits/pgsql-ms
• Available on github!
https://github.com/roidelapluie/puppet-cluster
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• The script does the following:
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• The script does the following:
• Move the postgresql.conf-master to postgresql.conf
when a node is promoted/master
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• The script does the following:
• Move the postgresql.conf-master to postgresql.conf
when a node is promoted/master
• Move the postgresql.conf-slave to postgresql.conf
when a node is depromoted/slave
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• The script does the following:
• Move the postgresql.conf-master to postgresql.conf
when a node is promoted/master
• Move the postgresql.conf-slave to postgresql.conf
when a node is depromoted/slave
• Ensure that recovery.conf-slave is on recovery.conf on
slave and absent on master
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
OCF resource
• The script does the following:
• Move the postgresql.conf-master to postgresql.conf
when a node is promoted/master
• Move the postgresql.conf-slave to postgresql.conf
when a node is depromoted/slave
• Ensure that recovery.conf-slave is on recovery.conf on
slave and absent on master
• Starts/restarts PostgreSQL when needed.
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Synthesis
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Synthesis
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Set up of corosync
OCF resource
Synthesis
Synthesis
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Backups of the databases
• The databases are quite small (a few gigabytes)
• Hourly on each node (one at minute 0 and one at minute 30)
• Daily external backup of each node
• We keep 24 hourly backups and 7 daily backups on disk
• BackupPC: we keep months of backups
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Hourly backup script
/usr/local/bin/backup_hourly.sh
#!/bin/bash
DATE=$(date +%H)
BACKUP_PATH=/var/lib/backups/hourly
for db in foobar_db foobar2_db
do
/usr/bin/pg_dump $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz
ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz
done
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Hourly backup script
/usr/local/bin/backup_hourly.sh
#!/bin/bash
DATE=$(date +%H)
BACKUP_PATH=/var/lib/backups/hourly
for db in foobar_db foobar2_db
do
/usr/bin/pg_dump $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz
ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz
done
The daily script is almost the same.
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
BackupPC script
/usr/local/bin/backup_backuppc.sh
#!/bin/bash
DATE=$(date +%u)
BACKUP_PATH=/var/lib/backups/backuppc
for db in cerise trackitquality trackit zodb_cerise
do
/usr/bin/pg_dump -U postgres $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz
ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz
done
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
BackupPC script
/usr/local/bin/backup_backuppc.sh
#!/bin/bash
DATE=$(date +%u)
BACKUP_PATH=/var/lib/backups/backuppc
for db in cerise trackitquality trackit zodb_cerise
do
/usr/bin/pg_dump -U postgres $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz
ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz
done
In the backupPC config, I added the following:
BackupPC config
$Conf{DumpPreUserCmd} = ‘$sshPath -t -q -x -l backuppc $host /usr/local/bin/backup_backuppc.sh’;
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
check_postgres script
• check_postgres.pl is a nagios-compatible perl script
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
check_postgres script
• check_postgres.pl is a nagios-compatible perl script
• Available on http://www.bucardo.org/check_postgres/
and on Github
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
check_postgres script
• check_postgres.pl is a nagios-compatible perl script
• Available on http://www.bucardo.org/check_postgres/
and on Github
• Checks:
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
check_postgres script
• check_postgres.pl is a nagios-compatible perl script
• Available on http://www.bucardo.org/check_postgres/
and on Github
• Checks:
• Current connections number
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
check_postgres script
• check_postgres.pl is a nagios-compatible perl script
• Available on http://www.bucardo.org/check_postgres/
and on Github
• Checks:
• Current connections number
• Replication delay
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Check hot_standby latency
• The check_postgres.pl script has a check for hot_standby
delay
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Check hot_standby latency
• The check_postgres.pl script has a check for hot_standby
delay
• We do not know who is the master and the slave
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Check hot_standby latency
• The check_postgres.pl script has a check for hot_standby
delay
• We do not know who is the master and the slave
• Here is a bash script I wrote to know the M/S order
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Check hot_standby latency
• The check_postgres.pl script has a check for hot_standby
delay
• We do not know who is the master and the slave
• Here is a bash script I wrote to know the M/S order
Master/slave replication check
#!/bin/bash
/usr/lib64/nagios/plugins/check_postgres.pl --db="$1" 
--action hot_standby_delay -w 300 -c 600 --host=$(
crm_resource --resource pgsql-ms --locate|
awk ‘/Master/ {master=$6} / $/ {slave=$6} END {print master","slave}’
)
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Munin postgres scripts
• Munin is shipped with perl plugins for postgresql
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Munin postgres scripts
• Munin is shipped with perl plugins for postgresql
• We use four of them:
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Munin postgres scripts
• Munin is shipped with perl plugins for postgresql
• We use four of them:
• postgres_size,
• postgres_checkpoints,
• postgres_connections_db,
• postgres_cache
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Backups with cron jobs
BackupPC
Nagios
Munin
Munin postgres scripts
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Puppet module
• Puppet-postgres module forked from Kris Buytaert’s github
page
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Puppet module
• Puppet-postgres module forked from Kris Buytaert’s github
page
• Forked to remove all references to services
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Puppet module
• Puppet-postgres module forked from Kris Buytaert’s github
page
• Forked to remove all references to services
• Creates the users, the super users, the databases
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Puppet module
• Puppet-postgres module forked from Kris Buytaert’s github
page
• Forked to remove all references to services
• Creates the users, the super users, the databases
• Parameterized classes
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Puppet module
• Puppet-postgres module forked from Kris Buytaert’s github
page
• Forked to remove all references to services
• Creates the users, the super users, the databases
• Parameterized classes
• The cache sizes are parameterized too (useful for Vagrant
boxes)
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Sqlexec definition
sqlexec.pp
define postgres::sqlexec($username, $database, $sql, $sqlcheck, $host=’localhost’, $password="")
{
exec{ "psql -h $host –username=${username} $database
-c ¨${sql}¨&& /bin/sleep 5":
environment => "PGPASSWORD=${password}",
path => $::path,
timeout => 600,
unless => "psql -h $host -U $username $database -c $sqlcheck",
}
}
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Example in the node file
Here is the result in the node file:
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Example in the node file
Here is the result in the node file:
site.pp
node postgres-server {
include postgres
include site
class {
’cluster’:
cluster_bind_interface => ’eth1’,
cluster_mcastaddr => ’226.94.1.1’,
}
postgres::hba {
$::fqdn:
password => ’yes’,
allowedrules => [
"host all all $::ipaddress/32 password",
’hostnossl replication replicuser 192.168.142.31/24 trust’,
’hostnossl replication replicuser 192.168.142.32/24 trust’,
’hostnossl all all 192.168.142.0/24 password’,
]
}
include site::sshkeys
Postgres::Cluster[$::fqdn] -> Class[’cluster’]
}
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Example in the node file
dupont.pp
node dupont inherits postgres-server {
postgres::cluster {
$::fqdn:
other_node_ip => ’192.168.142.31’,
listen => ’*’,
max_connections => ’100’,
shared_buffers => ’120MB’,
work_mem => ’3MB’,
effective_cache_size => ’352MB’,
}
class {
’postgres::firstsync’:
remotehost => ’dupont’,
password => ’rmll2012’,
}
Class[’postgres’] -> Postgres::Cluster[$::fqdn]
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Example in the node file
dupont.pp
exec {
’/bin/sleep 10’:
refreshonly => true,
subscribe => Exec[’load_crm_config’],
}
exec {
’crm node online dupond.demo’:
refreshonly => true,
path => $::path,
subscribe => Exec[’load_crm_config’],
require => Exec[’/bin/sleep 10’, ’crm node online dupond.demo’],
}
Class[’site’] -> Class[’cluster’] -> Class[’postgres::firstsync’]
Class[’postgres::firstsync’] -> Postgres::Hba[$::fqdn]
Class[’cluster’] -> Exec[’/bin/sleep 10’] -> Class[’postgres::firstsync’]
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Puppet module
The node file
Example in the node file
dupont.pp
postgres::createuser {
’tintin’:
password => ’rmll2012’,
host => ’192.168.142.30’,
passwd => ’milou’,
require => Exec[’/bin/sleep 10’],
}
postgres::createdb {
’moulinsart’:
password => ’rmll2012’,
host => ’192.168.142.30’,
owner => ’tintin’,
require => [Exec[’/bin/sleep 10’],Postgres::Createuser[’tintin’]],
}
postgres::createsuperuser {
’replicuser’:
password => ’rmll2012’,
host => ’192.168.142.30’,
passwd => ’icanhazapassword’,
require => Exec[’/bin/sleep 10’],
}
}
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Test it yourself
You will need vagrant (http://vagrantup.com).
Test-it-yourself howto
$ git clone
git://github.com/roidelapluie/postgres9-demo-vagrant.git
$ cd postgres9-demo-vagrant
$ git submodule update --init
$ vagrant up
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Any questions?
(I stay all the week @RMLL)
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
• Presentation made with latex-beamer
• PostgreSQL logo is used following the policy
http://wiki.postgresql.org/wiki/Trademark_Policy
• Tango icons have been released into the public domain
• Database icon is under CC BY-SA 3.0
http://dracos.deviantart.com/#/d2y5ele
• RMLL logo is under CC BY-SA 3.0
http://2012.rmll.info/kit-media
Julien Pivotto PostgreSQL 9.0 HA
;
Overview
PostgreSQL 9.0
Clustering
Backups and monitoring
Automation
The end
Thank you
Julien Pivotto PostgreSQL 9.0 HA

More Related Content

What's hot

Smau Milano 2016 - Fabio Alessandro Locati
Smau Milano 2016 - Fabio Alessandro LocatiSmau Milano 2016 - Fabio Alessandro Locati
Smau Milano 2016 - Fabio Alessandro Locati
SMAU
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
Git - a powerful version control tool
Git - a powerful version control toolGit - a powerful version control tool
Git - a powerful version control tool
Kuo-Le Mei
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
Naim Latifi
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
James Aylett
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Puppet
 
Git training v10
Git training v10Git training v10
Git training v10
Skander Hamza
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
Lee Hanxue
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
p3castro
 
Cooking the Cake for Nuget packages
Cooking the Cake for Nuget packagesCooking the Cake for Nuget packages
Cooking the Cake for Nuget packages
Sergey Dzyuban
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
Randal Schwartz
 
VCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT WorkshopVCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT Workshop
Anis Ahmad
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015
Chef
 
Puppet evolutions
Puppet evolutionsPuppet evolutions
Puppet evolutions
Alessandro Franceschi
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
Fabio Kung
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
Pablo Godel
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
Yoad Snapir
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
Paulo Henrique Nonaka
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
Geoff Hoffman
 

What's hot (20)

Smau Milano 2016 - Fabio Alessandro Locati
Smau Milano 2016 - Fabio Alessandro LocatiSmau Milano 2016 - Fabio Alessandro Locati
Smau Milano 2016 - Fabio Alessandro Locati
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony AppsSymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
 
Git - a powerful version control tool
Git - a powerful version control toolGit - a powerful version control tool
Git - a powerful version control tool
 
GIT presentation
GIT presentationGIT presentation
GIT presentation
 
Git, from the beginning
Git, from the beginningGit, from the beginning
Git, from the beginning
 
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
Workshop: Know Before You Push 'Go': Using the Beaker Acceptance Test Framewo...
 
Git training v10
Git training v10Git training v10
Git training v10
 
Github - Git Training Slides: Foundations
Github - Git Training Slides: FoundationsGithub - Git Training Slides: Foundations
Github - Git Training Slides: Foundations
 
Packaging perl (LPW2010)
Packaging perl (LPW2010)Packaging perl (LPW2010)
Packaging perl (LPW2010)
 
Cooking the Cake for Nuget packages
Cooking the Cake for Nuget packagesCooking the Cake for Nuget packages
Cooking the Cake for Nuget packages
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
VCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT WorkshopVCS for Teamwork - GIT Workshop
VCS for Teamwork - GIT Workshop
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015
 
Puppet evolutions
Puppet evolutionsPuppet evolutions
Puppet evolutions
 
Ruby and Rails Packaging to Production
Ruby and Rails Packaging to ProductionRuby and Rails Packaging to Production
Ruby and Rails Packaging to Production
 
The Modern Developer Toolbox
The Modern Developer ToolboxThe Modern Developer Toolbox
The Modern Developer Toolbox
 
Basic Git Intro
Basic Git IntroBasic Git Intro
Basic Git Intro
 
Git & Github for beginners
Git & Github for beginnersGit & Github for beginners
Git & Github for beginners
 
Git 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using GitGit 101 - Crash Course in Version Control using Git
Git 101 - Crash Course in Version Control using Git
 

Similar to Postgresql 9.0 HA at RMLL 2012

Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012Julien Pivotto
 
[2C4]Clustered computing with CoreOS, fleet and etcd
[2C4]Clustered computing with CoreOS, fleet and etcd[2C4]Clustered computing with CoreOS, fleet and etcd
[2C4]Clustered computing with CoreOS, fleet and etcd
NAVER D2
 
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptxBuilt-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
nadirpervez2
 
PaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpPaaSTA: Running applications at Yelp
PaaSTA: Running applications at Yelp
Nathan Handler
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
Thibaud Gravrand
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL Features
Peter Eisentraut
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
Chandan Kumar
 
AKS: k8s e azure
AKS: k8s e azureAKS: k8s e azure
AKS: k8s e azure
Alessandro Melchiori
 
2009-01-20 RHEL 5.3 for System z
2009-01-20 RHEL 5.3 for System z2009-01-20 RHEL 5.3 for System z
2009-01-20 RHEL 5.3 for System z
Shawn Wells
 
SUSE Container as a Service Platform
SUSE Container as a Service PlatformSUSE Container as a Service Platform
SUSE Container as a Service Platform
SUSE
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Red Hat Developers
 
20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup
Stéphane Este-Gracias
 
Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringar
Squeed
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
Stanislav Osipov
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
Jody Garnett
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
Wei Shan Ang
 
The devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code StyleThe devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code Style
Julien Pivotto
 
Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016
Petr Jelinek
 
Built in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat GulecBuilt in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat Gulec
FIRAT GULEC
 
Upgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleetUpgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleet
Davide Cavalca
 

Similar to Postgresql 9.0 HA at RMLL 2012 (20)

Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012Postgresql 9.0 HA at LOADAYS 2012
Postgresql 9.0 HA at LOADAYS 2012
 
[2C4]Clustered computing with CoreOS, fleet and etcd
[2C4]Clustered computing with CoreOS, fleet and etcd[2C4]Clustered computing with CoreOS, fleet and etcd
[2C4]Clustered computing with CoreOS, fleet and etcd
 
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptxBuilt-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
Built-in-Physical-and-Logical-Replication-in-Postgresql-Firat-Gulec.pptx
 
PaaSTA: Running applications at Yelp
PaaSTA: Running applications at YelpPaaSTA: Running applications at Yelp
PaaSTA: Running applications at Yelp
 
Smarter deployments with octopus deploy
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
 
Most Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL FeaturesMost Wanted: Future PostgreSQL Features
Most Wanted: Future PostgreSQL Features
 
Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO Delivering a bleeding edge community-led openstack distribution: RDO
Delivering a bleeding edge community-led openstack distribution: RDO
 
AKS: k8s e azure
AKS: k8s e azureAKS: k8s e azure
AKS: k8s e azure
 
2009-01-20 RHEL 5.3 for System z
2009-01-20 RHEL 5.3 for System z2009-01-20 RHEL 5.3 for System z
2009-01-20 RHEL 5.3 for System z
 
SUSE Container as a Service Platform
SUSE Container as a Service PlatformSUSE Container as a Service Platform
SUSE Container as a Service Platform
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 
20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup20221130 - Luxembourg HUG Meetup
20221130 - Luxembourg HUG Meetup
 
Liquibase få kontroll på dina databasförändringar
Liquibase   få kontroll på dina databasförändringarLiquibase   få kontroll på dina databasförändringar
Liquibase få kontroll på dina databasförändringar
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
High performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodbHigh performance json- postgre sql vs. mongodb
High performance json- postgre sql vs. mongodb
 
The devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code StyleThe devops approach to monitoring, Open Source and Infrastructure as Code Style
The devops approach to monitoring, Open Source and Infrastructure as Code Style
 
Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016Logical Replication in PostgreSQL - FLOSSUK 2016
Logical Replication in PostgreSQL - FLOSSUK 2016
 
Built in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat GulecBuilt in physical and logical replication in postgresql-Firat Gulec
Built in physical and logical replication in postgresql-Firat Gulec
 
Upgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleetUpgrading CentOS on the Facebook fleet
Upgrading CentOS on the Facebook fleet
 

More from Julien Pivotto

The O11y Toolkit
The O11y ToolkitThe O11y Toolkit
The O11y Toolkit
Julien Pivotto
 
What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its Ecosystem
Julien Pivotto
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
Julien Pivotto
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?
Julien Pivotto
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
Julien Pivotto
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
Julien Pivotto
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From Prometheus
Julien Pivotto
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with Prometheus
Julien Pivotto
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery
Julien Pivotto
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
Julien Pivotto
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in Grafana
Julien Pivotto
 
YAML Magic
YAML MagicYAML Magic
YAML Magic
Julien Pivotto
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
Julien Pivotto
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
Julien Pivotto
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
Julien Pivotto
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
Julien Pivotto
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as Code
Julien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
Julien Pivotto
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
Julien Pivotto
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to Ansible
Julien Pivotto
 

More from Julien Pivotto (20)

The O11y Toolkit
The O11y ToolkitThe O11y Toolkit
The O11y Toolkit
 
What's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its EcosystemWhat's New in Prometheus and Its Ecosystem
What's New in Prometheus and Its Ecosystem
 
Prometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is comingPrometheus: What is is, what is new, what is coming
Prometheus: What is is, what is new, what is coming
 
What's new in Prometheus?
What's new in Prometheus?What's new in Prometheus?
What's new in Prometheus?
 
Introduction to Grafana Loki
Introduction to Grafana LokiIntroduction to Grafana Loki
Introduction to Grafana Loki
 
Why you should revisit mgmt
Why you should revisit mgmtWhy you should revisit mgmt
Why you should revisit mgmt
 
Observing the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From PrometheusObserving the HashiCorp Ecosystem From Prometheus
Observing the HashiCorp Ecosystem From Prometheus
 
Monitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with PrometheusMonitoring in a fast-changing world with Prometheus
Monitoring in a fast-changing world with Prometheus
 
5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery5 tips for Prometheus Service Discovery
5 tips for Prometheus Service Discovery
 
Prometheus and TLS - an Introduction
Prometheus and TLS - an IntroductionPrometheus and TLS - an Introduction
Prometheus and TLS - an Introduction
 
Powerful graphs in Grafana
Powerful graphs in GrafanaPowerful graphs in Grafana
Powerful graphs in Grafana
 
YAML Magic
YAML MagicYAML Magic
YAML Magic
 
HAProxy as Egress Controller
HAProxy as Egress ControllerHAProxy as Egress Controller
HAProxy as Egress Controller
 
Improved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and AlertmanagerImproved alerting with Prometheus and Alertmanager
Improved alerting with Prometheus and Alertmanager
 
SIngle Sign On with Keycloak
SIngle Sign On with KeycloakSIngle Sign On with Keycloak
SIngle Sign On with Keycloak
 
Monitoring as an entry point for collaboration
Monitoring as an entry point for collaborationMonitoring as an entry point for collaboration
Monitoring as an entry point for collaboration
 
Incident Resolution as Code
Incident Resolution as CodeIncident Resolution as Code
Incident Resolution as Code
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
Monitor your CentOS stack with Prometheus
Monitor your CentOS stack with PrometheusMonitor your CentOS stack with Prometheus
Monitor your CentOS stack with Prometheus
 
An introduction to Ansible
An introduction to AnsibleAn introduction to Ansible
An introduction to Ansible
 

Recently uploaded

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Postgresql 9.0 HA at RMLL 2012

  • 1. ; PostgreSQL 9.0 HA Julien Pivotto July 11, 2012
  • 2. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration Table of content 1 Overview The mission Before the migration 2 PostgreSQL 9.0 Intro Streaming replication Master configuration Slave configuration 3 Clustering Set up of corosync OCF resource Synthesis 4 Backups and monitoring Backups with cron jobs BackupPC Nagios Munin 5 Automation Puppet module The node file 6 The end Julien Pivotto PostgreSQL 9.0 HA
  • 3. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration Who am I • Julien Pivotto • @roidelapluie • roidelapluie@inuits.eu • Consultant at Inuits (Belgium) since May 2011 • FOSS defender since 2005 Julien Pivotto PostgreSQL 9.0 HA
  • 4. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration A.R.S.I.A. • Association Régionale de Santé et d’Identification Animales (Belgique) Julien Pivotto PostgreSQL 9.0 HA
  • 5. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration A.R.S.I.A. • Association Régionale de Santé et d’Identification Animales (Belgique) • 30 linux servers in several locations Julien Pivotto PostgreSQL 9.0 HA
  • 6. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration A.R.S.I.A. • Association Régionale de Santé et d’Identification Animales (Belgique) • 30 linux servers in several locations • A lot of Open Source: • CentOS, Samba, Open-xchange, mailscanner, Cyrus, • . . . Puppet, jenkins, foreman, OpenVPN, GLPI, rabbitmq, • . . . BackupPC, CUPS, icinga, trac, zope, plone, • . . . solr, pentaho, funambol, munin, squid, asterisk, • . . . and PostgreSQL, . . . Julien Pivotto PostgreSQL 9.0 HA
  • 7. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration C.E.R.I.S.E • A web application: • Plone (python) • 15k+ visits, 500k+ pages and 2.000.000+ hits each month • Developped by another open-source company, Affinitic Julien Pivotto PostgreSQL 9.0 HA
  • 8. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration C.E.R.I.S.E • A web application: • Plone (python) • 15k+ visits, 500k+ pages and 2.000.000+ hits each month • Developped by another open-source company, Affinitic • Several databases: • PostgreSQL 9.0 • Oracle database Julien Pivotto PostgreSQL 9.0 HA
  • 9. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration C.E.R.I.S.E • A web application: • Plone (python) • 15k+ visits, 500k+ pages and 2.000.000+ hits each month • Developped by another open-source company, Affinitic • Several databases: • PostgreSQL 9.0 • Oracle database • Several servers/services: • Reverse proxies • Application servers • PostgreSQL servers • Oracledb server • Development server • Pentaho server Julien Pivotto PostgreSQL 9.0 HA
  • 10. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 Julien Pivotto PostgreSQL 9.0 HA
  • 11. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 • No native support of HA Julien Pivotto PostgreSQL 9.0 HA
  • 12. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 • No native support of HA • High availability with heartbeat 2 and DRBD Julien Pivotto PostgreSQL 9.0 HA
  • 13. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 • No native support of HA • High availability with heartbeat 2 and DRBD • Installed on the application servers Julien Pivotto PostgreSQL 9.0 HA
  • 14. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 • No native support of HA • High availability with heartbeat 2 and DRBD • Installed on the application servers • Nothing automated Julien Pivotto PostgreSQL 9.0 HA
  • 15. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration PostgreSQL before the migration • PostgreSQL 8.3.7 • No native support of HA • High availability with heartbeat 2 and DRBD • Installed on the application servers • Nothing automated • Failover: Passive node is not even read only Julien Pivotto PostgreSQL 9.0 HA
  • 16. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration Monitoring before the installation • Icinga • Check of the DRBD • Simple connection check to PostgreSQL Julien Pivotto PostgreSQL 9.0 HA
  • 17. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration Monitoring before the installation • Icinga • Check of the DRBD • Simple connection check to PostgreSQL • Graphing with Cacti: • Size of the databases • Connexions to the database • Checkpoints Julien Pivotto PostgreSQL 9.0 HA
  • 18. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end The mission Before the migration Backups before the installation • Hourly local backups • External backups (on disk and on tape) • Made with pg_dump command • External backups tool: BackupPC Julien Pivotto PostgreSQL 9.0 HA
  • 19. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration PostgreSQL 9.0 • Released in september 2010 Julien Pivotto PostgreSQL 9.0 HA
  • 20. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration PostgreSQL 9.0 • Released in september 2010 • First version with native replication Julien Pivotto PostgreSQL 9.0 HA
  • 21. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration PostgreSQL 9.0 • Released in september 2010 • First version with native replication • No native failover tool Julien Pivotto PostgreSQL 9.0 HA
  • 22. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration PostgreSQL 9.0 • Released in september 2010 • First version with native replication • No native failover tool • We need to use PostgreSQL + Corosync Julien Pivotto PostgreSQL 9.0 HA
  • 23. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Write-Ahead Logging • Every change to datafile is first written into a log file Julien Pivotto PostgreSQL 9.0 HA
  • 24. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Write-Ahead Logging • Every change to datafile is first written into a log file • Less disk writes Julien Pivotto PostgreSQL 9.0 HA
  • 25. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Write-Ahead Logging • Every change to datafile is first written into a log file • Less disk writes • More cohesion Julien Pivotto PostgreSQL 9.0 HA
  • 26. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Write-Ahead Logging • Every change to datafile is first written into a log file • Less disk writes • More cohesion • Logs can be replayed Julien Pivotto PostgreSQL 9.0 HA
  • 27. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration What is streaming replication • Ship and apply WAL XLOGS to standby servers Julien Pivotto PostgreSQL 9.0 HA
  • 28. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration What is streaming replication • Ship and apply WAL XLOGS to standby servers • Possibility to have multiple standby servers Julien Pivotto PostgreSQL 9.0 HA
  • 29. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration What is streaming replication • Ship and apply WAL XLOGS to standby servers • Possibility to have multiple standby servers • Standby servers can be read-only ("Hot standby") Julien Pivotto PostgreSQL 9.0 HA
  • 30. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Disadvantages of streaming replication Julien Pivotto PostgreSQL 9.0 HA
  • 31. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Disadvantages of streaming replication • Asynchronous log-shipping Julien Pivotto PostgreSQL 9.0 HA
  • 32. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Disadvantages of streaming replication • Asynchronous log-shipping • No native HA features in PostgreSQL Julien Pivotto PostgreSQL 9.0 HA
  • 33. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Disadvantages of streaming replication • Asynchronous log-shipping • No native HA features in PostgreSQL • Single-threaded replication Julien Pivotto PostgreSQL 9.0 HA
  • 34. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Specifications of streaming replication • Asynchronous log-shipping • Delay is often very close to 0 • No native HA features in PostgreSQL • Single-threaded replication Julien Pivotto PostgreSQL 9.0 HA
  • 35. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Specifications of streaming replication • Asynchronous log-shipping • Delay is often very close to 0 • No native HA features in PostgreSQL • We will use corosync • Single-threaded replication Julien Pivotto PostgreSQL 9.0 HA
  • 36. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Specifications of streaming replication • Asynchronous log-shipping • Delay is often very close to 0 • No native HA features in PostgreSQL • We will use corosync • Single-threaded replication • Single-threaded replication. . . Julien Pivotto PostgreSQL 9.0 HA
  • 37. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration Only one specific configuration file. Julien Pivotto PostgreSQL 9.0 HA
  • 38. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration Only one specific configuration file. Configuration related to SR wal_level = hot_standby max_wal_senders = 2 wal_keep_segments = 128 Julien Pivotto PostgreSQL 9.0 HA
  • 39. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Julien Pivotto PostgreSQL 9.0 HA
  • 40. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Allows stanby server to be readable Julien Pivotto PostgreSQL 9.0 HA
  • 41. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Allows stanby server to be readable • max_wal_senders = 2 Julien Pivotto PostgreSQL 9.0 HA
  • 42. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Allows stanby server to be readable • max_wal_senders = 2 We allow up to 2 standby nodes Julien Pivotto PostgreSQL 9.0 HA
  • 43. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Allows stanby server to be readable • max_wal_senders = 2 We allow up to 2 standby nodes • wal_keep_segments = 128 Julien Pivotto PostgreSQL 9.0 HA
  • 44. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Master configuration • wal_level = hot_standby Allows stanby server to be readable • max_wal_senders = 2 We allow up to 2 standby nodes • wal_keep_segments = 128 The minimum wal segments to keep Julien Pivotto PostgreSQL 9.0 HA
  • 45. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration • Two configuration files Julien Pivotto PostgreSQL 9.0 HA
  • 46. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration • Two configuration files • PostgreSQL.conf file Julien Pivotto PostgreSQL 9.0 HA
  • 47. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration • Two configuration files • PostgreSQL.conf file • Recovery.conf file Julien Pivotto PostgreSQL 9.0 HA
  • 48. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration • Two configuration files • PostgreSQL.conf file • Recovery.conf file • A trigger file to stop replication can be specified Julien Pivotto PostgreSQL 9.0 HA
  • 49. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration • Two configuration files • PostgreSQL.conf file • Recovery.conf file • A trigger file to stop replication can be specified PostgreSQL.conf - Configuration related to SR wal_level = hot_standby hot_standby = on Julien Pivotto PostgreSQL 9.0 HA
  • 50. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration recovery.conf standby_mode = ‘on’ primary_conninfo = ‘host=192.168.142.31 user=replicuser’ Julien Pivotto PostgreSQL 9.0 HA
  • 51. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration recovery.conf standby_mode = ‘on’ primary_conninfo = ‘host=192.168.142.31 user=replicuser’ • standby_mode = standby server Julien Pivotto PostgreSQL 9.0 HA
  • 52. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Slave configuration recovery.conf standby_mode = ‘on’ primary_conninfo = ‘host=192.168.142.31 user=replicuser’ • standby_mode = standby server • primary_conninfo = connection to the master Julien Pivotto PostgreSQL 9.0 HA
  • 53. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Replication user • Super user called replication is created Julien Pivotto PostgreSQL 9.0 HA
  • 54. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Replication user • Super user called replication is created SQL query to create super user CREATE USER replication SUPERUSER LOGIN CONNECTION LIMIT 1 ENCRYPTED PASSWORD ‘foobar’; Julien Pivotto PostgreSQL 9.0 HA
  • 55. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration pg_hba.conf • pg_hba.conf contains some kind of ACLs for the PostgreSQL connections Julien Pivotto PostgreSQL 9.0 HA
  • 56. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration pg_hba.conf • pg_hba.conf contains some kind of ACLs for the PostgreSQL connections • Need to add the nodes as trusted. Julien Pivotto PostgreSQL 9.0 HA
  • 57. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration pg_hba.conf • pg_hba.conf contains some kind of ACLs for the PostgreSQL connections • Need to add the nodes as trusted. pg_hba.conf hostnossl all all 192.168.142.31/32 trust hostnossl all all 192.168.142.31/32 trust hostnossl replication replicuser 192.168.142.32/32 trust Julien Pivotto PostgreSQL 9.0 HA
  • 58. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Setting up a slave • 3 commands required to add a slave Julien Pivotto PostgreSQL 9.0 HA
  • 59. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Intro Streaming replication Master configuration Slave configuration Setting up a slave • 3 commands required to add a slave Adding a standby server psql -c "SELECT pg_start_backup(’label’, true)" rsync -a ${PGDATA}/ standby:/srv/pgsql/standby/ --exclude postmaster.pid --exclude ‘*-master’ --exclude ‘*-slave’ psql -c "SELECT pg_stop_backup()" Julien Pivotto PostgreSQL 9.0 HA
  • 60. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Corosync configuration • Goal: switching between master/slave Julien Pivotto PostgreSQL 9.0 HA
  • 61. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Corosync configuration • Goal: switching between master/slave • One and only one node should be master Julien Pivotto PostgreSQL 9.0 HA
  • 62. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Corosync configuration • Goal: switching between master/slave • One and only one node should be master • Master need to be connected to the router Julien Pivotto PostgreSQL 9.0 HA
  • 63. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Corosync configuration • Goal: switching between master/slave • One and only one node should be master • Master need to be connected to the router • Custom master/slave ocf resource Julien Pivotto PostgreSQL 9.0 HA
  • 64. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf • Main configuration file of corosync is /etc/corosync/crm.conf. • Contains all the resources/nodes/etc. . . Julien Pivotto PostgreSQL 9.0 HA
  • 65. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf • Main configuration file of corosync is /etc/corosync/crm.conf. • Contains all the resources/nodes/etc. . . Defining the nodes node dupont.demo attributes standby="off" node dupond.demo attributes standby="on" Julien Pivotto PostgreSQL 9.0 HA
  • 66. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Primitives primitive pgsql ocf:inuits:pgsql-ms primitive virt_ip ocf:heartbeat:IPaddr2 params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255" meta target-role="Started" is-managed="true" primitive ping ocf:pacemaker:ping params host_list="192.168.142.1" op monitor interval="10s" timeout="10s" op start interval="0" timeout="45s" op stop interval="0" timeout="50s" Julien Pivotto PostgreSQL 9.0 HA
  • 67. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Primitives primitive pgsql ocf:inuits:pgsql-ms primitive virt_ip ocf:heartbeat:IPaddr2 params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255" meta target-role="Started" is-managed="true" primitive ping ocf:pacemaker:ping params host_list="192.168.142.1" op monitor interval="10s" timeout="10s" op start interval="0" timeout="45s" op stop interval="0" timeout="50s" • 3 primitives: Julien Pivotto PostgreSQL 9.0 HA
  • 68. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Primitives primitive pgsql ocf:inuits:pgsql-ms primitive virt_ip ocf:heartbeat:IPaddr2 params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255" meta target-role="Started" is-managed="true" primitive ping ocf:pacemaker:ping params host_list="192.168.142.1" op monitor interval="10s" timeout="10s" op start interval="0" timeout="45s" op stop interval="0" timeout="50s" • 3 primitives: • pgsql, the PostgreSQL primitive Julien Pivotto PostgreSQL 9.0 HA
  • 69. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Primitives primitive pgsql ocf:inuits:pgsql-ms primitive virt_ip ocf:heartbeat:IPaddr2 params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255" meta target-role="Started" is-managed="true" primitive ping ocf:pacemaker:ping params host_list="192.168.142.1" op monitor interval="10s" timeout="10s" op start interval="0" timeout="45s" op stop interval="0" timeout="50s" • 3 primitives: • pgsql, the PostgreSQL primitive • virt_ip, the floating IP address Julien Pivotto PostgreSQL 9.0 HA
  • 70. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Primitives primitive pgsql ocf:inuits:pgsql-ms primitive virt_ip ocf:heartbeat:IPaddr2 params nic="eth1" iflabel="0" ip="192.168.142.30" cidr_netmask="24" broadcast="192.168.142.255" meta target-role="Started" is-managed="true" primitive ping ocf:pacemaker:ping params host_list="192.168.142.1" op monitor interval="10s" timeout="10s" op start interval="0" timeout="45s" op stop interval="0" timeout="50s" • 3 primitives: • pgsql, the PostgreSQL primitive • virt_ip, the floating IP address • ping, the primitive that will check that the servers are connected to the router Julien Pivotto PostgreSQL 9.0 HA
  • 71. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Configuring the primitives ms pgsql-ms pgsql params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" lsb_script="/etc/init.d/postgresql-9.0" pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false" clone clone-ping ping meta globally-unique="false" Julien Pivotto PostgreSQL 9.0 HA
  • 72. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Configuring the primitives ms pgsql-ms pgsql params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" lsb_script="/etc/init.d/postgresql-9.0" pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false" clone clone-ping ping meta globally-unique="false" • PostgreSQL M/S configuration: the init script, the configuration files. . . Julien Pivotto PostgreSQL 9.0 HA
  • 73. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf Configuring the primitives ms pgsql-ms pgsql params pgsqlconfig="/var/lib/pgsql/data/postgresql.conf" lsb_script="/etc/init.d/postgresql-9.0" pgsqlrecovery="/var/lib/pgsql/data/recovery.conf" meta clone-max="2" clone-node-max="1" master-max="1" master-node-max="1" notify="false" clone clone-ping ping meta globally-unique="false" • PostgreSQL M/S configuration: the init script, the configuration files. . . • Ping resource as a clone (launched on both servers) Julien Pivotto PostgreSQL 9.0 HA
  • 74. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf group and colocation group PSQL virt_ip location connected PSQL rule $id="connected-rule" -inf: not_defined pingd or pingd lte 0 colocation ip_psql inf: PSQL pgsql-ms:Master property $id="cib-bootstrap-options" cluster-infrastructure="openais" expected-quorum-votes="2" stonith-enabled="false" no-quorum-policy="ignore" default-resource-stickiness="INFINITY" rsc_defaults $id="rsc_defaults-options" migration-threshold="INFINITY" failure-timeout="10" resource-stickiness="INFINITY" • Master should always be on the same node as the floating IP address Julien Pivotto PostgreSQL 9.0 HA
  • 75. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis crm.conf group and colocation group PSQL virt_ip location connected PSQL rule $id="connected-rule" -inf: not_defined pingd or pingd lte 0 colocation ip_psql inf: PSQL pgsql-ms:Master property $id="cib-bootstrap-options" cluster-infrastructure="openais" expected-quorum-votes="2" stonith-enabled="false" no-quorum-policy="ignore" default-resource-stickiness="INFINITY" rsc_defaults $id="rsc_defaults-options" migration-threshold="INFINITY" failure-timeout="10" resource-stickiness="INFINITY" • Master should always be on the same node as the floating IP address • Master should be connected to the router Julien Pivotto PostgreSQL 9.0 HA
  • 76. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • Custom OCF resource to manage the master/slave PostgreSQL Julien Pivotto PostgreSQL 9.0 HA
  • 77. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • Custom OCF resource to manage the master/slave PostgreSQL • Based on an example of resource written by Andrew Beekhof from Clusterlabs Julien Pivotto PostgreSQL 9.0 HA
  • 78. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • Custom OCF resource to manage the master/slave PostgreSQL • Based on an example of resource written by Andrew Beekhof from Clusterlabs • The file is in /usr/lib/ocf/resource.d/inuits/pgsql-ms • Available on github! https://github.com/roidelapluie/puppet-cluster Julien Pivotto PostgreSQL 9.0 HA
  • 79. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • The script does the following: Julien Pivotto PostgreSQL 9.0 HA
  • 80. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • The script does the following: • Move the postgresql.conf-master to postgresql.conf when a node is promoted/master Julien Pivotto PostgreSQL 9.0 HA
  • 81. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • The script does the following: • Move the postgresql.conf-master to postgresql.conf when a node is promoted/master • Move the postgresql.conf-slave to postgresql.conf when a node is depromoted/slave Julien Pivotto PostgreSQL 9.0 HA
  • 82. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • The script does the following: • Move the postgresql.conf-master to postgresql.conf when a node is promoted/master • Move the postgresql.conf-slave to postgresql.conf when a node is depromoted/slave • Ensure that recovery.conf-slave is on recovery.conf on slave and absent on master Julien Pivotto PostgreSQL 9.0 HA
  • 83. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis OCF resource • The script does the following: • Move the postgresql.conf-master to postgresql.conf when a node is promoted/master • Move the postgresql.conf-slave to postgresql.conf when a node is depromoted/slave • Ensure that recovery.conf-slave is on recovery.conf on slave and absent on master • Starts/restarts PostgreSQL when needed. Julien Pivotto PostgreSQL 9.0 HA
  • 84. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Synthesis Julien Pivotto PostgreSQL 9.0 HA
  • 85. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Synthesis Julien Pivotto PostgreSQL 9.0 HA
  • 86. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Set up of corosync OCF resource Synthesis Synthesis Julien Pivotto PostgreSQL 9.0 HA
  • 87. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Backups of the databases • The databases are quite small (a few gigabytes) • Hourly on each node (one at minute 0 and one at minute 30) • Daily external backup of each node • We keep 24 hourly backups and 7 daily backups on disk • BackupPC: we keep months of backups Julien Pivotto PostgreSQL 9.0 HA
  • 88. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Hourly backup script /usr/local/bin/backup_hourly.sh #!/bin/bash DATE=$(date +%H) BACKUP_PATH=/var/lib/backups/hourly for db in foobar_db foobar2_db do /usr/bin/pg_dump $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz done Julien Pivotto PostgreSQL 9.0 HA
  • 89. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Hourly backup script /usr/local/bin/backup_hourly.sh #!/bin/bash DATE=$(date +%H) BACKUP_PATH=/var/lib/backups/hourly for db in foobar_db foobar2_db do /usr/bin/pg_dump $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz done The daily script is almost the same. Julien Pivotto PostgreSQL 9.0 HA
  • 90. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin BackupPC script /usr/local/bin/backup_backuppc.sh #!/bin/bash DATE=$(date +%u) BACKUP_PATH=/var/lib/backups/backuppc for db in cerise trackitquality trackit zodb_cerise do /usr/bin/pg_dump -U postgres $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz done Julien Pivotto PostgreSQL 9.0 HA
  • 91. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin BackupPC script /usr/local/bin/backup_backuppc.sh #!/bin/bash DATE=$(date +%u) BACKUP_PATH=/var/lib/backups/backuppc for db in cerise trackitquality trackit zodb_cerise do /usr/bin/pg_dump -U postgres $db | gzip > $BACKUP_PATH/${db}_$DATE.pgsql.gz ln -fs $BACKUP_PATH/${db}_$DATE.pgsql.gz $BACKUP_PATH/${db}_current.pgsql.gz done In the backupPC config, I added the following: BackupPC config $Conf{DumpPreUserCmd} = ‘$sshPath -t -q -x -l backuppc $host /usr/local/bin/backup_backuppc.sh’; Julien Pivotto PostgreSQL 9.0 HA
  • 92. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin check_postgres script • check_postgres.pl is a nagios-compatible perl script Julien Pivotto PostgreSQL 9.0 HA
  • 93. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin check_postgres script • check_postgres.pl is a nagios-compatible perl script • Available on http://www.bucardo.org/check_postgres/ and on Github Julien Pivotto PostgreSQL 9.0 HA
  • 94. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin check_postgres script • check_postgres.pl is a nagios-compatible perl script • Available on http://www.bucardo.org/check_postgres/ and on Github • Checks: Julien Pivotto PostgreSQL 9.0 HA
  • 95. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin check_postgres script • check_postgres.pl is a nagios-compatible perl script • Available on http://www.bucardo.org/check_postgres/ and on Github • Checks: • Current connections number Julien Pivotto PostgreSQL 9.0 HA
  • 96. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin check_postgres script • check_postgres.pl is a nagios-compatible perl script • Available on http://www.bucardo.org/check_postgres/ and on Github • Checks: • Current connections number • Replication delay Julien Pivotto PostgreSQL 9.0 HA
  • 97. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Check hot_standby latency • The check_postgres.pl script has a check for hot_standby delay Julien Pivotto PostgreSQL 9.0 HA
  • 98. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Check hot_standby latency • The check_postgres.pl script has a check for hot_standby delay • We do not know who is the master and the slave Julien Pivotto PostgreSQL 9.0 HA
  • 99. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Check hot_standby latency • The check_postgres.pl script has a check for hot_standby delay • We do not know who is the master and the slave • Here is a bash script I wrote to know the M/S order Julien Pivotto PostgreSQL 9.0 HA
  • 100. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Check hot_standby latency • The check_postgres.pl script has a check for hot_standby delay • We do not know who is the master and the slave • Here is a bash script I wrote to know the M/S order Master/slave replication check #!/bin/bash /usr/lib64/nagios/plugins/check_postgres.pl --db="$1" --action hot_standby_delay -w 300 -c 600 --host=$( crm_resource --resource pgsql-ms --locate| awk ‘/Master/ {master=$6} / $/ {slave=$6} END {print master","slave}’ ) Julien Pivotto PostgreSQL 9.0 HA
  • 101. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Munin postgres scripts • Munin is shipped with perl plugins for postgresql Julien Pivotto PostgreSQL 9.0 HA
  • 102. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Munin postgres scripts • Munin is shipped with perl plugins for postgresql • We use four of them: Julien Pivotto PostgreSQL 9.0 HA
  • 103. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Munin postgres scripts • Munin is shipped with perl plugins for postgresql • We use four of them: • postgres_size, • postgres_checkpoints, • postgres_connections_db, • postgres_cache Julien Pivotto PostgreSQL 9.0 HA
  • 104. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Backups with cron jobs BackupPC Nagios Munin Munin postgres scripts Julien Pivotto PostgreSQL 9.0 HA
  • 105. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Puppet module • Puppet-postgres module forked from Kris Buytaert’s github page Julien Pivotto PostgreSQL 9.0 HA
  • 106. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Puppet module • Puppet-postgres module forked from Kris Buytaert’s github page • Forked to remove all references to services Julien Pivotto PostgreSQL 9.0 HA
  • 107. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Puppet module • Puppet-postgres module forked from Kris Buytaert’s github page • Forked to remove all references to services • Creates the users, the super users, the databases Julien Pivotto PostgreSQL 9.0 HA
  • 108. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Puppet module • Puppet-postgres module forked from Kris Buytaert’s github page • Forked to remove all references to services • Creates the users, the super users, the databases • Parameterized classes Julien Pivotto PostgreSQL 9.0 HA
  • 109. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Puppet module • Puppet-postgres module forked from Kris Buytaert’s github page • Forked to remove all references to services • Creates the users, the super users, the databases • Parameterized classes • The cache sizes are parameterized too (useful for Vagrant boxes) Julien Pivotto PostgreSQL 9.0 HA
  • 110. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Sqlexec definition sqlexec.pp define postgres::sqlexec($username, $database, $sql, $sqlcheck, $host=’localhost’, $password="") { exec{ "psql -h $host –username=${username} $database -c ¨${sql}¨&& /bin/sleep 5": environment => "PGPASSWORD=${password}", path => $::path, timeout => 600, unless => "psql -h $host -U $username $database -c $sqlcheck", } } Julien Pivotto PostgreSQL 9.0 HA
  • 111. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Example in the node file Here is the result in the node file: Julien Pivotto PostgreSQL 9.0 HA
  • 112. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Example in the node file Here is the result in the node file: site.pp node postgres-server { include postgres include site class { ’cluster’: cluster_bind_interface => ’eth1’, cluster_mcastaddr => ’226.94.1.1’, } postgres::hba { $::fqdn: password => ’yes’, allowedrules => [ "host all all $::ipaddress/32 password", ’hostnossl replication replicuser 192.168.142.31/24 trust’, ’hostnossl replication replicuser 192.168.142.32/24 trust’, ’hostnossl all all 192.168.142.0/24 password’, ] } include site::sshkeys Postgres::Cluster[$::fqdn] -> Class[’cluster’] } Julien Pivotto PostgreSQL 9.0 HA
  • 113. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Example in the node file dupont.pp node dupont inherits postgres-server { postgres::cluster { $::fqdn: other_node_ip => ’192.168.142.31’, listen => ’*’, max_connections => ’100’, shared_buffers => ’120MB’, work_mem => ’3MB’, effective_cache_size => ’352MB’, } class { ’postgres::firstsync’: remotehost => ’dupont’, password => ’rmll2012’, } Class[’postgres’] -> Postgres::Cluster[$::fqdn] Julien Pivotto PostgreSQL 9.0 HA
  • 114. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Example in the node file dupont.pp exec { ’/bin/sleep 10’: refreshonly => true, subscribe => Exec[’load_crm_config’], } exec { ’crm node online dupond.demo’: refreshonly => true, path => $::path, subscribe => Exec[’load_crm_config’], require => Exec[’/bin/sleep 10’, ’crm node online dupond.demo’], } Class[’site’] -> Class[’cluster’] -> Class[’postgres::firstsync’] Class[’postgres::firstsync’] -> Postgres::Hba[$::fqdn] Class[’cluster’] -> Exec[’/bin/sleep 10’] -> Class[’postgres::firstsync’] Julien Pivotto PostgreSQL 9.0 HA
  • 115. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Puppet module The node file Example in the node file dupont.pp postgres::createuser { ’tintin’: password => ’rmll2012’, host => ’192.168.142.30’, passwd => ’milou’, require => Exec[’/bin/sleep 10’], } postgres::createdb { ’moulinsart’: password => ’rmll2012’, host => ’192.168.142.30’, owner => ’tintin’, require => [Exec[’/bin/sleep 10’],Postgres::Createuser[’tintin’]], } postgres::createsuperuser { ’replicuser’: password => ’rmll2012’, host => ’192.168.142.30’, passwd => ’icanhazapassword’, require => Exec[’/bin/sleep 10’], } } Julien Pivotto PostgreSQL 9.0 HA
  • 116. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Test it yourself You will need vagrant (http://vagrantup.com). Test-it-yourself howto $ git clone git://github.com/roidelapluie/postgres9-demo-vagrant.git $ cd postgres9-demo-vagrant $ git submodule update --init $ vagrant up Julien Pivotto PostgreSQL 9.0 HA
  • 117. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Any questions? (I stay all the week @RMLL) Julien Pivotto PostgreSQL 9.0 HA
  • 118. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end • Presentation made with latex-beamer • PostgreSQL logo is used following the policy http://wiki.postgresql.org/wiki/Trademark_Policy • Tango icons have been released into the public domain • Database icon is under CC BY-SA 3.0 http://dracos.deviantart.com/#/d2y5ele • RMLL logo is under CC BY-SA 3.0 http://2012.rmll.info/kit-media Julien Pivotto PostgreSQL 9.0 HA
  • 119. ; Overview PostgreSQL 9.0 Clustering Backups and monitoring Automation The end Thank you Julien Pivotto PostgreSQL 9.0 HA