Postgres Administration for Sysadmins Spencer Christensen Backcountry.com PostgreSQL Conference East, Philadelphia March 26, 2010.

Slides:



Advertisements
Similar presentations
Refeng Wu CQ5 WCM System Administrator
Advertisements

2 Copyright © 2005, Oracle. All rights reserved. Installing the Oracle Database Software.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Oracle High Availability Solutions RAC and Standby Database Copyright System Managers LLC 2008.
1 Dynamic DNS. 2 Module - Dynamic DNS ♦ Overview The domain names and IP addresses of hosts and the devices may change for many reasons. This module focuses.
Security Pertemuan 7 Matakuliah: T0413 Tahun: 2009.
Chapter 9 Auditing Database Activities
A complete web app using flex. You can use the flex builder to generate the php (server side) code for a flex-php application. As before, Php connects.
APNEE-TU DATABASES Instalation Problems Solutions.
MCITP Guide to Microsoft Windows Server 2008 Server Administration (Exam #70-646) Chapter 14 Server and Network Monitoring.
1 Chapter Overview Introduction to Windows XP Professional Printing Setting Up Network Printers Connecting to Network Printers Configuring Network Printers.
VMware vCenter Server Module 4.
Event Viewer Was of getting to event viewer Go to –Start –Control Panel, –Administrative Tools –Event Viewer Go to –Start.
PostGres SQL Presented by : Chandan, Markandey Amit, Kiran Harshada, Prachi.
Linux Operations and Administration
Linux Filesystem Management
1 Introduction to PostgreSQL. 2 Documents PostgreSQL 8 for Windows (*) Beginning Databases with PostgreSQL From Novice to Professional, Second Edition.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.

Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
5 Copyright © 2008, Oracle. All rights reserved. Configuring the Oracle Network Environment.
Administering your PostgreSQL Geodatabase
Introduction to SQL Server 2000 Security Dave Watts CTO, Fig Leaf Software
Finding and Reporting Postgres Bug #8291 BY: LLOYD ALBIN 8/6/2013.
Session 10 Windows Platform Eng. Dina Alkhoudari.
11 Copyright © 2005, Oracle. All rights reserved. Configuring the Oracle Network Environment.
© Continuent 2010 Building Tungsten Clusters with PostgreSQL Hot Standby and Streaming Replication Linas Virbalas and Alex Alexander Continuent, Inc.
An introduction to SQL 1/21/2014 – See chapter 2.3 and 6.1 PostgreSQL -
Peter Keller Computer Sciences Department University of Wisconsin-Madison Quill Tutorial Condor Week.
Module 5 BIND Configuration. named.conf – controls operational features Located - Linux: /etc/named.conf /etc/bind/named.conf Located- BSD: /usr/local/etc/named.conf.
Administration and Monitoring the Database Oracle 10g.
Tools Menu and Other Concepts Alerts Event Log SLA Management Search Address Space Search Syslog Download NetIIS Standalone Application.
Administering Your PostgreSQL Geodatabase
Database weekly reports Zbigniew Baranowski Carlos Fernando Gamboa.
1 Chapter Overview Performing Configuration Tasks Setting Up Additional Features Performing Maintenance Tasks.
Internet Information Server Name : Yao Gu Date : 10-June-2000 COSC : 573.
A Brief Documentation.  Provides basic information about connection, server, and client.
Windows PostgreSQL installation. Pre-requisites Define a local non-administrative Windows account (eg. postgres) Must install on Console, not through.
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 9 Auditing Database Activities.
Todd Tannenbaum Computer Sciences Department University of Wisconsin-Madison Quill / Quill++ Tutorial.
PostgreSQL Installation By: Keerthi Nelaturu Previous version by Ahmed Jeddah & Miguel Garzon.
1 Chapter Overview Planning to Install SQL Server 2000 Deciding SQL Server 2000 Setup Configuration Options Running the SQL Server 2000 Setup Program Using.
1 AHM -2-4 Sept 2003 e-Science Centre Running SRB Ananta Manandhar.
High Availability in DB2 Nishant Sinha
DATA BASE ADMINISTRING DATABASE SERVICES IN RED HAT LINUX.
Greg Thain Computer Sciences Department University of Wisconsin-Madison Configuring Quill Condor Week.
Linux Operations and Administration
Don’t Duck Metadata March 2005 Introducing Setting Up a Clearinghouse Node Topic: Introduction to Setting Up a Clearinghouse Node Objective: By.
What is PostgreSQL? Object-relational database management system (ORDBMS) Based on POSTGRES at Berkeley Computer Science Department. Sponsored by the Defense.
Introduction to Teradata Client Tools. 2 Introduction to Teradata SQL  OBJECTIVES :  Teradata Product Components.  Accessing Teradata – Database /
Intro To Oracle :part 1 1.Save your Memory Usage & Performance. 2.Oracle Login ways. 3.Adding Database to DB Trees. 4.How to Create your own user(schema).
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
© 2011 Noblis, Inc. Identifying Slow Queries, and Fixing Them Presented to: PostgresOpen 2011, Chicago Date: September 15th, 2011.
The GUCS: A Three-Hour Tour. What are GUCS? # “Grand Unified Configuration Settings” – A large set of global and session database settings which live.
The GUCS: A Three-Hour Tour. What are GUCS? # “Grand Unified Configuration Settings” – A large set of global and session database settings which live.
Copyright 2009 EnterpriseDB Corporation. All rights Reserved. Slide: 1 PostgreSQL 9.0 Streaming Replication under the hood Heikki Linnakangas.
New flavors of pg_top Michael Paquier Tokyo 2013/07/13
Postgres and LDAP By Lloyd Albin Postgres and LDAP 10/4/2016.
Cassandra Tools and Config Files
Using SQL Server through Command Prompt
Introduction to SQL Server 2000 Security
1z0-320 Exam dumps - Get 1z0-320 PDF With Actual Questions Answers
PostgreSQL Database and C++ Interface (and Midterm Topics)
Download Exam - Valid Question Answers - Dumps4download.us
Configuration Of A Pull Network.
WHAT IS WINDOWS MULTIPOINT SERVER 2012?
Web Manager Features Diagram
Linux Filesystem Management
Designing IIS Security (IIS – Internet Information Service)
Setting up PostgreSQL for Production in AWS
Presentation transcript:

Postgres Administration for Sysadmins Spencer Christensen Backcountry.com PostgreSQL Conference East, Philadelphia March 26, 2010

PostgreSQL How do you pronounce “PostgreSQL”? The Q and L are silent

How do you pronounce Thule? “Yakima”

Audience Linux/Unix system administrator Familiar with databases Want to understand Postgres better

What we'll cover Management Monitoring

What we'll cover Management Creating a cluster Highlights of postgresql.conf Logging options, review of log output pg_hba.conf Starting, stopping, restarts Connecting with psql

What we'll cover Monitoring top ps du pgtop pg_top check_postgres.pl Pgfouine

Management Install by rpm/deb/source Multiple installs Multiple instances (different ports, different ip addresses, etc)

Creating a cluster Initdb -D /path/to/data/dir [options] -U postgres ~]$ initdb -U postgres -D cluster1/data The files belonging to this database system will be owned by user "schristensen". This user must also own the server process. The database cluster will be initialized with locale en_US.UTF-8. The default database encoding has accordingly been set to UTF8. The default text search configuration will be set to "english".

