SlideShare a Scribd company logo
1 of 52
Download to read offline
/
Denish Patel
Sr. Database Architect
} Sr. Database Architect @ Medallia
} Previously:
◦ DB Engineer@ WithMe
◦ Lead Database Architect @ OmniTI
} Expertise in PostgreSQL , Oracle, MySQL, NoSQL
} Contact : denish.j.patel@gmail.com or
dpatel@medallia.com
} Twitter: @DenishPatel
} Blog: http://www.pateldenish.com
} Postgres Slack Channel (https://postgres-
slack.herokuapp.com/)
1
§ What is WAL?
§ Postgres Replication History
§ How you setup replication now?
§ What’s missing ?
§ Why replication slots?
§ Demo
I’m NOT going to discuss …
§ SLONY or other 3rd party replication tools
§ 3rd party replication management tools
2
} Roll-forward recovery aka REDO
} flushed to disk to guarantee commit durability
} sequential writes
} lower cost than flushing page cache
} Allows us to do cool things
– Crash recovery
– Binary backups
– Point-In Time Recovery
– Replication
3
} Automatically enabled; no action required
} Make sure to have enough space on server
} Stored under pg_xlog directory
} Normally, 16MB in size
ü--with-wal-segsize config option at build
} Each segment is divided into pages (8 kB page)
ü--with-wal-blocksize config option at build
◦ Segment name starts with..
000000010000000000000000
4
select * from pg_settings where name='wal_level';
name | wal_level
setting | hot_standby
unit |
category | Write-Ahead Log / Settings
short_desc | Set the level of information written to the WAL.
extra_desc |
context | postmaster
vartype | enum
source | configuration file
min_val |
max_val |
enumvals | { minimal, archive, hot_standby, logical }
boot_val | minimal
reset_val | hot_standby
sourcefile | /var/lib/pgsql/9.4/data/postgresql.auto.conf
sourceline | 4
5
Almost everything is replicated, but...
§ unlogged tables (As name suggests)
§ temporary tables
§ hash indexes? (generally don’t use?)
6
Postgres 7.0: WAL
Postgres 8.0: PITR (Point-In-Time-Recovery)
Postgres 8.2: pg_standby
Postgres 9.0: Hot_standby, Streaming replication
Postgres 9.1: pg_basebackup, Synchronous
replication
Postgres 9.2: Cascading Replication
Postgres 9.3: Standby can switch timeline to follow
new master
Postgres 9.4: Replication Slots , Logical decoding
7
initdb
8
§ max_wal_senders=10
§ wal_level=hot_standby
§ hot_standby=on (on standby)
9
#TYPE DATABASE USER ADDRESS METHOD
host replication replication 10.0.0.1/32 md5
10
pg_ctl restart
11
CREATE ROLE replication WITH LOGIN REPLICATION;
password replication
12
§ Take file system level backups
§ What tools you are using for backups?
13
primary_conninfo = 'host=primaryhost
user=replication password=replication'
standby_mode = on
14
pg_ctl start
15
Have you configured archiving?
16
wal_keep_segments
17
§ postgresql.conf
archive_mode = on
archive_command = 'cp %p /some/where/%f'
18
§ recovery.conf
restore_command = 'cp /some/where/%f %p'
19
§ local or remote copy
§ Scp
§ Rsync
§ NFS
§ pg_archivecleanup
20
archive_command = 'rsync %p standby1::pg/%f &&
rsync %p standby2::pg/%f'
archive_command = 'echo standby1 standby2 ...
| xargs -d" " -I{} -n1 -P0 -r rsync %p {}::pg/%f'
21
§ OmniPITR
§ WAL-E
§ Repmgr
§ Pgbarman
§ Skytools
§ A lot of Custom scripts
22
§ fsync capabilities
§ cp: no
§ dd: GNU coreutils
§ SSH: OpenSSH 6.5 sftp-server (Jan 2014)
§ rsync: patch or wrapper
§ NFS: Supported
23
24
max_replication_slots = 8
25
SELECT * FROM
pg_create_physical_replication_slot('name');
26
select * from pg_replication_slots ;
slot_name |plugin |slot_type
|datoid|database|active|xmin|catalog_xmin|restart_lsn
------------+--------+-----------+--------+----
------+--------+------+--------------+---
standby1 | | physical | | | t | |
|0/21000058
standby2 | | physical | | | t | |
|0/21000058
standby3 | | physical | | | t | |
|0/21000058
27
primary_slot_name = ‘name'
28
§ Keep necessary WAL files
§ Each standby can have different WAL apply
status
§ Single access control setup
§ fsync on receiving side
29
pg_basebackup 
-h primaryhost
-U replication 
-D $PGDATA 
-X stream 
–P –v -R
30
§ Meet pg_receivexlog
§ (Available since Postgers 9.1!)
pg_receivexlog 
-D archivedir 
--slot archivingslot 
-h primaryhost -U replication
§ -- synchronous option in 9.5
31
Are you ready to setup replication without any
external tools?
1. pg_basebackup
2. streaming with Replication Slots
3. pg_receivexlog
32
§ Google Drive:
§ Login: pgtraining/pgcon
§ pgtraining user has sudo access
§ You can access terminal on the desktop
§ Internet should be working within VM
§ Copy/paste should work between VM and Host
§ Take snapshot along the process so you can rollback
easily
33
§ Remove Postgres 8.4 version
sudo yum erase postgresql.*
§ Setup yum repo for your desired version
sudo yum install http://yum.postgresql.org/9.4/redhat/rhel-
6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
§ Install PostgreSQL 9.4 & Contrib modules
sudo yum install postgresql94-server postgresql94-contrib
§ Create postgres cluster & initial automatic startup
sudo service postgresql-9.4 initdb
sudo chkconfig postgresql-9.4 on
sudo service postgresql-9.4 start
34
§ Become postgres system user
sudo su - postgres
§ Log into database using psql (? to see all available
commands)
§ Create a role & database for yourself
CREATE ROLE pgtraining WITH LOGIN SUPERUSER;
CREATE DATABASE pgtraining;
§ You can login as pgtraining user (psql –U pgtraining –d
pgtraining)
§ Create replication role for later
CREATE ROLE replication WITH LOGIN REPLICATION;
§ Set password (”replication”)
password replication
35
§ http://www.postgresql.org/docs/9.4/static/auth-
pg-hba-conf.html
§ Find location of hba_file
postgres=# show hba_file;
§ Add following entry for replication user
§ Try to avoid trust authentication
§ [pgtraining@localhost ~]$ sudo vi
/var/lib/pgsql/9.4/data/pg_hba.conf
host replication replication 127.0.0.1/32
md5
36
alter system set wal_level = hot_standby;
alter system set archive_mode=on;
alter system set max_replication_slots=8;
alter system set archive_timeout = 60;
alter system set max_wal_senders = 8;
alter system set wal_keep_segments=100;
alter system set logging_collector=on;
37
§ Restart database
sudo service postgresql-9.4 restart
§ Verify settings
psql=# show max_wal_senders;
38
SELECT * FROM pg_create_physical_replication_slot('standby1');
39
sudo su - postgres
pg_basebackup -h 127.0.0.1 -U replication -D
/var/lib/pgsql/9.4/slave -R -Xs -P -v
40
cd /var/lib/pgsql/9.4/slave
§ Edit Standby postgresql.conf file
port = 5433
hot_standby = on
§ Edit Standby recovery.conf file
standby_mode = 'on'
primary_conninfo = 'user=replication password=replication
host=127.0.0.1 port=5432'
primary_slot_name='standby1'
trigger_file = '/var/lib/pgsql/9.4/slave/finish.recovery'
recovery_target_timeline='latest'
41
§ Copy existing init file
sudo cp /etc/init.d/postgresql-9.4 /etc/init.d/postgresql-9.4-
5433
§ Edit config file to change (as root):
PGDATA=/var/lib/pgsql/9.4/slave
PGLOG=/var/lib/pgsql/9.4/pgstartup-5433.log
PGUPLOG=/var/lib/pgsql/$PGMAJORVERSION/pgupgrade-
5433.log
§ Register service, start up slave
sudo chkconfig postgresql-9.4-5433 on
sudo service postgresql-9.4-5433 start
42
pgtraining=# select * from pg_stat_replication;
-[ RECORD 1 ]----+------------------------------
pid | 3260
usesysid | 24576
usename | replication
application_name | walreceiver
client_addr | 127.0.0.1
client_hostname |
client_port | 53206
backend_start | 2015-06-08 14:47:50.057326-04
backend_xmin |
state | streaming
sent_location | 0/240000B8
write_location | 0/240000B8
flush_location | 0/240000B8
replay_location | 0/240000B8
sync_priority | 0
sync_state | async
43
pgtraining=# select * from pg_replication_slots;
-[ RECORD 1 ]+-----------
slot_name | standby1
plugin |
slot_type | physical
datoid |
database |
active | t
xmin |
catalog_xmin |
restart_lsn | 0/270000EC
44
§ Create slot for archiving:
SELECT * FROM
pg_create_physical_replication_slot('archiver1');
§ Create archive directory
mkdir /var/lib/pgsql/9.4/archive
§ Start archiving process in background
/usr/pgsql-9.4/bin/pg_receivexlog -h 127.0.0.1 -p
5432 -U replication –s 'archiver1' -n -v -D
/var/lib/pgsql/9.4/archive
§ Put under init.d for continuous run
§ Switch xlog : primary_db_sever# select
pg_switch_xlog();
45
§ Monitor Disk space
§ Monitor slave lag
select pg_xlog_location_diff(sent_location, write_location) AS
byte_lag
from pg_stat_replication
where application_name='pg_receivexlog';
§ Monitor WAL archive process
select pg_xlog_location_diff(sent_location, write_location) AS
byte_lag
from pg_stat_replication
where application_name='walreceiver';
46
} Number of pg_xlogs on master
} Monitor pg_recievexlog process
} Make sure archive location has new files
} pg_basebackup log files for successful backup…
look for “pg_basebackup: base backup
completed”
47
§ Conference committee
§ Peter Eisentraut
§ You!!
48
} http://www.medallia.com/careers/
} http://www.medallia.com/open-positions/
◦ Ops Engineers
◦ Automation Engineers
◦ Manager Engineering
◦ SRE
◦ Many more …
50
Denish.j.patel@gmail.com or dpatel@medallia.com
Twitter: DenishPatel
49
} Stay in touch with Postgres users around the
world
} 300+ members!
} Join today : https://postgres-
slack.herokuapp.com/
52

