SlideShare a Scribd company logo
PostgreSQL Atölyesi
Erkin Çakar
erk.cakar@gmail.com
Hackerspace – 09.2013
3. oturum
2
Ajanda
● PostgreSQL'de WAL kavramı
● PostgreSQL streaming replication
● Point-In-Time Recovery (PITR)
● PgBouncer ile bağlantı havuzlama
● Yedekleme/Geri yükleme
● PostgreSQL'in dahili tabloları
3
PostgreSQL'de WAL Kavramı
4
PostgreSQL Streaming Replication
● postgresql.conf (master)
wal_level = hot_standby
max_wal_senders > 0
archive_mode = on
archive_command = 'cp %p /data/wal_archive/%f'
● pg_hba.conf (master)
host replication repuser 192.168.1.20/32 trust
● postgresql.conf (slave)
hot_standby = on
● recovery.conf (slave)
standby_mode = 'on'
primary_conninfo = 'host=192.168.1.21 port=5432 user=repuser'
trigger_file = '/tmp/trigger.file'
restore_command = 'cp -i /data/wal_archive/%f %p '
5
Point-In-Time Recovery (PITR)
● rm -rf /var/lib/pgsql/9.2/data/pg_xlog
● cp 0000000C0000000000000* /data/wal_recovery/
● recovery.conf
restore_command = 'cp -i /data/wal_recovery/%f %p'
recovery_target_time = '2013-09-18 18:55:33'
● Tavsiye Araç: pgBarman
6
PgBouncer
● /etc/pgbouncer/pgbouncer.ini
[databases]
hackerspc = host=127.0.0.1 port=5432 user=basri dbname=hackerspace
● /etc/pgbouncer/userlist.txt
“basri” “basri123”
7
Yedekleme/Geri Yükleme
pg_dump -U postgres hackerspace -F c -f /backups/hackerspace20130920.dump
pg_restore -U postgres -d hackerspace -j 4 /backups/hackerspace20130920.dump
pg_basebackup -D /var/lib/pgsql/9.3/data -P -Ft -x -z -Z9 -c spread -l hackerspace -h
192.168.1.20 -U postgres > /tmp/bckp.log 2>&1
8
PostgreSQL'in Dahili Tabloları
● pg_stat_activity
● pg_stat_bgwriter
● pg_stat_database
● pg_stat_user_tables / indexes
● pg_stat_replication
● pg_statistics / pg_stats
9
Kaynaklar
● http://postgresql.org
9
Kaynaklar
● http://postgresql.org

More Related Content

PDF
TOROS: Python Framework for Recommender System
PDF
Object Storage with Gluster
PDF
Data Consistency Workshop — Oslo Cassandra Users Oct 8, 2013
PDF
Advanced backup methods (Postgres@CERN)
PDF
Redis as a message queue
PPTX
Comets notes
PDF
Devinsampa nginx-scripting
PDF
Managing PostgreSQL with PgCenter
TOROS: Python Framework for Recommender System
Object Storage with Gluster
Data Consistency Workshop — Oslo Cassandra Users Oct 8, 2013
Advanced backup methods (Postgres@CERN)
Redis as a message queue
Comets notes
Devinsampa nginx-scripting
Managing PostgreSQL with PgCenter

What's hot (20)

PDF
Accumulo Summit Keynote 2018
PDF
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
PDF
Caching. api. http 1.1
PDF
tdc2012
PDF
Percona XtraDB 集群安装与配置
ODP
nginx: writing your first module
PDF
Go performance tooling
PDF
Multimaster
PDF
L'odyssée de la log
PDF
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
PPTX
Linux comands for Hadoop
PDF
In-core compression: how to shrink your database size in several times
PDF
RestMQ - HTTP/Redis based Message Queue
PDF
Deep dive into PostgreSQL statistics.
PDF
Subversion To Mercurial
PPTX
Using R on High Performance Computers
PDF
CQL: SQL In Cassandra
PDF
GCE NFS HA
PDF
How to ride a whale
PDF
CQL In Cassandra 1.0 (and beyond)
Accumulo Summit Keynote 2018
Максим Барышиков-«WoT: Geographically distributed cluster of clusters»
Caching. api. http 1.1
tdc2012
Percona XtraDB 集群安装与配置
nginx: writing your first module
Go performance tooling
Multimaster
L'odyssée de la log
Training Slides: Basics 105: Backup, Recovery and Provisioning Within Tungste...
Linux comands for Hadoop
In-core compression: how to shrink your database size in several times
RestMQ - HTTP/Redis based Message Queue
Deep dive into PostgreSQL statistics.
Subversion To Mercurial
Using R on High Performance Computers
CQL: SQL In Cassandra
GCE NFS HA
How to ride a whale
CQL In Cassandra 1.0 (and beyond)

Similar to Hackerspace PostgreSQL Atolyesi - 3 (20)

PDF
Streaming replication in practice
PDF
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
PDF
Out of the box replication in postgres 9.4(pg confus)
PDF
Out of the Box Replication in Postgres 9.4(PgConfUS)
PDF
How to Replicate PostgreSQL Database
PDF
pgpool-II demonstration
PDF
configuring a warm standby, the easy way
PDF
The Magic of Hot Streaming Replication, Bruce Momjian
PDF
Out of the Box Replication in Postgres 9.4(pgconfsf)
PDF
Out of the Box Replication in Postgres 9.4(PgCon)
PDF
Out of the Box Replication in Postgres 9.4(PgCon)
PDF
Out of the box replication in postgres 9.4
PPT
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
ODP
PostgreSQL Replication in 10 Minutes - SCALE
PDF
PostgreSQL Streaming Replication Cheatsheet
PDF
The Essential postgresql.conf
PDF
Pitr Made Easy
PDF
ODP
OpenGurukul : Database : PostgreSQL
PPTX
StreSd332g_ReplADSSAon_aerasd333333.pptx
Streaming replication in practice
PGDay.Amsterdam 2018 - Stefan Fercot - Save your data with pgBackRest
Out of the box replication in postgres 9.4(pg confus)
Out of the Box Replication in Postgres 9.4(PgConfUS)
How to Replicate PostgreSQL Database
pgpool-II demonstration
configuring a warm standby, the easy way
The Magic of Hot Streaming Replication, Bruce Momjian
Out of the Box Replication in Postgres 9.4(pgconfsf)
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
Building tungsten-clusters-with-postgre sql-hot-standby-and-streaming-replica...
PostgreSQL Replication in 10 Minutes - SCALE
PostgreSQL Streaming Replication Cheatsheet
The Essential postgresql.conf
Pitr Made Easy
OpenGurukul : Database : PostgreSQL
StreSd332g_ReplADSSAon_aerasd333333.pptx

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Spectroscopy.pptx food analysis technology
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Advanced IT Governance
PDF
Electronic commerce courselecture one. Pdf
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
Machine learning based COVID-19 study performance prediction
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Empathic Computing: Creating Shared Understanding
Advanced IT Governance
Electronic commerce courselecture one. Pdf
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
Machine learning based COVID-19 study performance prediction
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Modernizing your data center with Dell and AMD
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Advanced methodologies resolving dimensionality complications for autism neur...

Hackerspace PostgreSQL Atolyesi - 3