Postgresql.conf Located at $PGDATA/postgresql.conf Helpful comments Default values commented out Some changes require a restart (others can be picked up with a reload)

Postgresql.conf port = 5432 listen_addresses = 'localhost' max_connections = 10 statement_timeout = 0 # microseconds

Postgresql.conf port = 5432 port = listen_addresses = 'localhost' listen_addresses = '*' max_connections = 10 max_connections = 100 statement_timeout = 0 # microseconds statement_timeout =

pg_ctl pg_ctl -D /path/to/data/dir \ -l /path/to/logfile [start|stop|reload|restart|status] Run as owner of data files (created by initdb) -m [smart|fast|immediate] stop Start cluster1

Logging options log_destination = 'stderr' # or syslog log_directory = 'pg_log' syslog_facility = 'LOCAL0' log_connections = off log_disconnections = off log_duration = off log_statement = 'none' # or all, ddl, mod

Log output samples LOG: connection received: host= port=44738 LOG: connection authorized: user=training database=training LOG: duration: ms LOG: duration: ms LOG: duration: ms LOG: duration: ms LOG: disconnection: session time: 0:00: user=training database=training host= port=44738

Log output samples LOG: connection received: host= port=33185 LOG: duration: ms LOG: connection authorized: user=training database=training LOG: statement: select * from emusic.sales_item LOG: duration: ms LOG: statement: select * from emusic.stores LOG: duration: ms LOG: disconnection: session time: 0:00: user=training database=training host= port=33185

pg_hba.conf HOST DATABASE USER CIDR-ADDRESS METHOD [OPTION] local all pgmonitor trust host all all /32 md5 host all all /24 md5 Need to reload to take effect H

Postgres Env vars $PGDATA – data directory $PGPORT – port $PGHOST – host $PGUSER – user pg_ctl -l /tmp/pg.log start psql

psql [-h $host] [-p $port] [-U $user] $db \d – list tables, views, sequences \dt – list tables only \d my_awesome_table – describe table, view \q – exit out of psql \l – list databases in cluster \du – list users in cluster \h – help

Monitoring

top Example of running queries

Du Example of disk space usage

Pgtop Based on mytop Example of running pgtop

pg_top More like system top Can view running queries, locks, EXPLAIN Example of running pg_top

check_postgres.pl Disk space Backends Index size Table size Bloat Last vacuum Locks txn_wraparound

Pgfouine Log files Connections, disconnections, durations, statements Vacuum verbose output Example

Wrap up Initdb, postgresql.conf, pg_hba.conf pg_ctl -D $datadir start|stop|reload|status psql Top, du pg_top, pgtop check_postgres.pl Pgfouine

Me Spencer Christensen Backcountry.com