More Related Content

What's hot

Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogicalUmair Shahid
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...PostgreSQL-Consulting
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitRedis Labs
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on awsEmanuel Calvo
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Alexey Lesovsky
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с дискомPostgreSQL-Consulting
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalabilitydidip
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)Wei Shan Ang
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationAlexey Lesovsky
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Grant McAlister
 
PostgreSQL Write-Ahead Log (Heikki Linnakangas)
PostgreSQL Write-Ahead Log (Heikki Linnakangas) PostgreSQL Write-Ahead Log (Heikki Linnakangas)
PostgreSQL Write-Ahead Log (Heikki Linnakangas) Ontico
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?Mydbops
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniZalando Technology
 
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...Equnix Business Solutions
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper lookJignesh Shah
 
GOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLGOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLHenning Jacobs
 
collectd & PostgreSQL
collectd & PostgreSQLcollectd & PostgreSQL
collectd & PostgreSQLMark Wong
 
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, Heroku
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, HerokuPostgres & Redis Sitting in a Tree- Rimas Silkaitis, Heroku
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, HerokuRedis Labs
 

What's hot (19)

Logical replication with pglogical
Logical replication with pglogicalLogical replication with pglogical
Logical replication with pglogical
 
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
Ilya Kosmodemiansky - An ultimate guide to upgrading your PostgreSQL installa...
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbit
 
