SlideShare a Scribd company logo
Postgres on OpenStack 
• Dave Page | 18/9/2014 
© 2014 EnterpriseDB Corporation. All rights reserved. 1
Introduction 
• PostgreSQL: 
− Core team member 
− pgAdmin lead developer 
− Web/sysadmin teams 
− PGCAC/PGEU board member 
• EDB: 
− Tools 
− Cloud products 
− Configuration management 
− Packaging/distribution 
− Infrastructure 
© 2014 EnterpriseDB Corporation. All rights reserved. 2
What is OpenStack? 
• Cloud environment, similar to AWS: 
− Private implementations 
− Public implementations – Rackspace, HP Cloud 
• Modular design, offering a choice of services including: 
− Image Service (Glance) 
− Block Storage (Cinder) 
− Compute (Nova) 
− Network (Neutron) 
− Object Storage (Swift) 
© 2014 EnterpriseDB Corporation. All rights reserved. 3
Glance Image Service 
• Store virtual machine images and snapshots 
• Preconfigure an image or snapshot with the desired 
OS/software 
• Share images with members of selected projects (AKA, 
tenants). 
© 2014 EnterpriseDB Corporation. All rights reserved. 4
Cinder Block Storage Service 
• Analogous to Amazon Elastic Block Storage (EBS) 
• Provides block storage devices to virtual machine 
instances 
• Can be provided from one or more service nodes via a 
controller 
• Service nodes may use various storage systems, with 
different properties including: 
− LVM 
− GlusterFS 
− NFS 
− Various SANs 
© 2014 EnterpriseDB Corporation. All rights reserved. 5
Nova Compute Service 
• Analogous to Amazon Elastic Compute Service (EC2) 
• Schedules and runs VM instances 
• Multiple machine flavours with individual RAM, CPU 
and disk requirements 
• Compute node selection is highly configurable: 
− Pluggable scheduler filters 
− Target images to specific hosts 
− Target flavours to specific hosts 
− Target instances to hosts with enough free resources 
© 2014 EnterpriseDB Corporation. All rights reserved. 6
Neutron Networking Service 
• Provides network services to VM instances 
• Attach instances to one or more virtual networks 
• Map floating/public IP addresses to a VM 
• Configure firewall rules for ingress and egress 
© 2014 EnterpriseDB Corporation. All rights reserved. 7
Swift Object Storage 
• Analogous to Amazon Simple Storage Service (S3) 
• Provides highly redundant object storage 
• Suitable for storage and retrieval of whole files 
© 2014 EnterpriseDB Corporation. All rights reserved. 8
Wait, what about Trove? 
• Still in relatively early stages of development 
• Currently seems focused on MySQL/Cassandra 
• No support for clustering or other non-trivial setups 
• API favours psql/pgAdmin operations, not deployment/ 
configuration 
© 2014 EnterpriseDB Corporation. All rights reserved. 9
Well that all sounds pretty cool, 
but what can we do with it? 
© 2014 EnterpriseDB Corporation. All rights reserved. 10
Database Server Images 
© 2014 EnterpriseDB Corporation. All rights reserved. 11
Database server images 
• Preconfigure a “standard” database image 
• Enables consistency, which leads to ease of 
management 
• Preinstall commonly required software: 
− Procedural languages 
− WAL-E 
− pgBouncer/pgPool 
• Minimise launch/deployment time 
© 2014 EnterpriseDB Corporation. All rights reserved. 12
Image or Snapshot? 
• Technically there’s not much difference 
• OCD: I like images to be, well images 
• Images may be considered “blessed” or approved 
• Snapshots are a convenient way to take backups, 
perhaps of work in progress 
• Images are “clean” configurations, whilst snapshots 
may contain artifacts from previous use, e.g. shell 
history or log files. 
© 2014 EnterpriseDB Corporation. All rights reserved. 13
Creating an image 
• Create a small root disk in QCOW2 format 
• Install the base OS on the disk (I use KVM on RHEL) 
• Install the required software 
• Add the EPEL Yum repo, and install cloud-init 
• Disable zeroconf for the network 
• Shutdown the VM 
• Run virt-sysprep to clean the OS installation 
© 2014 EnterpriseDB Corporation. All rights reserved. 14
Uploading the image 
$ glance image-create --name ”PostgreSQL-9.4" --disk-format qcow2  
--container-format bare --is-public True --progress < pg-9.3.img 
+------------------+--------------------------------------+ 
| Property | Value | 
+------------------+--------------------------------------+ 
| checksum | 64d7c1cd2b6f60642c14663941cb7913 | 
| container_format | bare | 
| created_at | 2014-08-29T14:55:08 | 
| deleted | False | 
| deleted_at | None | 
| disk_format | qcow2 | 
| id | acafc7c0-40aa-4026-9673-b879124bcec2 | 
| is_public | True | 
| min_disk | 0 | 
| min_ram | 0 | 
| name | PostgreSQL-9.4 | 
| owner | efa984b0a914450e9a47788ad330699d | 
| protected | False | 
| size | 2013167616 | 
| status | active | 
| updated_at | 2014-08-29T14:55:08 | 
+------------------+--------------------------------------+ 
© 2014 EnterpriseDB Corporation. All rights reserved. 15
Database Server Machine 
Configurations 
© 2014 EnterpriseDB Corporation. All rights reserved. 16
Dedicated database flavours 
• “Flavors” (without the u) describe the instance 
configuration: 
− vCPUs 
− Memory 
− Root disk 
− Ephemeral disk 
− Swap 
− Other attributes 
• Additional attributes allow us to target specific 
hypervisor properties, e.g. 
− Compute nodes with SSDs 
© 2014 EnterpriseDB Corporation. All rights reserved. 17
Targeting a host aggregate 
• Create a host aggregate or group containing the 
desired compute nodes 
• Add a property to the host aggregate to identify the 
desired attribute for matching 
• Create the desired flavour(s) 
• Add a property to the flavour to correspond with the 
property on the host aggregate 
• Share the flavour with one or more tenants 
© 2014 EnterpriseDB Corporation. All rights reserved. 18
Create host aggregate 
$ nova aggregate-create pg-servers 
+----+------------+-------------------+-------+----------+ 
| Id | Name | Availability Zone | Hosts | Metadata | 
+----+------------+-------------------+-------+----------+ 
| 14 | pg-servers | - | | | 
+----+------------+-------------------+-------+----------+ 
$ nova aggregate-add-host pg-servers nova5.ox.uk 
Host nova5.ox.uk has been successfully added for aggregate 14 
+----+------------+-------------------+---------------+----------+ 
| Id | Name | Availability Zone | Hosts | Metadata | 
+----+------------+-------------------+---------------+----------+ 
| 14 | pg-servers | - | 'nova5.ox.uk' | | 
+----+------------+-------------------+---------------+----------+ 
$ nova aggregate-set-metadata pg-servers pgsvr=true 
Metadata has been successfully updated for aggregate 14. 
+----+------------+-----------------------------------+--------------+ 
| Id | Name | Availability Zone | Hosts | Metadata | 
+----+------------+-------------------+------- -------+--------------+ 
| 14 | pg-servers | - | 'nova5.ox.uk' | 'pgsvr=true' | 
+----+------------+-------------------+---------------+--------------+ 
© 2014 EnterpriseDB Corporation. All rights reserved. 19
Create flavour 
$ nova flavor-create --ephemeral 0 --swap 4096 --is-public true 
pgsvr.small auto 4096 40 4 
+--------------------------------------+-------------+-----------+... 
| ID | Name | Memory_MB |... 
+--------------------------------------+-------------+-----------+... 
| 44221572-a7e0-4660-97fc-352467743fce | pgsvr.small | 4096 |... 
+--------------------------------------+-------------+-----------+... 
...------+-----------+------+-------+-------------+-----------+ 
... Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | 
...------+-----------+------+-------+-------------+-----------+ 
... 40 | 0 | 4096 | 4 | 1.0 | True | 
...------+-----------+------+-------+-------------+-----------+ 
© 2014 EnterpriseDB Corporation. All rights reserved. 20
Create flavour 
$ nova flavor-key pgsvr.small set aggregate_instance_extra_specs:pgsvr=true 
$ nova flavor-show pgsvr.small 
+----------------------------+--------------------------------------------------+ 
| Property | Value | 
+----------------------------+--------------------------------------------------+ 
| OS-FLV-DISABLED:disabled | False | 
| OS-FLV-EXT-DATA:ephemeral | 0 | 
| disk | 40 | 
| extra_specs | {"aggregate_instance_extra_specs:pgsvr": "true"} | 
| id | 44221572-a7e0-4660-97fc-352467743fce | 
| name | pgsvr.small | 
| os-flavor-access:is_public | True | 
| ram | 4096 | 
| rxtx_factor | 1.0 | 
| swap | 4096 | 
| vcpus | 4 | 
+----------------------------+--------------------------------------------------+ 
© 2014 EnterpriseDB Corporation. All rights reserved. 21
A note on Scheduler Filters 
• Scheduler filters determine which compute node a new 
instance will be created on 
• Filters are chained, and can reject hosts based on: 
− Capabilities 
− Current utilisation 
− Physical location 
− Affinity 
− Other factors such as tenant isolation requirements 
• Our example used the 
aggregate_instance_extra_specs filter 
• Custom filters can be defined in JSON (json_filter), or 
written from scratch in Python 
© 2014 EnterpriseDB Corporation. All rights reserved. 22
Instance Storage 
-or- 
Where do my VMs live? 
© 2014 EnterpriseDB Corporation. All rights reserved. 23
Local storage 
• Known as Instance Store on AWS 
• Images are copied to local storage on the compute 
node and started 
• Pros: 
− Easy to setup 
− Performant 
− Minimal hardware requirements 
• Cons: 
− Moving instances requires downtime 
− Potentially less reliable 
© 2014 EnterpriseDB Corporation. All rights reserved. 24
Shared instance storage 
• Same as Instance Store, but uses storage shared 
between compute nodes using NFS, iSCSI, etc. 
• Pros 
− Allows easy migration of instances between compute nodes 
− Potentially more reliable storage (if a SAN or similar is used) 
• Cons 
− “Local” I/O is over the network 
− More complex to setup and maintain 
− Can be far more expensive (SAN, 10GBe or fibre channel 
network etc.) 
© 2014 EnterpriseDB Corporation. All rights reserved. 25
Volume storage 
• Known as Elastic Block Store (EBS) on AWS 
• Root volume is stored in Cinder 
• Pros: 
− Available as a launch-time option, if Cinder is configured 
− Allows easy migration of instances between compute nodes 
− Potentially more reliable storage (if a SAN or similar is used) 
• Cons: 
− “Local” I/O is over the network 
− More complex to setup and maintain 
− Can be far more expensive (SAN, 10GBe or fibre channel 
network etc.) 
© 2014 EnterpriseDB Corporation. All rights reserved. 26
Data Storage 
© 2014 EnterpriseDB Corporation. All rights reserved. 27
Data storage 
• In the instance: 
− Easy to setup and manage – click and go 
− Resizing will pause the instance 
− Not very “elastic” 
− Slower snapshots – data has to be moved to Glance 
• In Cinder: 
− More complex to setup 
− More expensive for a high performance setup 
− Add storage on the fly by adding volumes and utilising LVM 
− Can choose storage types – SSD vs. rust, low vs. high IOPs 
− Fast snapshots – Cinder can use filesystem/SAN snapshots 
© 2014 EnterpriseDB Corporation. All rights reserved. 28
Firewalling 
© 2014 EnterpriseDB Corporation. All rights reserved. 29
Instance firewalling 
• Neutron provides Security Groups to define firewall 
rules 
• No ingress access by default 
• Each security group has one or more ingress or egress 
rules defined 
• All instances have one or more security groups 
associated with them 
• Allows easy configuration of a standard set of firewall 
rules for multiple servers 
© 2014 EnterpriseDB Corporation. All rights reserved. 30
Security group configuration 
© 2014 EnterpriseDB Corporation. All rights reserved. 31
Networking 
© 2014 EnterpriseDB Corporation. All rights reserved. 32
Private cluster network 
• Create one or more virtual networks to contain a 
cluster of database servers, entire application or some 
other group of instances 
• Analogous to Virtual Private Cloud (VPC) in Amazon 
• Optionally attach virtual routers to networks 
• Attach one or more networks to each instance 
• Use Floating IPs (Elastic IPs) to access instances from 
outside the virtual network 
• Each network can have a DHCP server and custom 
routes 
© 2014 EnterpriseDB Corporation. All rights reserved. 33
Network configuration 
© 2014 EnterpriseDB Corporation. All rights reserved. 34
Network topology 
© 2014 EnterpriseDB Corporation. All rights reserved. 35
WAL Archiving 
© 2014 EnterpriseDB Corporation. All rights reserved. 36
WAL archiving to Swift 
• Object storage is ideal for storing WAL segments and 
backups 
• Highly redundant storage offers reliability and scaling 
• Easy to use with WAL-E (https://github.com/wal-e/wal-e) 
− WAL archival and retrieval 
− Base backup creation and restoration 
− WAL cleanup/pruning 
© 2014 EnterpriseDB Corporation. All rights reserved. 37
Installing WAL-E 
# pip install wal-e 
<stuff happens> 
# vi /var/lib/pgsql/9.3/data/postgresql.conf 
wal_level = archive 
archive_mode = on 
archive_command = '/var/lib/pgsql/wal-e.sh %p’ 
archive_timeout = 60 # For testing 
# vi /var/lib/pgsql/wal-e-creds.sh 
export SWIFT_AUTHURL=http://auth.enterprisedb.com:35357/v2.0 
export SWIFT_USER=wal-e 
export SWIFT_PASSWORD=ReallyReallySecret 
export SWIFT_TENANT=admin 
export WALE_SWIFT_PREFIX=swift://wal-e 
# chown postgres:postgres /var/lib/pgsql/wal-e-creds.sh 
# chmod 600 /var/lib/pgsql/wal-e-creds.sh 
© 2014 EnterpriseDB Corporation. All rights reserved. 38
Installing WAL-E 
# vi /var/lib/pgsql/wal-e.sh 
#!/bin/sh 
source /var/lib/pgsql/wal-e-creds.sh 
/usr/bin/wal-e wal-push $1 
# chmod +x /var/lib/pgsql/wal-e-creds.sh 
# service postgresql-9.3 restart 
# tail –f /var/lib/pgsql/9.3/data/pg_log/postgresql.log 
wal_e.main INFO MSG: starting WAL-E 
DETAIL: The subcommand is "wal-push". 
STRUCTURED: time=2014-08-29T16:55:56.236552-00 pid=18301 
wal_e.worker.upload INFO MSG: begin archiving a file 
DETAIL: Uploading "pg_xlog/00000001000000000000000E" to "swift://wal-e/ 
wal_005/00000001000000000000000E.lzo". 
STRUCTURED: time=2014-08-29T16:55:56.360962-00 pid=18301 action=push-wal 
key=swift://wal-e/wal_005/00000001000000000000000E.lzo prefix= seg=00000001000000000000000E 
state=begin 
urllib3.connectionpool INFO Starting new HTTP connection (1): auth.enterprisedb.com 
urllib3.connectionpool INFO Starting new HTTP connection (1): swift.enterprisedb.com 
wal_e.worker.upload INFO MSG: completed archiving to a file 
DETAIL: Archiving to "swift://wal-e/wal_005/00000001000000000000000E.lzo" complete 
at 9.29666KiB/s. 
STRUCTURED: time=2014-08-29T16:56:03.467501-00 pid=18301 action=push-wal 
key=swift://wal-e/wal_005/00000001000000000000000E.lzo prefix= rate=9.29666 
seg=00000001000000000000000E state=complete 
© 2014 EnterpriseDB Corporation. All rights reserved. 39
WAL Archives 
© 2014 EnterpriseDB Corporation. All rights reserved. 40
Summary 
© 2014 EnterpriseDB Corporation. All rights reserved. 41
Summary 
• Deploy standardised, maintainable database servers 
from images in Glance 
• Configure database-optimised compute nodes 
• Configure database-optimised machine flavours in 
Nova to target desired nodes 
• Select instance storage based on performance and 
flexibility requirements vs. budget. 
• Select data storage based on complexity vs. flexibility 
© 2014 EnterpriseDB Corporation. All rights reserved. 42
Summary contd. 
• Use Neutron’s security groups to provide standardised 
security configuration outside of the instance 
• Utilise virtual networks to isolate logical clusters or 
groups of machines 
• Archive base backups and WAL to Swift with WAL-E 
for ease of backup management, redundancy and 
scalability 
© 2014 EnterpriseDB Corporation. All rights reserved. 43
Questions? 
© 2014 EnterpriseDB Corporation. All rights reserved. 44
© 2014 EnterpriseDB Corporation. All rights reserved. 45
Ad

Recommended

[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
[OpenInfra Days Korea 2018] Day 2 - CEPH 운영자를 위한 Object Storage Performance T...
OpenStack Korea Community
 
The hidden power of network maps on Zabbix
The hidden power of network maps on Zabbix
Ricardo Santos
 
malloc & vmalloc in Linux
malloc & vmalloc in Linux
Adrian Huang
 
Windows Registry Forensics - Artifacts
Windows Registry Forensics - Artifacts
MD SAQUIB KHAN
 
Highly efficient backups with percona xtrabackup
Highly efficient backups with percona xtrabackup
Nilnandan Joshi
 
Understanding PostgreSQL LW Locks
Understanding PostgreSQL LW Locks
Jignesh Shah
 
Yocto Project introduction
Yocto Project introduction
Yi-Hsiu Hsu
 
Using filesystem capabilities with rsync
Using filesystem capabilities with rsync
Hazel Smith
 
Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using Yocto
Marco Cavallini
 
[오픈소스컨설팅]오픈스택에 대하여
[오픈소스컨설팅]오픈스택에 대하여
Ji-Woong Choi
 
PostGreSQL Performance Tuning
PostGreSQL Performance Tuning
Maven Logix
 
Yocto project
Yocto project
University of Texas at Dallas
 
Persistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShift
Red Hat Events
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
vivekkonnect
 
Users and groups
Users and groups
Varnnit Jain
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
Sim Janghoon
 
How to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage system
Saroj Sahu
 
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Vietnam Open Infrastructure User Group
 
Qt5 (minimal) on beaglebone, with Yocto
Qt5 (minimal) on beaglebone, with Yocto
Prabindh Sundareson
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 
Embedded-C.pdf
Embedded-C.pdf
Mritunjaykumar502565
 
05. performance-concepts-26-slides
05. performance-concepts-26-slides
Muhammad Ahad
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
Marko4394
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
ShapeBlue
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
Sage Weil
 
Board Bringup
Board Bringup
Anil Kumar Pugalia
 
Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
Adrian Huang
 
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
PavelKonotopov
 
Cloud computing and OpenStack
Cloud computing and OpenStack
Edgar Magana
 

More Related Content

What's hot (20)

Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using Yocto
Marco Cavallini
 
[오픈소스컨설팅]오픈스택에 대하여
[오픈소스컨설팅]오픈스택에 대하여
Ji-Woong Choi
 
PostGreSQL Performance Tuning
PostGreSQL Performance Tuning
Maven Logix
 
Yocto project
Yocto project
University of Texas at Dallas
 
Persistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShift
Red Hat Events
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
vivekkonnect
 
Users and groups
Users and groups
Varnnit Jain
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
Sim Janghoon
 
How to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage system
Saroj Sahu
 
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Vietnam Open Infrastructure User Group
 
Qt5 (minimal) on beaglebone, with Yocto
Qt5 (minimal) on beaglebone, with Yocto
Prabindh Sundareson
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 
Embedded-C.pdf
Embedded-C.pdf
Mritunjaykumar502565
 
05. performance-concepts-26-slides
05. performance-concepts-26-slides
Muhammad Ahad
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
Marko4394
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
ShapeBlue
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
Sage Weil
 
Board Bringup
Board Bringup
Anil Kumar Pugalia
 
Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
Adrian Huang
 
Run Qt on Linux embedded systems using Yocto
Run Qt on Linux embedded systems using Yocto
Marco Cavallini
 
[오픈소스컨설팅]오픈스택에 대하여
[오픈소스컨설팅]오픈스택에 대하여
Ji-Woong Choi
 
PostGreSQL Performance Tuning
PostGreSQL Performance Tuning
Maven Logix
 
Persistent Storage with Containers with Kubernetes & OpenShift
Persistent Storage with Containers with Kubernetes & OpenShift
Red Hat Events
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
vivekkonnect
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
Sim Janghoon
 
How to shutdown and power up of the netapp cluster mode storage system
How to shutdown and power up of the netapp cluster mode storage system
Saroj Sahu
 
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Room 3 - 6 - Nguyễn Văn Thắng & Dzung Nguyen - Ứng dụng openzfs làm lưu trữ t...
Vietnam Open Infrastructure User Group
 
Qt5 (minimal) on beaglebone, with Yocto
Qt5 (minimal) on beaglebone, with Yocto
Prabindh Sundareson
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/Core
Shay Cohen
 
05. performance-concepts-26-slides
05. performance-concepts-26-slides
Muhammad Ahad
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
Marko4394
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
ShapeBlue
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
Sage Weil
 
Memory Mapping Implementation (mmap) in Linux Kernel
Memory Mapping Implementation (mmap) in Linux Kernel
Adrian Huang
 

Similar to Postgres on OpenStack (20)

Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
PavelKonotopov
 
Cloud computing and OpenStack
Cloud computing and OpenStack
Edgar Magana
 
Block Storage For VMs With Ceph
Block Storage For VMs With Ceph
The Linux Foundation
 
XenSummit - 08/28/2012
XenSummit - 08/28/2012
Ceph Community
 
Best Practices & Lessons Learned from Deployment of PostgreSQL
Best Practices & Lessons Learned from Deployment of PostgreSQL
EDB
 
Shootout at the PAAS Corral
Shootout at the PAAS Corral
PostgreSQL Experts, Inc.
 
Postgres for the Future
Postgres for the Future
EDB
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with Chef
Matt Ray
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
Sean Chittenden
 
Postgresql database administration volume 1
Postgresql database administration volume 1
Federico Campoli
 
Doing More with Postgres - Yesterday's Vision Becomes Today's Reality
Doing More with Postgres - Yesterday's Vision Becomes Today's Reality
EDB
 
Exploring Postgres with Bruce Momjian
Exploring Postgres with Bruce Momjian
EDB
 
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack - OpenStack Fall 2012 Summit
Matt Ray
 
Chef for OpenStack- Fall 2012.pdf
Chef for OpenStack- Fall 2012.pdf
OpenStack Foundation
 
LINSTOR - Linux Block storage management tool (march 2019)
LINSTOR - Linux Block storage management tool (march 2019)
Sebastian Schinhammer
 
Keynote - Hosted PostgreSQL: An Objective Look
Keynote - Hosted PostgreSQL: An Objective Look
EDB
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Ruben S. Montero
 
OpenStack Deployments with Chef
OpenStack Deployments with Chef
Matt Ray
 
Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments
IBM India Smarter Computing
 
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
Building the Enterprise infrastructure with PostgreSQL as the basis for stori...
PavelKonotopov
 
Cloud computing and OpenStack
Cloud computing and OpenStack
Edgar Magana
 
Best Practices & Lessons Learned from Deployment of PostgreSQL
Best Practices & Lessons Learned from Deployment of PostgreSQL
EDB
 
Postgres for the Future
Postgres for the Future
EDB
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with Chef
Matt Ray
 
Creating PostgreSQL-as-a-Service at Scale
Creating PostgreSQL-as-a-Service at Scale
Sean Chittenden
 
Postgresql database administration volume 1
Postgresql database administration volume 1
Federico Campoli
 
Doing More with Postgres - Yesterday's Vision Becomes Today's Reality
Doing More with Postgres - Yesterday's Vision Becomes Today's Reality
EDB
 
Exploring Postgres with Bruce Momjian
Exploring Postgres with Bruce Momjian
EDB
 
Chef for OpenStack - OpenStack Fall 2012 Summit
Chef for OpenStack - OpenStack Fall 2012 Summit
Matt Ray
 
LINSTOR - Linux Block storage management tool (march 2019)
LINSTOR - Linux Block storage management tool (march 2019)
Sebastian Schinhammer
 
Keynote - Hosted PostgreSQL: An Objective Look
Keynote - Hosted PostgreSQL: An Objective Look
EDB
 
PostgreSQL High Availability in a Containerized World
PostgreSQL High Availability in a Containerized World
Jignesh Shah
 
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Building IaaS Clouds and the Art of Virtual Machine Management: A Practical G...
Ruben S. Montero
 
OpenStack Deployments with Chef
OpenStack Deployments with Chef
Matt Ray
 
Using the IBM XIV Storage System in OpenStack Cloud Environments
Using the IBM XIV Storage System in OpenStack Cloud Environments
IBM India Smarter Computing
 
Ad

More from EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 
Ad

Recently uploaded (20)

GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 
GDG Douglas - Google AI Agents: Your Next Intern?
GDG Douglas - Google AI Agents: Your Next Intern?
felipeceotto
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
MOVIE RECOMMENDATION SYSTEM, UDUMULA GOPI REDDY, Y24MC13085.pptx
Maharshi Mallela
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
How the US Navy Approaches DevSecOps with Raise 2.0
How the US Navy Approaches DevSecOps with Raise 2.0
Anchore
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Transmission Media. (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Smart Financial Solutions: Money Lender Software, Daily Pigmy & Personal Loan...
Intelli grow
 
Software Testing & it’s types (DevOps)
Software Testing & it’s types (DevOps)
S Pranav (Deepu)
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
How Insurance Policy Management Software Streamlines Operations
How Insurance Policy Management Software Streamlines Operations
Insurance Tech Services
 
UPDASP a project coordination unit ......
UPDASP a project coordination unit ......
withrj1
 

Postgres on OpenStack

  • 1. Postgres on OpenStack • Dave Page | 18/9/2014 © 2014 EnterpriseDB Corporation. All rights reserved. 1
  • 2. Introduction • PostgreSQL: − Core team member − pgAdmin lead developer − Web/sysadmin teams − PGCAC/PGEU board member • EDB: − Tools − Cloud products − Configuration management − Packaging/distribution − Infrastructure © 2014 EnterpriseDB Corporation. All rights reserved. 2
  • 3. What is OpenStack? • Cloud environment, similar to AWS: − Private implementations − Public implementations – Rackspace, HP Cloud • Modular design, offering a choice of services including: − Image Service (Glance) − Block Storage (Cinder) − Compute (Nova) − Network (Neutron) − Object Storage (Swift) © 2014 EnterpriseDB Corporation. All rights reserved. 3
  • 4. Glance Image Service • Store virtual machine images and snapshots • Preconfigure an image or snapshot with the desired OS/software • Share images with members of selected projects (AKA, tenants). © 2014 EnterpriseDB Corporation. All rights reserved. 4
  • 5. Cinder Block Storage Service • Analogous to Amazon Elastic Block Storage (EBS) • Provides block storage devices to virtual machine instances • Can be provided from one or more service nodes via a controller • Service nodes may use various storage systems, with different properties including: − LVM − GlusterFS − NFS − Various SANs © 2014 EnterpriseDB Corporation. All rights reserved. 5
  • 6. Nova Compute Service • Analogous to Amazon Elastic Compute Service (EC2) • Schedules and runs VM instances • Multiple machine flavours with individual RAM, CPU and disk requirements • Compute node selection is highly configurable: − Pluggable scheduler filters − Target images to specific hosts − Target flavours to specific hosts − Target instances to hosts with enough free resources © 2014 EnterpriseDB Corporation. All rights reserved. 6
  • 7. Neutron Networking Service • Provides network services to VM instances • Attach instances to one or more virtual networks • Map floating/public IP addresses to a VM • Configure firewall rules for ingress and egress © 2014 EnterpriseDB Corporation. All rights reserved. 7
  • 8. Swift Object Storage • Analogous to Amazon Simple Storage Service (S3) • Provides highly redundant object storage • Suitable for storage and retrieval of whole files © 2014 EnterpriseDB Corporation. All rights reserved. 8
  • 9. Wait, what about Trove? • Still in relatively early stages of development • Currently seems focused on MySQL/Cassandra • No support for clustering or other non-trivial setups • API favours psql/pgAdmin operations, not deployment/ configuration © 2014 EnterpriseDB Corporation. All rights reserved. 9
  • 10. Well that all sounds pretty cool, but what can we do with it? © 2014 EnterpriseDB Corporation. All rights reserved. 10
  • 11. Database Server Images © 2014 EnterpriseDB Corporation. All rights reserved. 11
  • 12. Database server images • Preconfigure a “standard” database image • Enables consistency, which leads to ease of management • Preinstall commonly required software: − Procedural languages − WAL-E − pgBouncer/pgPool • Minimise launch/deployment time © 2014 EnterpriseDB Corporation. All rights reserved. 12
  • 13. Image or Snapshot? • Technically there’s not much difference • OCD: I like images to be, well images • Images may be considered “blessed” or approved • Snapshots are a convenient way to take backups, perhaps of work in progress • Images are “clean” configurations, whilst snapshots may contain artifacts from previous use, e.g. shell history or log files. © 2014 EnterpriseDB Corporation. All rights reserved. 13
  • 14. Creating an image • Create a small root disk in QCOW2 format • Install the base OS on the disk (I use KVM on RHEL) • Install the required software • Add the EPEL Yum repo, and install cloud-init • Disable zeroconf for the network • Shutdown the VM • Run virt-sysprep to clean the OS installation © 2014 EnterpriseDB Corporation. All rights reserved. 14
  • 15. Uploading the image $ glance image-create --name ”PostgreSQL-9.4" --disk-format qcow2 --container-format bare --is-public True --progress < pg-9.3.img +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 64d7c1cd2b6f60642c14663941cb7913 | | container_format | bare | | created_at | 2014-08-29T14:55:08 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | acafc7c0-40aa-4026-9673-b879124bcec2 | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | PostgreSQL-9.4 | | owner | efa984b0a914450e9a47788ad330699d | | protected | False | | size | 2013167616 | | status | active | | updated_at | 2014-08-29T14:55:08 | +------------------+--------------------------------------+ © 2014 EnterpriseDB Corporation. All rights reserved. 15
  • 16. Database Server Machine Configurations © 2014 EnterpriseDB Corporation. All rights reserved. 16
  • 17. Dedicated database flavours • “Flavors” (without the u) describe the instance configuration: − vCPUs − Memory − Root disk − Ephemeral disk − Swap − Other attributes • Additional attributes allow us to target specific hypervisor properties, e.g. − Compute nodes with SSDs © 2014 EnterpriseDB Corporation. All rights reserved. 17
  • 18. Targeting a host aggregate • Create a host aggregate or group containing the desired compute nodes • Add a property to the host aggregate to identify the desired attribute for matching • Create the desired flavour(s) • Add a property to the flavour to correspond with the property on the host aggregate • Share the flavour with one or more tenants © 2014 EnterpriseDB Corporation. All rights reserved. 18
  • 19. Create host aggregate $ nova aggregate-create pg-servers +----+------------+-------------------+-------+----------+ | Id | Name | Availability Zone | Hosts | Metadata | +----+------------+-------------------+-------+----------+ | 14 | pg-servers | - | | | +----+------------+-------------------+-------+----------+ $ nova aggregate-add-host pg-servers nova5.ox.uk Host nova5.ox.uk has been successfully added for aggregate 14 +----+------------+-------------------+---------------+----------+ | Id | Name | Availability Zone | Hosts | Metadata | +----+------------+-------------------+---------------+----------+ | 14 | pg-servers | - | 'nova5.ox.uk' | | +----+------------+-------------------+---------------+----------+ $ nova aggregate-set-metadata pg-servers pgsvr=true Metadata has been successfully updated for aggregate 14. +----+------------+-----------------------------------+--------------+ | Id | Name | Availability Zone | Hosts | Metadata | +----+------------+-------------------+------- -------+--------------+ | 14 | pg-servers | - | 'nova5.ox.uk' | 'pgsvr=true' | +----+------------+-------------------+---------------+--------------+ © 2014 EnterpriseDB Corporation. All rights reserved. 19
  • 20. Create flavour $ nova flavor-create --ephemeral 0 --swap 4096 --is-public true pgsvr.small auto 4096 40 4 +--------------------------------------+-------------+-----------+... | ID | Name | Memory_MB |... +--------------------------------------+-------------+-----------+... | 44221572-a7e0-4660-97fc-352467743fce | pgsvr.small | 4096 |... +--------------------------------------+-------------+-----------+... ...------+-----------+------+-------+-------------+-----------+ ... Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | ...------+-----------+------+-------+-------------+-----------+ ... 40 | 0 | 4096 | 4 | 1.0 | True | ...------+-----------+------+-------+-------------+-----------+ © 2014 EnterpriseDB Corporation. All rights reserved. 20
  • 21. Create flavour $ nova flavor-key pgsvr.small set aggregate_instance_extra_specs:pgsvr=true $ nova flavor-show pgsvr.small +----------------------------+--------------------------------------------------+ | Property | Value | +----------------------------+--------------------------------------------------+ | OS-FLV-DISABLED:disabled | False | | OS-FLV-EXT-DATA:ephemeral | 0 | | disk | 40 | | extra_specs | {"aggregate_instance_extra_specs:pgsvr": "true"} | | id | 44221572-a7e0-4660-97fc-352467743fce | | name | pgsvr.small | | os-flavor-access:is_public | True | | ram | 4096 | | rxtx_factor | 1.0 | | swap | 4096 | | vcpus | 4 | +----------------------------+--------------------------------------------------+ © 2014 EnterpriseDB Corporation. All rights reserved. 21
  • 22. A note on Scheduler Filters • Scheduler filters determine which compute node a new instance will be created on • Filters are chained, and can reject hosts based on: − Capabilities − Current utilisation − Physical location − Affinity − Other factors such as tenant isolation requirements • Our example used the aggregate_instance_extra_specs filter • Custom filters can be defined in JSON (json_filter), or written from scratch in Python © 2014 EnterpriseDB Corporation. All rights reserved. 22
  • 23. Instance Storage -or- Where do my VMs live? © 2014 EnterpriseDB Corporation. All rights reserved. 23
  • 24. Local storage • Known as Instance Store on AWS • Images are copied to local storage on the compute node and started • Pros: − Easy to setup − Performant − Minimal hardware requirements • Cons: − Moving instances requires downtime − Potentially less reliable © 2014 EnterpriseDB Corporation. All rights reserved. 24
  • 25. Shared instance storage • Same as Instance Store, but uses storage shared between compute nodes using NFS, iSCSI, etc. • Pros − Allows easy migration of instances between compute nodes − Potentially more reliable storage (if a SAN or similar is used) • Cons − “Local” I/O is over the network − More complex to setup and maintain − Can be far more expensive (SAN, 10GBe or fibre channel network etc.) © 2014 EnterpriseDB Corporation. All rights reserved. 25
  • 26. Volume storage • Known as Elastic Block Store (EBS) on AWS • Root volume is stored in Cinder • Pros: − Available as a launch-time option, if Cinder is configured − Allows easy migration of instances between compute nodes − Potentially more reliable storage (if a SAN or similar is used) • Cons: − “Local” I/O is over the network − More complex to setup and maintain − Can be far more expensive (SAN, 10GBe or fibre channel network etc.) © 2014 EnterpriseDB Corporation. All rights reserved. 26
  • 27. Data Storage © 2014 EnterpriseDB Corporation. All rights reserved. 27
  • 28. Data storage • In the instance: − Easy to setup and manage – click and go − Resizing will pause the instance − Not very “elastic” − Slower snapshots – data has to be moved to Glance • In Cinder: − More complex to setup − More expensive for a high performance setup − Add storage on the fly by adding volumes and utilising LVM − Can choose storage types – SSD vs. rust, low vs. high IOPs − Fast snapshots – Cinder can use filesystem/SAN snapshots © 2014 EnterpriseDB Corporation. All rights reserved. 28
  • 29. Firewalling © 2014 EnterpriseDB Corporation. All rights reserved. 29
  • 30. Instance firewalling • Neutron provides Security Groups to define firewall rules • No ingress access by default • Each security group has one or more ingress or egress rules defined • All instances have one or more security groups associated with them • Allows easy configuration of a standard set of firewall rules for multiple servers © 2014 EnterpriseDB Corporation. All rights reserved. 30
  • 31. Security group configuration © 2014 EnterpriseDB Corporation. All rights reserved. 31
  • 32. Networking © 2014 EnterpriseDB Corporation. All rights reserved. 32
  • 33. Private cluster network • Create one or more virtual networks to contain a cluster of database servers, entire application or some other group of instances • Analogous to Virtual Private Cloud (VPC) in Amazon • Optionally attach virtual routers to networks • Attach one or more networks to each instance • Use Floating IPs (Elastic IPs) to access instances from outside the virtual network • Each network can have a DHCP server and custom routes © 2014 EnterpriseDB Corporation. All rights reserved. 33
  • 34. Network configuration © 2014 EnterpriseDB Corporation. All rights reserved. 34
  • 35. Network topology © 2014 EnterpriseDB Corporation. All rights reserved. 35
  • 36. WAL Archiving © 2014 EnterpriseDB Corporation. All rights reserved. 36
  • 37. WAL archiving to Swift • Object storage is ideal for storing WAL segments and backups • Highly redundant storage offers reliability and scaling • Easy to use with WAL-E (https://github.com/wal-e/wal-e) − WAL archival and retrieval − Base backup creation and restoration − WAL cleanup/pruning © 2014 EnterpriseDB Corporation. All rights reserved. 37
  • 38. Installing WAL-E # pip install wal-e <stuff happens> # vi /var/lib/pgsql/9.3/data/postgresql.conf wal_level = archive archive_mode = on archive_command = '/var/lib/pgsql/wal-e.sh %p’ archive_timeout = 60 # For testing # vi /var/lib/pgsql/wal-e-creds.sh export SWIFT_AUTHURL=http://auth.enterprisedb.com:35357/v2.0 export SWIFT_USER=wal-e export SWIFT_PASSWORD=ReallyReallySecret export SWIFT_TENANT=admin export WALE_SWIFT_PREFIX=swift://wal-e # chown postgres:postgres /var/lib/pgsql/wal-e-creds.sh # chmod 600 /var/lib/pgsql/wal-e-creds.sh © 2014 EnterpriseDB Corporation. All rights reserved. 38
  • 39. Installing WAL-E # vi /var/lib/pgsql/wal-e.sh #!/bin/sh source /var/lib/pgsql/wal-e-creds.sh /usr/bin/wal-e wal-push $1 # chmod +x /var/lib/pgsql/wal-e-creds.sh # service postgresql-9.3 restart # tail –f /var/lib/pgsql/9.3/data/pg_log/postgresql.log wal_e.main INFO MSG: starting WAL-E DETAIL: The subcommand is "wal-push". STRUCTURED: time=2014-08-29T16:55:56.236552-00 pid=18301 wal_e.worker.upload INFO MSG: begin archiving a file DETAIL: Uploading "pg_xlog/00000001000000000000000E" to "swift://wal-e/ wal_005/00000001000000000000000E.lzo". STRUCTURED: time=2014-08-29T16:55:56.360962-00 pid=18301 action=push-wal key=swift://wal-e/wal_005/00000001000000000000000E.lzo prefix= seg=00000001000000000000000E state=begin urllib3.connectionpool INFO Starting new HTTP connection (1): auth.enterprisedb.com urllib3.connectionpool INFO Starting new HTTP connection (1): swift.enterprisedb.com wal_e.worker.upload INFO MSG: completed archiving to a file DETAIL: Archiving to "swift://wal-e/wal_005/00000001000000000000000E.lzo" complete at 9.29666KiB/s. STRUCTURED: time=2014-08-29T16:56:03.467501-00 pid=18301 action=push-wal key=swift://wal-e/wal_005/00000001000000000000000E.lzo prefix= rate=9.29666 seg=00000001000000000000000E state=complete © 2014 EnterpriseDB Corporation. All rights reserved. 39
  • 40. WAL Archives © 2014 EnterpriseDB Corporation. All rights reserved. 40
  • 41. Summary © 2014 EnterpriseDB Corporation. All rights reserved. 41
  • 42. Summary • Deploy standardised, maintainable database servers from images in Glance • Configure database-optimised compute nodes • Configure database-optimised machine flavours in Nova to target desired nodes • Select instance storage based on performance and flexibility requirements vs. budget. • Select data storage based on complexity vs. flexibility © 2014 EnterpriseDB Corporation. All rights reserved. 42
  • 43. Summary contd. • Use Neutron’s security groups to provide standardised security configuration outside of the instance • Utilise virtual networks to isolate logical clusters or groups of machines • Archive base backups and WAL to Swift with WAL-E for ease of backup management, redundancy and scalability © 2014 EnterpriseDB Corporation. All rights reserved. 43
  • 44. Questions? © 2014 EnterpriseDB Corporation. All rights reserved. 44
  • 45. © 2014 EnterpriseDB Corporation. All rights reserved. 45