Pgbr 2013 postgres on aws
Pgbr 2013   postgres on awsPgbr 2013   postgres on aws
Pgbr 2013 postgres on aws
 
Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.Deep dive into PostgreSQL statistics.
Deep dive into PostgreSQL statistics.
 
Как PostgreSQL работает с диском
Как PostgreSQL работает с дискомКак PostgreSQL работает с диском
Как PostgreSQL работает с диском
 
Feed Burner Scalability
Feed Burner ScalabilityFeed Burner Scalability
Feed Burner Scalability
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
 
Troubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming ReplicationTroubleshooting PostgreSQL Streaming Replication
Troubleshooting PostgreSQL Streaming Replication
 
Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016 Amazon RDS for PostgreSQL - PGConf 2016
Amazon RDS for PostgreSQL - PGConf 2016
 
PostgreSQL Write-Ahead Log (Heikki Linnakangas)
PostgreSQL Write-Ahead Log (Heikki Linnakangas) PostgreSQL Write-Ahead Log (Heikki Linnakangas)
PostgreSQL Write-Ahead Log (Heikki Linnakangas)
 
What is new in PostgreSQL 14?
What is new in PostgreSQL 14?What is new in PostgreSQL 14?
What is new in PostgreSQL 14?
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Shootout at the PAAS Corral
Shootout at the PAAS CorralShootout at the PAAS Corral
Shootout at the PAAS Corral
 
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
PGConf.ASIA 2019 Bali - Building PostgreSQL as a Service with Kubernetes - Ta...
 
PostgreSQL Extensions: A deeper look
PostgreSQL Extensions:  A deeper lookPostgreSQL Extensions:  A deeper look
PostgreSQL Extensions: A deeper look
 
GOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQLGOTO 2013: Why Zalando trusts in PostgreSQL
GOTO 2013: Why Zalando trusts in PostgreSQL
 
collectd & PostgreSQL
collectd & PostgreSQLcollectd & PostgreSQL
collectd & PostgreSQL
 
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, Heroku
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, HerokuPostgres & Redis Sitting in a Tree- Rimas Silkaitis, Heroku
Postgres & Redis Sitting in a Tree- Rimas Silkaitis, Heroku
 

Viewers also liked

Keith Fiske - When PostgreSQL Can't, You Can @ Postgres Open
Keith Fiske - When PostgreSQL Can't, You Can @ Postgres OpenKeith Fiske - When PostgreSQL Can't, You Can @ Postgres Open
Keith Fiske - When PostgreSQL Can't, You Can @ Postgres OpenPostgresOpen
 
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres OpenKevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres OpenPostgresOpen
 
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres OpenDavid Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres OpenPostgresOpen
 
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...PostgresOpen
 
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013Ryan Jarvinen Open Shift Talk @ Postgres Open 2013
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013PostgresOpen
 
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres Open
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres OpenBruce Momjian - Inside PostgreSQL Shared Memory @ Postgres Open
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres OpenPostgresOpen
 
Keith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres OpenKeith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres OpenPostgresOpen
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...PostgresOpen
 
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...PostgresOpen
 
Islamabad PUG - 7th Meetup - performance tuning
Islamabad PUG - 7th Meetup - performance tuningIslamabad PUG - 7th Meetup - performance tuning
Islamabad PUG - 7th Meetup - performance tuningUmair Shahid
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningUmair Shahid
 
Robert Haas Query Planning Gone Wrong Presentation @ Postgres Open
Robert Haas Query Planning Gone Wrong Presentation @ Postgres OpenRobert Haas Query Planning Gone Wrong Presentation @ Postgres Open
Robert Haas Query Planning Gone Wrong Presentation @ Postgres OpenPostgresOpen
 
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenSteve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenPostgresOpen
 
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenPostgresOpen
 
PoPostgreSQL Web Projects: From Start to FinishStart To Finish
PoPostgreSQL Web Projects: From Start to FinishStart To FinishPoPostgreSQL Web Projects: From Start to FinishStart To Finish
PoPostgreSQL Web Projects: From Start to FinishStart To Finishelliando dias
 
Koichi Suzuki - Postgres-XC Dynamic Cluster Management @ Postgres Open
Koichi Suzuki - Postgres-XC Dynamic Cluster  Management @ Postgres OpenKoichi Suzuki - Postgres-XC Dynamic Cluster  Management @ Postgres Open
Koichi Suzuki - Postgres-XC Dynamic Cluster Management @ Postgres OpenPostgresOpen
 
Gbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfsGbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfsGiuseppe Broccolo
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HAharoonm
 
Michael Paquier - Taking advantage of custom bgworkers @ Postgres Open
Michael Paquier - Taking advantage of custom bgworkers @ Postgres OpenMichael Paquier - Taking advantage of custom bgworkers @ Postgres Open
Michael Paquier - Taking advantage of custom bgworkers @ Postgres OpenPostgresOpen
 

Viewers also liked (20)

Keith Fiske - When PostgreSQL Can't, You Can @ Postgres Open
Keith Fiske - When PostgreSQL Can't, You Can @ Postgres OpenKeith Fiske - When PostgreSQL Can't, You Can @ Postgres Open
Keith Fiske - When PostgreSQL Can't, You Can @ Postgres Open
 
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres OpenKevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres Open
Kevin Kempter - PostgreSQL Backup and Recovery Methods @ Postgres Open
 
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres OpenDavid Keeney - SQL Database Server Requests from the Browser @ Postgres Open
David Keeney - SQL Database Server Requests from the Browser @ Postgres Open
 
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...
Gurjeet Singh - How Postgres is Different From (Better Tha) Your RDBMS @ Post...
 
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013Ryan Jarvinen Open Shift Talk @ Postgres Open 2013
Ryan Jarvinen Open Shift Talk @ Postgres Open 2013
 
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres Open
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres OpenBruce Momjian - Inside PostgreSQL Shared Memory @ Postgres Open
Bruce Momjian - Inside PostgreSQL Shared Memory @ Postgres Open
 
Keith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres OpenKeith Paskett - Postgres on ZFS @ Postgres Open
Keith Paskett - Postgres on ZFS @ Postgres Open
 
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...Selena Deckelmann - Sane Schema Management with  Alembic and SQLAlchemy @ Pos...
Selena Deckelmann - Sane Schema Management with Alembic and SQLAlchemy @ Pos...
 
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...
Henrietta Dombrovskaya - A New Approach to Resolve Object-Relational Impedanc...
 
Islamabad PUG - 7th Meetup - performance tuning
Islamabad PUG - 7th Meetup - performance tuningIslamabad PUG - 7th Meetup - performance tuning
Islamabad PUG - 7th Meetup - performance tuning
 
Islamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuningIslamabad PUG - 7th meetup - performance tuning
Islamabad PUG - 7th meetup - performance tuning
 
Robert Haas Query Planning Gone Wrong Presentation @ Postgres Open
Robert Haas Query Planning Gone Wrong Presentation @ Postgres OpenRobert Haas Query Planning Gone Wrong Presentation @ Postgres Open
Robert Haas Query Planning Gone Wrong Presentation @ Postgres Open
 
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenSteve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
 
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
 
PoPostgreSQL Web Projects: From Start to FinishStart To Finish
PoPostgreSQL Web Projects: From Start to FinishStart To FinishPoPostgreSQL Web Projects: From Start to FinishStart To Finish
PoPostgreSQL Web Projects: From Start to FinishStart To Finish
 
Koichi Suzuki - Postgres-XC Dynamic Cluster Management @ Postgres Open
Koichi Suzuki - Postgres-XC Dynamic Cluster  Management @ Postgres OpenKoichi Suzuki - Postgres-XC Dynamic Cluster  Management @ Postgres Open
Koichi Suzuki - Postgres-XC Dynamic Cluster Management @ Postgres Open
 
Gbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfsGbroccolo pgconfeu2016 pgnfs
Gbroccolo pgconfeu2016 pgnfs
 
PostgreSQL HA
PostgreSQL   HAPostgreSQL   HA
PostgreSQL HA
 
Michael Paquier - Taking advantage of custom bgworkers @ Postgres Open
Michael Paquier - Taking advantage of custom bgworkers @ Postgres OpenMichael Paquier - Taking advantage of custom bgworkers @ Postgres Open
Michael Paquier - Taking advantage of custom bgworkers @ Postgres Open
 
Geometria Projetiva
Geometria ProjetivaGeometria Projetiva
Geometria Projetiva
 

Similar to Out of the box replication in postgres 9.4(pg confus)

Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Denish Patel
 
Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Denish Patel
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOpsОмские ИТ-субботники
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practiceAlexey Lesovsky
 
configuring a warm standby, the easy way
configuring a warm standby, the easy wayconfiguring a warm standby, the easy way
configuring a warm standby, the easy wayCommand Prompt., Inc
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpen Gurukul
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Command Prompt., Inc
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016StackIQ
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newYiwei Ma
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with PuppetKris Buytaert
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_pptmaclean liu
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXNGINX, Inc.
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsCommand Prompt., Inc
 
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...Puppet
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackIQ
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINXKevin Jones
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam
 

Similar to Out of the box replication in postgres 9.4(pg confus) (20)

Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)
 
Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)Out of the Box Replication in Postgres 9.4(PgCon)
Out of the Box Replication in Postgres 9.4(PgCon)
 
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
2017-03-11 02 Денис Нелюбин. Docker & Ansible - лучшие друзья DevOps
 
Streaming replication in practice
Streaming replication in practiceStreaming replication in practice
Streaming replication in practice
 
configuring a warm standby, the easy way
configuring a warm standby, the easy wayconfiguring a warm standby, the easy way
configuring a warm standby, the easy way
 
OpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQLOpenGurukul : Database : PostgreSQL
OpenGurukul : Database : PostgreSQL
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
 
Pitr Made Easy
Pitr Made EasyPitr Made Easy
Pitr Made Easy
 
Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016Salesforce at Stacki Atlanta Meetup February 2016
Salesforce at Stacki Atlanta Meetup February 2016
 
X64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 newX64服务器 lnmp服务器部署标准 new
X64服务器 lnmp服务器部署标准 new
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
2011 384 hackworth_ppt
2011 384 hackworth_ppt2011 384 hackworth_ppt
2011 384 hackworth_ppt
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
PostgreSQL Administration for System Administrators
PostgreSQL Administration for System AdministratorsPostgreSQL Administration for System Administrators
PostgreSQL Administration for System Administrators
 
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...
PuppetConf 2016: An Introduction to Measuring and Tuning PE Performance – Cha...
 
Stacki - The1600+ Server Journey
Stacki - The1600+ Server JourneyStacki - The1600+ Server Journey
Stacki - The1600+ Server Journey
 
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
StackiFest16: Stacki 1600+ Server Journey - Dave Peterson, Salesforce
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRestPGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
 

More from Denish Patel

Out of the Box Replication in Postgres 9.4(PgConfUS)
Out of the Box Replication in Postgres 9.4(PgConfUS)Out of the Box Replication in Postgres 9.4(PgConfUS)
Out of the Box Replication in Postgres 9.4(PgConfUS)Denish Patel
 
Postgres in Amazon RDS
Postgres in Amazon RDSPostgres in Amazon RDS
Postgres in Amazon RDSDenish Patel
 
Choosing the "D" , Lightning talk
Choosing the "D" , Lightning talkChoosing the "D" , Lightning talk
Choosing the "D" , Lightning talkDenish Patel
 
Two Elephants Inthe Room
Two Elephants Inthe RoomTwo Elephants Inthe Room
Two Elephants Inthe RoomDenish Patel
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDenish Patel
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDenish Patel
 
P90 X Your Database!!
P90 X Your Database!!P90 X Your Database!!
P90 X Your Database!!Denish Patel
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci CompliaceDenish Patel
 
Using SQL Standards? Database SQL comparition
Using SQL Standards? Database SQL comparitionUsing SQL Standards? Database SQL comparition
Using SQL Standards? Database SQL comparitionDenish Patel
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features IDenish Patel
 
Yet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRepYet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRepDenish Patel
 

More from Denish Patel (12)

Out of the Box Replication in Postgres 9.4(PgConfUS)
Out of the Box Replication in Postgres 9.4(PgConfUS)Out of the Box Replication in Postgres 9.4(PgConfUS)
Out of the Box Replication in Postgres 9.4(PgConfUS)
 
Postgres in Amazon RDS
Postgres in Amazon RDSPostgres in Amazon RDS
Postgres in Amazon RDS
 
Choosing the "D" , Lightning talk
Choosing the "D" , Lightning talkChoosing the "D" , Lightning talk
Choosing the "D" , Lightning talk
 
Scaling postgres
Scaling postgresScaling postgres
Scaling postgres
 
Two Elephants Inthe Room
Two Elephants Inthe RoomTwo Elephants Inthe Room
Two Elephants Inthe Room
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQL
 
Deploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQLDeploying Maximum HA Architecture With PostgreSQL
Deploying Maximum HA Architecture With PostgreSQL
 
P90 X Your Database!!
P90 X Your Database!!P90 X Your Database!!
P90 X Your Database!!
 
Achieving Pci Compliace
Achieving Pci CompliaceAchieving Pci Compliace
Achieving Pci Compliace
 
Using SQL Standards? Database SQL comparition
Using SQL Standards? Database SQL comparitionUsing SQL Standards? Database SQL comparition
Using SQL Standards? Database SQL comparition
 
Oracle10g New Features I
Oracle10g New Features IOracle10g New Features I
Oracle10g New Features I
 
Yet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRepYet Another Replication Tool: RubyRep
Yet Another Replication Tool: RubyRep
 

Recently uploaded

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyAnusha Are
 

Recently uploaded (20)

Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 

Out of the box replication in postgres 9.4(pg confus)

  • 2. } Sr. Database Architect @ Medallia } Previously: ◦ DB Engineer@ WithMe ◦ Lead Database Architect @ OmniTI } Expertise in PostgreSQL , Oracle, MySQL, NoSQL } Contact : denish.j.patel@gmail.com or dpatel@medallia.com } Twitter: @DenishPatel } Blog: http://www.pateldenish.com } Postgres Slack Channel (https://postgres- slack.herokuapp.com/) 1
  • 3. § What is WAL? § Postgres Replication History § How you setup replication now? § What’s missing ? § Why replication slots? § Demo I’m NOT going to discuss … § SLONY or other 3rd party replication tools § 3rd party replication management tools 2
  • 4. } Roll-forward recovery aka REDO } flushed to disk to guarantee commit durability } sequential writes } lower cost than flushing page cache } Allows us to do cool things – Crash recovery – Binary backups – Point-In Time Recovery – Replication 3
  • 5. } Automatically enabled; no action required } Make sure to have enough space on server } Stored under pg_xlog directory } Normally, 16MB in size ü--with-wal-segsize config option at build } Each segment is divided into pages (8 kB page) ü--with-wal-blocksize config option at build ◦ Segment name starts with.. 000000010000000000000000 4
  • 6. select * from pg_settings where name='wal_level'; name | wal_level setting | hot_standby unit | category | Write-Ahead Log / Settings short_desc | Set the level of information written to the WAL. extra_desc | context | postmaster vartype | enum source | configuration file min_val | max_val | enumvals | { minimal, archive, hot_standby, logical } boot_val | minimal reset_val | hot_standby sourcefile | /var/lib/pgsql/9.4/data/postgresql.auto.conf sourceline | 4 5
  • 7. Almost everything is replicated, but... § unlogged tables (As name suggests) § temporary tables § hash indexes? (generally don’t use?) 6
  • 8. Postgres 7.0: WAL Postgres 8.0: PITR (Point-In-Time-Recovery) Postgres 8.2: pg_standby Postgres 9.0: Hot_standby, Streaming replication Postgres 9.1: pg_basebackup, Synchronous replication Postgres 9.2: Cascading Replication Postgres 9.3: Standby can switch timeline to follow new master Postgres 9.4: Replication Slots , Logical decoding 7
  • 11. #TYPE DATABASE USER ADDRESS METHOD host replication replication 10.0.0.1/32 md5 10
  • 13. CREATE ROLE replication WITH LOGIN REPLICATION; password replication 12
  • 14. § Take file system level backups § What tools you are using for backups? 13
  • 15. primary_conninfo = 'host=primaryhost user=replication password=replication' standby_mode = on 14
  • 17. Have you configured archiving? 16
  • 19. § postgresql.conf archive_mode = on archive_command = 'cp %p /some/where/%f' 18
  • 20. § recovery.conf restore_command = 'cp /some/where/%f %p' 19
  • 21. § local or remote copy § Scp § Rsync § NFS § pg_archivecleanup 20
  • 22. archive_command = 'rsync %p standby1::pg/%f && rsync %p standby2::pg/%f' archive_command = 'echo standby1 standby2 ... | xargs -d" " -I{} -n1 -P0 -r rsync %p {}::pg/%f' 21
  • 23. § OmniPITR § WAL-E § Repmgr § Pgbarman § Skytools § A lot of Custom scripts 22
  • 24. § fsync capabilities § cp: no § dd: GNU coreutils § SSH: OpenSSH 6.5 sftp-server (Jan 2014) § rsync: patch or wrapper § NFS: Supported 23
  • 25. 24
  • 28. select * from pg_replication_slots ; slot_name |plugin |slot_type |datoid|database|active|xmin|catalog_xmin|restart_lsn ------------+--------+-----------+--------+---- ------+--------+------+--------------+--- standby1 | | physical | | | t | | |0/21000058 standby2 | | physical | | | t | | |0/21000058 standby3 | | physical | | | t | | |0/21000058 27
  • 30. § Keep necessary WAL files § Each standby can have different WAL apply status § Single access control setup § fsync on receiving side 29
  • 31. pg_basebackup -h primaryhost -U replication -D $PGDATA -X stream –P –v -R 30
  • 32. § Meet pg_receivexlog § (Available since Postgers 9.1!) pg_receivexlog -D archivedir --slot archivingslot -h primaryhost -U replication § -- synchronous option in 9.5 31
  • 33. Are you ready to setup replication without any external tools? 1. pg_basebackup 2. streaming with Replication Slots 3. pg_receivexlog 32
  • 34. § Google Drive: § Login: pgtraining/pgcon § pgtraining user has sudo access § You can access terminal on the desktop § Internet should be working within VM § Copy/paste should work between VM and Host § Take snapshot along the process so you can rollback easily 33
  • 35. § Remove Postgres 8.4 version sudo yum erase postgresql.* § Setup yum repo for your desired version sudo yum install http://yum.postgresql.org/9.4/redhat/rhel- 6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm § Install PostgreSQL 9.4 & Contrib modules sudo yum install postgresql94-server postgresql94-contrib § Create postgres cluster & initial automatic startup sudo service postgresql-9.4 initdb sudo chkconfig postgresql-9.4 on sudo service postgresql-9.4 start 34
  • 36. § Become postgres system user sudo su - postgres § Log into database using psql (? to see all available commands) § Create a role & database for yourself CREATE ROLE pgtraining WITH LOGIN SUPERUSER; CREATE DATABASE pgtraining; § You can login as pgtraining user (psql –U pgtraining –d pgtraining) § Create replication role for later CREATE ROLE replication WITH LOGIN REPLICATION; § Set password (”replication”) password replication 35
  • 37. § http://www.postgresql.org/docs/9.4/static/auth- pg-hba-conf.html § Find location of hba_file postgres=# show hba_file; § Add following entry for replication user § Try to avoid trust authentication § [pgtraining@localhost ~]$ sudo vi /var/lib/pgsql/9.4/data/pg_hba.conf host replication replication 127.0.0.1/32 md5 36
  • 38. alter system set wal_level = hot_standby; alter system set archive_mode=on; alter system set max_replication_slots=8; alter system set archive_timeout = 60; alter system set max_wal_senders = 8; alter system set wal_keep_segments=100; alter system set logging_collector=on; 37
  • 39. § Restart database sudo service postgresql-9.4 restart § Verify settings psql=# show max_wal_senders; 38
  • 40. SELECT * FROM pg_create_physical_replication_slot('standby1'); 39
  • 41. sudo su - postgres pg_basebackup -h 127.0.0.1 -U replication -D /var/lib/pgsql/9.4/slave -R -Xs -P -v 40
  • 42. cd /var/lib/pgsql/9.4/slave § Edit Standby postgresql.conf file port = 5433 hot_standby = on § Edit Standby recovery.conf file standby_mode = 'on' primary_conninfo = 'user=replication password=replication host=127.0.0.1 port=5432' primary_slot_name='standby1' trigger_file = '/var/lib/pgsql/9.4/slave/finish.recovery' recovery_target_timeline='latest' 41
  • 43. § Copy existing init file sudo cp /etc/init.d/postgresql-9.4 /etc/init.d/postgresql-9.4- 5433 § Edit config file to change (as root): PGDATA=/var/lib/pgsql/9.4/slave PGLOG=/var/lib/pgsql/9.4/pgstartup-5433.log PGUPLOG=/var/lib/pgsql/$PGMAJORVERSION/pgupgrade- 5433.log § Register service, start up slave sudo chkconfig postgresql-9.4-5433 on sudo service postgresql-9.4-5433 start 42
  • 44. pgtraining=# select * from pg_stat_replication; -[ RECORD 1 ]----+------------------------------ pid | 3260 usesysid | 24576 usename | replication application_name | walreceiver client_addr | 127.0.0.1 client_hostname | client_port | 53206 backend_start | 2015-06-08 14:47:50.057326-04 backend_xmin | state | streaming sent_location | 0/240000B8 write_location | 0/240000B8 flush_location | 0/240000B8 replay_location | 0/240000B8 sync_priority | 0 sync_state | async 43
  • 45. pgtraining=# select * from pg_replication_slots; -[ RECORD 1 ]+----------- slot_name | standby1 plugin | slot_type | physical datoid | database | active | t xmin | catalog_xmin | restart_lsn | 0/270000EC 44
  • 46. § Create slot for archiving: SELECT * FROM pg_create_physical_replication_slot('archiver1'); § Create archive directory mkdir /var/lib/pgsql/9.4/archive § Start archiving process in background /usr/pgsql-9.4/bin/pg_receivexlog -h 127.0.0.1 -p 5432 -U replication –s 'archiver1' -n -v -D /var/lib/pgsql/9.4/archive § Put under init.d for continuous run § Switch xlog : primary_db_sever# select pg_switch_xlog(); 45
  • 47. § Monitor Disk space § Monitor slave lag select pg_xlog_location_diff(sent_location, write_location) AS byte_lag from pg_stat_replication where application_name='pg_receivexlog'; § Monitor WAL archive process select pg_xlog_location_diff(sent_location, write_location) AS byte_lag from pg_stat_replication where application_name='walreceiver'; 46
  • 48. } Number of pg_xlogs on master } Monitor pg_recievexlog process } Make sure archive location has new files } pg_basebackup log files for successful backup… look for “pg_basebackup: base backup completed” 47
  • 49. § Conference committee § Peter Eisentraut § You!! 48
  • 50. } http://www.medallia.com/careers/ } http://www.medallia.com/open-positions/ ◦ Ops Engineers ◦ Automation Engineers ◦ Manager Engineering ◦ SRE ◦ Many more … 50
  • 52. } Stay in touch with Postgres users around the world } 300+ members! } Join today : https://postgres- slack.herokuapp.com/ 52