Postgres Plus Cloud Database Getting Started Guide 20140121

download Postgres Plus Cloud Database Getting Started Guide 20140121

of 99

Transcript of Postgres Plus Cloud Database Getting Started Guide 20140121

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    1/99

    Postgres Plus Cloud Database

    Getting Started Guide

    January 6, 2014

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    2/99

    Postgres Plus Cloud Database Getting Started Guide

    Postgres Plus Cloud Database Getting Started Guide, Version 3.0

    by EnterpriseDB Corporation

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved.

    EnterpriseDB Corporation, 34 Crosby Drive Suite 100, Bedford, MA 01730, USA

    T +1 781 357 3390 F +1 978 589 5701 [email protected] www.enterprisedb.com

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 2

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    3/99

    Postgres Plus Cloud Database Getting Started Guide

    Table of Contents

    1 Introduction ................................................................................................................. 5

    1.1 Typographical Conventions Used in this Guide ................................................. 7

    2

    Postgres Plus Cloud Database - Overview.................................................................. 8

    2.1 The Benefits of using Postgres Plus Cloud Database ......................................... 8

    2.2 Architecture Overview ...................................................................................... 10

    2.3 Postgres Plus Cloud Database ........................................................................... 13

    2.4 Using Cloud Database on a Virtual Private Cloud ........................................... 14

    3

    Accessing Postgres Plus Cloud Database ................................................................. 16

    3.1 Registering a New User .................................................................................... 17

    4 Using the Cloud Database Console........................................................................... 21

    4.1

    The Dashboard Tab ........................................................................................... 21

    4.2 The Clusters Tab ............................................................................................... 22

    4.2.1 The Details Panel .......................................................................................... 25

    4.2.2 The Configurations Panel ............................................................................. 28

    4.2.2.1 Modifying postgresql.conf Parameters ................................................. 31

    4.2.2.2 Modifying pgpool.conf Parameters ...................................................... 32

    4.2.2.3 Best Practices for Working with Configurations .................................. 34

    4.2.3 The Monitoring Panel ................................................................................... 36

    4.2.4

    The Events Panel........................................................................................... 37

    4.3 The Backups Tab .............................................................................................. 38

    4.4 The User Tab..................................................................................................... 39

    5 Creating a New Server Cluster ................................................................................. 42

    5.1.1 Creating a Developer Sandbox ..................................................................... 45

    6

    Connecting an Application to a Cloud Database Cluster.......................................... 46

    7

    Managing Backups and Recovery ............................................................................ 48

    7.1 Reviewing Stored Backups ............................................................................... 49

    7.2

    Restoring a Cluster from Backup ...................................................................... 51

    7.3 Reassigning an Elastic IP Address on Amazon ................................................ 52

    8 Automatic Failover ................................................................................................... 53

    9 Manual Scaling ......................................................................................................... 55

    9.1 Manually Adding Replicas and Storage ........................................................... 55

    9.2 Manually Removing a Replica.......................................................................... 58

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 3

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    4/99

    Postgres Plus Cloud Database Getting Started Guide

    9.3 Manually Changing the Server Class ................................................................ 59

    10 Automatic Scaling ..................................................................................................... 61

    10.1 Adjusting the Automatic Scaling Thresholds ................................................... 61

    11 Load Balancing ......................................................................................................... 63

    12

    Customizing Your Cluster ........................................................................................ 66

    12.1 Adding an Extension to a New Cluster ............................................................. 66

    12.2

    Adding an Extension to an Existing Cluster ..................................................... 67

    13 Cloud Database System Administration ................................................................... 68

    13.1 Moving an Existing Database into a New Cluster ............................................ 69

    13.2 Connecting to the Cluster.................................................................................. 75

    13.2.1 Using ssh to Access a Server ........................................................................ 75

    13.2.2 Connecting with the Postgres Enterprise Manager Client ............................ 77

    13.2.3

    Connecting to Cloud Database with psql or edb-psql ................................... 80

    13.3 Securing a Cloud Database Cluster................................................................... 84

    13.4 Manually Modifying Configuration Files ......................................................... 87

    13.5 Controlling the Server ....................................................................................... 89

    13.6 Upgrading the Postgres Server .......................................................................... 91

    13.6.1 Performing a Major Version Upgrade .......................................................... 92

    14 Troubleshooting ........................................................................................................ 94

    14.1 Frequently Asked Questions ............................................................................. 95

    14.2

    The Cloud Database Email Notification System .............................................. 99

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 4

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    5/99

    Postgres Plus Cloud Database Getting Started Guide

    1 Introduction

    Postgres Plus Cloud Database automatically provisions PostgreSQL or Postgres Plus

    Advanced Server databases in single instances, high-availability clusters, or applicationdevelopment sandboxes across public and private clouds or on-premise data center

    hardware deployments. Cloud Database allows service providers and organizations tooffer elastic and highly scalable database-as-a-service (DBaaS) environments while

    freeing DBAs and application developers from the rigors of setting up and administering

    modern and robust database environments.

    In minutes, Cloud Database configures a cluster of database machines with:

    Streaming replication

    Connection Pooling

    Load Balancing Automatic failover (transaction or recovery time preferred)

    Rotating user-scheduled backups

    Elastic storage

    Elastic scale out

    Cloud Database's automatic scaling of storage resources and scale out of read replicaswhen a database cluster reaches user-defined thresholds is especially worth noting - thisfunctionality provides unattended, around-the-clock responsiveness to unpredictable load

    demands on your database infrastructure.

    This document will demonstrate how to use the Cloud Database interface successfully inyour cloud-based database management activities:

    Postgres Plus Cloud Database - Overview -Chapter 2provides informationabout Cloud Database functionality and architecture.

    Accessing Postgres Plus Cloud Database-Chapter 3walks you through theprocess of registering a new user, and logging in to Cloud Database.

    Using the Cloud Database Console -Chapter 4introduces you to the CloudDatabase graphical user interface, and provides an overview of the functionality

    offered by the user interface controls.

    Creating a New Server Cluster -Chapter 5walks you through how to create aserver cluster, and how to create a developer sandbox.

    Connecting an Application-Chapter 6describes how to locate connectioninformation for your server nodes, so your client applications can access your

    cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 5

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    6/99

    Postgres Plus Cloud Database Getting Started Guide

    Managing Backups and Recovery -Chapter 7describes how to backup orrestore a database hosted on the Cloud, and how to move an elastic IP address.

    Automatic Failover -Chapter 8discusses Postgres Plus Cloud Database failoverfunctionality.

    Manual Scaling-Chapter 9describes how to manually scale up your databasecluster by adding replica nodes or memory.

    Automatic Scaling -Chapter 10discusses how to set the automatic scale upthresholds for your database.

    Load Balancing -Chapter 11discusses how to use load balancing to optimizeclient performance.

    Customizing Your Cluster -Chapter 12discusses some of the ways you can

    customize your Cloud Database. If you add an extension (such as PostGIS) tocustomize a new cluster, Cloud Database will propagate that extension to new

    nodes, preserving your changes throughout the clusters life cycle when you scale

    up, restore or clone that cluster.

    System Administration-Chapter 13provides information about performingadministrative tasks on a Cloud Database cluster.

    Troubleshooting -Chapter 14provides helpful troubleshooting resources, anddetailed information about how to recover from a console failure.

    This document provides an introduction to Postgres Plus Cloud Database and is written toacquaint you with the process of configuring and using the product's core features; it isnot a comprehensive guide to using Postgres Plus database products. Depending on your

    operating environment (public cloud, private cloud, or traditional hardware deployment)

    and hosting vendor, there may be differences in Cloud Database features and functions.

    For more information about using Postgres Plus products, please visit the EnterpriseDB

    website at:

    http://www.enterprisedb.com/documentation

    This document usesPostgresto mean either the PostgreSQL or Postgres Plus AdvancedServer database.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 6

    http://www.enterprisedb.com/documentationhttp://www.enterprisedb.com/documentationhttp://www.enterprisedb.com/documentation
  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    7/99

    Postgres Plus Cloud Database Getting Started Guide

    1.1 Typographical Conventions Used in this Guide

    Certain typographical conventions are used in this manual to clarify the meaning and

    usage of various commands, statements, programs, examples, etc. This section provides a

    summary of these conventions.

    In the following descriptions a termrefers to any word or group of words that are

    language keywords, user-supplied values, literals, etc. A terms exact meaning dependsupon the context in which it is used.

    Italic fontintroduces a new term, typically, in the sentence that defines it for thefirst time.

    Fixed-width (mono-spaced) fontis used for terms that must be given

    literally such as SQL commands, specific table and column names used in the

    examples, programming language keywords, etc. For example, SELECT * FROMemp;

    Italic fixed-width fontis used for terms for which the user mustsubstitute values in actual usage. For example, DELETE FROMtable_name;

    A vertical pipe | denotes a choice between the terms on either side of the pipe. Avertical pipe is used to separate two or more alternative terms within square

    brackets (optional choices) or braces (one mandatory choice).

    Square brackets [ ] denote that one or none of the enclosed term(s) may be

    substituted. For example, [ a | b ], means choose one of a or b or neither

    of the two.

    Braces {} denote that exactly one of the enclosed alternatives must be specified.

    For example, { a | b }, means exactly one of a or b must be specified.

    Ellipses ... denote that the proceeding term may be repeated. For example, [ a |

    b ] ...means that you may have the sequence, b a a b a.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 7

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    8/99

    Postgres Plus Cloud Database Getting Started Guide

    2 Postgres Plus Cloud Database -Overview

    Postgres Plus Cloud Database simplifies the process of provisioning robust Postgres

    deployments, while taking advantage of the benefits of cloud computing. When usedwith Postgres Plus Advanced Server, Cloud Database also provides an Oracle-compatible

    DBaaS, offering dramatic cost savings and competitive advantages.

    2.1 The Benefits of using Postgres Plus Cloud Database

    Postgres Plus Cloud Database provides the following functionality:

    Postgres database. Cloud Database provides enterprise-class database features

    and performance, using the mature and proven platforms of open sourcecommunity PostgreSQL or EnterpriseDB's Postgres Plus Advanced Server.

    Automatic Binary Replication. The moment your multi-node cluster isavailable for use, Postgres' streaming replication is in operation, keeping schema

    and data changes on all of the nodes in your cluster in sync, while requiring no

    special administrative skills.

    Transparent/elastic scalability. Manually or automatically, Cloud Databaseallows you to add storage capacity and scale out read replicas horizontally tosupport more users online without interrupting business operations.

    Scale Up for Server Class. When data processing loads and usage characteristicsrequire a change in the underlying virtual machine resources, a flexible solution to

    power up your running cluster is just a button click away.

    Automatic Connection Pooling /Load Balancing. Cloud Database providesefficient connection management, helping to support more users per server. The

    integrated load balancer provides SQL routing, and automatically increases readperformance by distributing requests across all cluster members.

    Self-Healing Failover. Cloud Database automatically replaces a downed read-

    only replica node or the read-write master node, preserving the continuity andperformance of the cluster. Users can choose to replace the master with a new

    master (preserving all committed transactions) or with a promoted replica (for

    faster recovery time).

    Web-based interface. Cloud Database provides easy to use point-and-clickcluster lifecycle management from start to finish from your favorite webbrowsers.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 8

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    9/99

    Postgres Plus Cloud Database Getting Started Guide

    Automatic Online backup. Cloud Database provides full protection of data inthe cloud, protecting against data mishaps with user-specified, grandfathered

    rotating backups.

    Database Cloning. Cloud Database allows you to quickly and easily create

    developer 'sandboxes' based on real production data, saving SystemAdministrators setup, configuration and data load time.

    Supports virtual private cloud (VPC), public cloud, private cloud, and in-house data center installations. Cloud Database allows you to select theenvironment that is most cost-effective and convenient for your organization,

    without vendor lock-in.

    Cost-saving Oracle Compatibility. Using an Oracle-compatible Postgresdatabase is a reliable, fast and cost-effective way to move Oracle applications to a

    public or private cloud.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 9

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    10/99

    Postgres Plus Cloud Database Getting Started Guide

    2.2 Architecture Overview

    The Postgres Plus Cloud Database management console is designed to help you easily

    create and manage high-availability databaseclusters from a web browser.

    Traditionally, the expression clusterrefers to a single instance of Postgresmanaging multiple databases; a Cloud Database databaseserverclusteris a

    collection of high-availability Postgres server instances that reside in a cloud or

    on a traditional network.

    When you create a new cluster (a group of replicated database servers), Postgres Plus

    Cloud Database initializes one or more Postgres instances (virtual machines) according to

    your specifications. Cloud Database uses Postgres streaming replication to synchronizereplicas in the cluster, and pgpool-II to implement load balancing and connection pooling

    among all active instances. Figure 2.1 provides a general overview of the Cloud

    Database architecture.

    Figure 2.1 - An overview of the Cloud Database architecture.

    The master node of the cluster contains a host operating system (CentOS 6.0) with a

    running instance of Postgres, along with the load balancer. Database modifications areautomatically routed to the master node; any modifications to the master node are

    subsequently propagated to each replica using Postgres streaming replication.

    Cloud Database installs Postgres on each replica node in a read-only hot-standby role that

    automatically duplicates all data found on the master node, and all changes made to thatdata. In hot-standby mode, the data is available to service user queries providing read

    scalability to the cluster (see Figure 2.2). In addition, any schema changes made to the

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 10

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    11/99

    Postgres Plus Cloud Database Getting Started Guide

    master are also replicated to the replica nodes, making development and deployment of

    application changes easy and seamless without interruption to normal operations.

    Figure 2.2 - Cloud Database performs automatic load balancing.

    Replicas provide balanced user support as needed - if any instance in the cluster goes

    offline, the cluster's load is re-balanced among the remaining servers while the instance isautomatically replaced.

    When used in the default healing configuration, in the event of a failure of the masternode, a new node is spun up and the disk-storage for the old master node is attached to it,

    providing zero data loss when the new master becomes available. While the replica

    nodes are standing by, they are read-only resources, load balancing client queries withouta risk of compromising data integrity. Optionally, users can choose to promote an

    existing replica to master status when healing is required, providing a faster recovery

    time at the expense of losing any transactions committed on the master, but not yetreplicated when the master went down.

    Postgres Plus Cloud Database automatically archives data at regular intervals; you canspecify a convenient backup window and how many backups to retain when creating a

    database cluster. Cloud Database also offers backup on demand - simply click the

    Backupicon to save a copy of the instance. Automatic backups are retained according to

    your specifications; on-demand backups are retained until you delete them. Each backupis a complete copy of the cluster; you can use a backup to restore a cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 11

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    12/99

    Postgres Plus Cloud Database Getting Started Guide

    Postgres Plus Cloud Database makes it easy toscalea database cluster:

    To increase read performance, you can add read replicas to the cluster (manuallyor automatically).

    To handle expanding data requirements you can increase the amount of storageavailable (manually or automatically).

    To increase the RAM or CPU processing power of the cluster's underlying virtualmachine, you can manually scale a cluster into a more appropriate server class.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 12

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    13/99

    Postgres Plus Cloud Database Getting Started Guide

    2.3 Postgres Plus Cloud Database

    A cloud (shown in Figure 2.3) is a collection of virtual machines hosted by a paid

    provider such as Amazon. Each virtual machine runs a separate copy of an operating

    system and an installation of Postgres.

    Figure 2.3 - Using Cloud Database in a Public Cloud.

    You can select from different combinations of CPU speed, RAM, and disk space to suit

    your needs when provisioning a Cloud Database cluster. Postgres Plus Cloud Database

    makes it easy to scale up to a more capable cluster, or scale down as your requirements

    change.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 13

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    14/99

    Postgres Plus Cloud Database Getting Started Guide

    2.4 Using Cloud Database on a Virtual Private Cloud

    Cloud Database can also help you create and manage cloud clusters that reside on

    Amazon-hosted virtual private networks. A virtual private cloud is similar in structure to

    a traditional network, but provides the scalability and ease of maintenance offered by

    cloud computing.

    A virtual private cloud is an isolated network with a unique IP address range and subnetaddress (or addresses). When you use the Cloud Database management console to create

    a cloud instance within a virtual private cloud, you specify the subnet address; Cloud

    Database assigns the new instance an IP address from within your private network.

    Before creating a Cloud Database cluster in a virtual private cloud, you must first sign up

    for the Amazon VPC service. To sign up for an Amazon VPC service, follow the Sign

    Uplink on the Amazon web site at:

    http://aws.amazon.com/

    After registering, you can use the Amazon VPC wizard to create a virtual private cloud

    and subnet, or use options accessed through the Amazon VPC Dashboard (shown in

    Figure 2.4) to create VPC's and subnets, and manage network options.

    Figure 2.4 - The Amazon VPC Dashboard.

    For detailed information about creating and managing an Amazon VPC, please refer to

    the Amazon documentation, available at:

    http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.html

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 14

    http://aws.amazon.com/http://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.htmlhttp://docs.aws.amazon.com/AmazonVPC/latest/GettingStartedGuide/GetStarted.htmlhttp://aws.amazon.com/
  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    15/99

    Postgres Plus Cloud Database Getting Started Guide

    After creating the VPC network and subnet, you can use the Cloud Database management

    console to create the managed instances that reside on your network. After logging into

    the management console, click the LaunchDBClusterbutton on the Management

    Dashboard. When the CreateanewServerdialog opens (as shown in Figure 2.5),

    provide information about the new cluster configuration and a SubnetID; Cloud

    Database will create the new instance on a virtual machine in your VPC network.

    Figure 2.5 - Creating a new Cloud Database cluster.

    Managing an instance that resides in a virtual private cloud is identical to managing a

    cluster that resides in a public cloud; when prompted, simply provide the SubnetIDof

    the cluster when performing management tasks.

    Please note: if your cluster resides in a virtual private cloud and you do not specify a

    subnet identity when upgrading, cloning, scaling or restoring a cluster from backup:

    If you are using an Amazon EC2 Classic virtual private cloud account, theresulting cluster will be created in a public cloud.

    If you are using an Amazon EC2-VPC virtual private cloud account, the resultingcluster will be created in a default VPC created by Amazon.

    For more information about account-specific behavior, please see:

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 15

    http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.htmlhttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-vpc.html
  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    16/99

    Postgres Plus Cloud Database Getting Started Guide

    3 Accessing Postgres Plus CloudDatabase

    Configuration and setup of the Postgres Plus Cloud Database is very simple. To accessCloud Database, open a web browser and navigate to the URL provided by your cloud

    provider (e.g. Amazon), after purchasing Cloud Database. The URL will take the form:

    http://ec2_public_dns_address/

    Where ec2_public_dns_addressis the public address of the Cloud Database.

    EnterpriseDB maintains a list of available Cloud Database providers at:

    http://enterprisedb.com/cloud-database/consoles

    The Cloud Database management console currently supports the following browsers:

    Chrome

    Firefox

    Internet Explorer

    Opera

    Safari

    When you first access Cloud Database, a dialog prompts you to Loginor Register, as

    shown in Figure 3.1.

    Figure 3.1 - The Cloud Database Log in or Register dialog.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 16

    http://enterprisedb.com/cloud-database/consoleshttp://enterprisedb.com/cloud-database/consoleshttp://enterprisedb.com/cloud-database/consoles
  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    17/99

    Postgres Plus Cloud Database Getting Started Guide

    On your first visit to Cloud Database, you should:

    1. Registera Cloud Database user.

    2. Loginto the Cloud Database management console.

    3. Download your SSH key (for safekeeping).

    4. Launch a Postgres database cluster.

    After launching a cluster, you can connect to that cluster with a Postgres client

    application such as pgAdmin, EDB-PSQL or Postgres Enterprise Manager. For moreinformation about connecting to the cluster, seeChapter 6,Connecting an Application to

    a Cloud Database ClusterandChapter 13.2,Connecting to the Cluster.

    3.1 Registering a New User

    Before registering with Cloud Database, you must have an account and security

    credentials (e.g. an access key and secret key) with the underlying service provider. Toregister a new user, navigate to the web address of your Cloud Database console, and

    click the Registerbutton. The NewUserRegistrationdialog opens (shown in

    Figure 3.2).

    Figure 3.2 - The New User Registration dialog.

    Enter user information in the UserDetailsbox located on the Step1tab:

    Enter the user's first and last names in the First Nameand Last Namefields.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 17

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    18/99

    Postgres Plus Cloud Database Getting Started Guide

    Enter a password for the user, and confirm the password in the Passwordand

    VerifyPasswordfields.

    Provide an email address for the user in the Emailfield; please note that the

    email address is used as the Loginidentity for the user.

    Use the drop-down listbox in the CloudProviderfield to select the host onwhich the cloud will reside.

    Enter the name of the company with which the user is associated in the Company

    Namefield.

    When you've completed Step 1, click Nextto access the Step 2tab.

    If you are using Cloud Database hosted on an Amazon EC2cloud, the Step2dialog

    opens as shown in Figure 3.3.

    Figure 3.3 - Registering a user on an Amazon EC2 cloud.

    Use the Step2dialog to provide connection information for your AmazonEC2cloud.

    Enter your Amazon Access Key Id in the AccessKeyIdfield.

    Enter your Amazon Secret Key in the SecretKeyfield.

    If necessary, you can use the FindyourEC2credentialshyperlink to connect to

    AmazonWeb Services to retrieve your credentials.

    Click the Step1tab or the Previousbutton to review or edit the information on the

    prior tab. When you've completed the fields on the NewUserRegistrationdialog,

    click Finish.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 18

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    19/99

    Postgres Plus Cloud Database Getting Started Guide

    After registering your user identity and connection information, you are ready to use the

    Login/Registerdialog (shown in Figure 3.4) to access Cloud Database.

    Figure 3.4 - The Login/Register dialog.

    Enter the registered email address in the Usernamefield, and the associated password in

    the Passwordfield, and click Loginto connect to the Cloud Database management

    console (shown in Figure 3.5).

    Figure 3.5 - The Dashboard tab of the Cloud Database management console.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 19

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    20/99

    Postgres Plus Cloud Database Getting Started Guide

    Please note: Immediately after connecting to the Cloud Database management

    console, you should download your SSH key for safekeeping. The SSH key allows

    you to establish terminal sessions directly to any server in your cluster to perform

    tasks manually, or examine (in detail) other aspects of the virtual machine.

    To download your SSH key, navigate to the Usertab of the Cloud Database

    management console, and click the Downloadsshkeybutton. When the

    download completes, ensure that the downloaded key is stored in a safe place.

    For information about connecting via SSH, seeChapter 13.2.1,Using SSH to Access

    a Server.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 20

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    21/99

    Postgres Plus Cloud Database Getting Started Guide

    4 Using the Cloud Database Console

    To access the Cloud Database management console, simply open a web browser, and

    navigate to the address provided by EnterpriseDB. Provide login information, and the

    management console opens to the Dashboardtab (shown in Figure 4.1).

    4.1 The Dashboard Tab

    The Dashboardtab provides an overview of the Cloud Database service status,

    resources, useful information links and a quick-start LaunchDBClusterbutton.

    Figure 4.1 - The Dashboard tab.

    Use the LaunchDBClusterbutton located in the GettingStartedpanel to create a

    new Postgres cluster.

    The Resourcespanel contains an overview of the activity shown on the other tabs of

    the Cloud Database management console; click a link to navigate to the listed resource.

    For example, click the Eventslink to navigate to the Clusterstab to review the event

    logs.

    The HotTopicspanel will alert you to recent feature additions; follow the links

    provided for more information.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 21

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    22/99

    Postgres Plus Cloud Database Getting Started Guide

    The ServiceStatuspanel contains a status report from the cloud provider (ie.

    Amazon EC2) that will alert you to any regional outages or ongoing maintenance.

    Click a title that is displayed in the management console bookshelf to view the contents

    of the selected Cloud Database tutorial or usage documentation.

    4.2 The Clusters Tab

    Use the Clusterstab (shown in Figure 4.2) to create, monitor and manage active

    clusters that reside in the cloud.

    Figure 4.2 - The Clusters tab.

    Status indicators on the Clusterstab provide quick visual feedback about the status of

    clusters that reside on the cloud:

    A green checkmark indicates that an object is healthy.

    A yellow alert symbol calls attention to an object that requires processing.

    A red error symbol signifies that an object is not available.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 22

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    23/99

    Postgres Plus Cloud Database Getting Started Guide

    A busy-indicator signals that the cluster is processing a request.

    A question mark indicates that the state of the resource is unknown.

    Columns in the top panel of the Clusterstab contain information about the clusters that

    reside within the cloud. Click on a column name to sort the contents of the column; click

    a second time to reverse the sort-order.

    Use the icons along the left side of the Clusterstab to create new clusters or manage

    existing clusters:

    Use the AddClustericon to create a new Postgres cluster in the cloud.

    Select the ScaleUpicon to manually add one or more replicas to the current

    cluster, or add additional storage to the current cluster servers. For information aboutmanually adding replica servers or storage, seeChapter 9,ManualScaling.

    Use the ScaleDownicon to remove one or more specified replicas from the

    cluster. For more information about using the Scale Down icon, seeSection 9.2,Manually Removing a Replica.

    Select the Backupicon to take a backup of the highlighted cluster (a singlebackup of the cluster data, and a backup of the cluster configuration).

    Please note: any custom module added to the server cluster that does not reside in the

    PGDATAdirectory is not backed up, and will be lost when the cluster is terminated.

    By default, Cloud Database monitors and propagates changes to the following

    version-specific directories:

    /opt/PostgreSQL/9.1/

    /opt/PostgresPlus/9.0AS/

    /opt/PostgresPlus/9.1AS/

    Select the Cloneicon to copy the master node of the selected database into acloneof the original master node. Use this feature to create a developer sandbox that

    is an exact duplicate of a working server; for more information about creating a clone,

    seeSection 5.1.1,Creating a Developer Sandbox.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 23

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    24/99

    Postgres Plus Cloud Database Getting Started Guide

    When you clone a database, only the master node is recreated in the new cluster; for

    information about manually adding replica servers to the new cluster, seeChapter 9,

    Manual Scaling.

    Select the Upgradeicon to instruct Cloud Database to perform a minor versionupgrade of the Postgres server that is hosting your cloud. For more information about

    performing a server upgrade, seeSection 13.6,Upgrading the Postgres Server.

    Use the ScaleMachineTypeicon to change the size of the virtual machine

    for the selected cluster. Cloud Database will copy the cluster into a new cluster of a

    different server class (i.e. RAM and CPU), and optionally re-assign the elastic IPaddress of the existing cluster to the new cluster.

    For more information about using the ScaleMachineTypedialog, seeSection 9.2,Vertically Scaling a Cluster.

    Use the DeleteClustericon to delete the currently selected cluster. A popup

    dialog will ask you to confirm your decision to terminate a cluster; once terminated, acluster may only be restored from a backup.

    By default, the box next to ReleaseelasticIPaddressis checked. Deselect

    this option if you wish to retain the elastic IP address for re-use with otherclusters. If you release the elastic IP address, it will be made available for use by

    other customers of your service provider.

    When you terminate an active cluster, backups are not deleted. Backups

    (including user data) are retained until they are selected and deleted from the

    Backupstab.

    The panels located at the bottom of the Clusterstab provide easy access to helpful

    statistical usage and activity information about the currently selected cluster.

    Four navigation bars control the display; click a panel name on the navigation bar to

    access one of the following panels:

    Select theDetailsbar to view information about the state of the selectedcluster.

    Select theConfigurationsbar to modify configuration parameters for theselected cluster.

    Select theMonitoringbar to view usage statistics for the selected cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 24

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    25/99

    Postgres Plus Cloud Database Getting Started Guide

    Select theEventsbar to review event logs describing activities on theselected cluster.

    4.2.1 The Details Panel

    Click the Detailsnavigation bar to open the Detailspanel (shown in Figure 4.5).

    Figure 4.5 - The Details panel on the Clusters tab.

    The left pane of the Detailspanel displays information about the currently selected

    cluster:

    The name of the selected cluster

    The date and time that the cluster was created The name of the user that created the cluster

    The size of the cluster

    The AWS region in which the cluster resides

    The Subnet ID of the cluster (if it resides in a virtual private cloud)

    The cluster's hardware type (the AWS server class)

    The Postgres version that resides on the server

    The name of the configuration that is currently applied to the cluster

    You can use controls on the Detailspanel to specify:

    Failover preferences for the cluster Auto-scaling thresholds for the cluster

    Backup preferences for the cluster

    When you modify the settings on the Detailspanel, Cloud Database displays a New

    valuesavednotice, confirming that the change has been saved.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 25

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    26/99

    Postgres Plus Cloud Database Getting Started Guide

    Selecting a Cluster Healing Mode

    Use the Cluster healing moderadio buttons to specify the type of failover that

    should be employed:

    Select the Replacefailedmasterwithanewmasterradio button tospecify that the cluster manager should create a new master to replace a failed

    master node.

    When replacing a failed master node with a new master node, the EBS datavolumes from the failed instance are attached to the new master node, preserving

    data integrity, while the replicas continue serving client queries.

    Select the Replacefailedmasterwithexistingreplicaradio button tospecify that the cluster manager should promote a replica node to be the new

    master node for the cluster.

    When replacing a failed master node with an existing replica, a replica node is

    marked for promotion to master node, while the other replica nodes are re-

    configured to replicate data from the new master node. Since replica nodes use

    asynchronous replication, any data that was committed to the old master node, butnot pushed to the replica prior to the node failure will be lost.

    Please note that replacing a failed master node with a new master node can take a bit

    longer than promoting a replica node to the role of master, but it does have the advantage

    of guaranteeing that no committed data will be lost. If recovery time for your cluster is

    more important than preserving any non-replicated transactions, then select Replace

    failedmasterwithexistingreplicaas the healing mode.

    Adjusting Auto-Scaling Thresholds

    Use the Auto-Scaling Thresholdscontrols on the Detailspanel to adjust the

    threshold at which Cloud Database automatically scales up cluster resources. For more

    information about using the controls, seeSection 10.1,Adjusting the Automatic Scaling

    Thresholds.

    Modifying Backup Settings

    Use the fields in the BackupSettingsbox to change your backup preferences for theselected cluster:

    Use the BackupWindowdrop-down listbox to select an optimal time to processcluster backups; specify a time when the number of clients accessing the database

    is minimal.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 26

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    27/99

    Postgres Plus Cloud Database Getting Started Guide

    Use the BackupRetentionfield to specify the number of backups that shouldbe stored for the selected cluster.

    Reviewing Cluster Connection and Status Information

    The DNSNAMEpane (located on the right side of the Detailspanel) contains a statusoverview and connection information for the selected cluster. If you have created

    replicas, the secondary server nodes are listed below the master node in the tree control;expand the tree control to view the status of the replication nodes.

    The LBPORTcolumn displays the port number to which a client applicationshould connect to utilize load balancing.

    The DBPORTcolumn displays the default listener port for the Advanced Server orPostgreSQL server.

    The CONNECTIONScolumn displays the current number of connections to thenode.

    Status indicators on the Clusterstab provide quick visual feedback about thestatus of clusters that reside on the cloud:

    A green checkmark indicates that an object is healthy.

    A yellow alert symbol calls attention to an object that requiresprocessing.

    A red error symbol signifies that an object is not available.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 27

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    28/99

    Postgres Plus Cloud Database Getting Started Guide

    4.2.2 The Configurations Panel

    Use the Configurationspanel (shown in Figure 4.6) to define, modify and apply anamed configuration.

    Figure 4.6 - The Configurations panel.

    A configuration is a named set of parameters that (when applied), change the behavior of

    a cluster by overriding the default parameters specified in the postgresql.confor

    pgpool.conffile. If possible, you should use the Configurationspanel to modify

    parameters that reside in the postgresql.confand pgpool.conffiles.

    Before making any changes to the configuration of your Cloud Database cluster, we

    recommend you reviewChapter 4.2.2.3,Best Practices for Working with Configurations.

    Using the Configurations Panel Controls

    Figure 4.7 - The Configurations panel controls.

    Use the controls along the top of the Configurationspanel (see Figure 4.7) to manage

    named configurations:

    Use the drop down list-box under Select a configurationto select aconfiguration to modify, delete or apply to specified nodes of a Cloud Database

    cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 28

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    29/99

    Postgres Plus Cloud Database Getting Started Guide

    Use the AddConfigurationbutton to create a new configuration. To create a

    new configuration, click the AddConfigurationbutton.

    Figure 4.8 - The Add Configuration dialog.

    When the AddConfigurationdialog opens (see Figure 4.8), enter the name of

    the new configuration, and click OK. When the creation of the new configuration

    is complete, Cloud Database will display the new configuration name in the

    Selectaconfigurationlistbox.

    Use the DeleteConfigurationbutton to delete the configuration specified in

    the Select a configurationdrop-down list box.

    Figure 4.9 - The Delete Selected Configuration popup.

    When the DeleteSelected Configurationpopup (shown in Figure 4.9)

    opens, click OKto confirm that you wish to delete the configuration.

    Use the radio buttons next to Masteror Replicato specify that the selectedconfiguration should be applied to the master node of the cluster, or to all of the

    replica nodes that reside within the cluster.

    Use the Applybutton to deploy a configuration on the selected node (or nodes).

    Modifying a Parameter Value

    You may not change the parameter settings shown in the Defaultconfiguration;

    instead, you must choose a configuration for modification from the Selecta

    configurationdrop-down listbox (shown in Figure 4.10).

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 29

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    30/99

    Postgres Plus Cloud Database Getting Started Guide

    Figure 4.10 - The Configurations panel, displaying a new named configuration.

    Use the tabs at the top of the parameter table to select a configuration file to modify:

    Click the postgresql.conftab to access parameters that reside in the

    postgresql.conffile.

    Click the pgpool.conftab to access parameters that control load balancing.

    To modify a parameter, right click on the parameter name, and select Editfrom the

    context menu, or double-click a parameter value in the MASTERVALUEcolumn. The

    Configuration settingdialog (shown in Figure 4.11) opens, displaying a brief

    description of the parameter and the current parameter value.

    Figure 4.11 - The Configuration setting dialog.

    Use the fields on the Configurationsettingdialog to specify a new value for the

    parameter, and to mark a parameter for deployment:

    Use the ParameterValuefield to specify a new value for the parameter.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 30

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    31/99

    Postgres Plus Cloud Database Getting Started Guide

    Check the Enabledbox to mark the parameter modification for application toyour cluster. Please note that the modification will not be deployed until you

    select the Applyoption on the Configurationscontrol panel.

    Select OKto exit the dialog and preserve changes to the configuration, or Cancelto exit

    without making any changes. Upon exiting the Configurationsettingdialog,parameters marked for deployment will display a checkmark next to the parameter name

    (if Enabled), and the new parameter value will be displayed in the MASTERVALUE

    column.

    To deploy those parameters that are marked as Enabled, click the Applybutton on the

    Configurationscontrol panel. The Applysettings dialog opens (as shown in Figure

    4.12).

    Figure 4.12 - The Apply settings dialog.

    Check the box next to the parameter file that you wish to deploy; select the OK

    button to apply any parameter modifications; click Cancelto exit without

    applying any changes.

    4.2.2.1Modifying postgresql.conf Parameters

    Parameter values in the postgresql.conffile determine Postgres server behavior as it

    pertains to:

    File Locations

    Connections and Authentication Resource Usage

    Write-Ahead Logging

    Query Planning

    Audit Logging

    Statistic Gathering

    Error Handling

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 31

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    32/99

    Postgres Plus Cloud Database Getting Started Guide

    Parameters within the postgresql.conffile also enable and determine the behavior of

    Advanced Server utilities, such as SQL Protect, Infinite Cache, and Dynatune.

    Some modifications to the postgresql.confparameters require a server restart to take

    effect, while others require a parameter reload. Parameters modified through the

    Configurationspanel (shown in Figure 4.13) will take affect when applied; if you aremodifying parameters directly on the server (via an sshconnection), you can review the

    comments in the postgresql.conffile to determine if a server restart or reload is

    required.

    For more information about manually modifying configuration files or controlling the

    server, please seeChapter 13,Cloud Database System Administration.

    Figure 4.13 - The postgresql.conf file.

    For more information about the postgresql.confparameters, please refer to the

    Postgres Plus Advanced Server Guide, available from EnterpriseDB at:

    http://www.enterprisedb.com/docs/en/9.1/asguide/Postgres_Plus_Advanced_Server_Guide-07.htm - P601_23230

    4.2.2.2Modifying pgpool.conf Parameters

    Use the parameters shown on the pgpool.conftab (shown in Figure 4.14) to modify

    Cloud Database server behavior related to load balancing.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 32

    http://www.enterprisedb.com/docs/en/9.1/asguide/Postgres_Plus_Advanced_Server_Guide-07.htm%23P601_23230http://www.enterprisedb.com/docs/en/9.1/asguide/Postgres_Plus_Advanced_Server_Guide-07.htm%23P601_23230http://www.enterprisedb.com/docs/en/9.1/asguide/Postgres_Plus_Advanced_Server_Guide-07.htm%23P601_23230
  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    33/99

    Postgres Plus Cloud Database Getting Started Guide

    Figure 4.14 - The pgpool.conf file.

    Modifications to the pgpool.conffile do not require a Postgres server restart; the

    parameters are automatically updated when you save the configuration file withoutinterrupting current users.

    By default, all write transactions are routed to the master node of the Cloud Database

    cluster; replica nodes can execute read-only queries. The white_function_listand

    black_function_listparameters specify the names of Postgres functions or user-

    defined functions that may be invoked (or not invoked) on a replica node.

    The white_function_listspecifies functions that may be executed on replicanodes. Any function not specified on the list is assumed to be unsafe forexecution by a replica.

    The black_function_listspecifies functions that will not be executed onreplica nodes. Any function not specified on the list is assumed to be safe forexecution by a replica.

    Though the Postgres nextval()and setval()functions can be invoked via a

    SELECTstatement, they perform a write function, modifying the state of the

    database by incrementing a sequence. By default, Cloud Database includes these

    functions in the black_function_listto prevent them from executing on a

    replica node. If you have user-defined functions that should (similarly) not be

    executed on a replica node, you should add the function name to the

    black_function_list.

    Please note that you can specify either a white_function_listor a

    black_function_list, but not both.

    The reset_query_listparameter specifies the SQL commands sent toreset the connection to the backend when exiting a session. Use a semi-

    colon as a delimiter when specifying multiple commands (;). The default

    value of reset_query_listis ABORT; DISCARD ALL.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 33

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    34/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    35/99

    Postgres Plus Cloud Database Getting Started Guide

    require a server restart or reload. The documentation also includes detailed sections

    about using the parameters that affect:

    Performance

    Resource Consumption and Memory

    Query Planning and Optimizer Hints Error Reporting and Logging

    Oracle Compatibility settings

    Advanced Server feature-specific settings

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 35

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    36/99

    Postgres Plus Cloud Database Getting Started Guide

    4.2.3 The Monitoring Panel

    The Monitoringpanel displays graphs that allow you to review statistical usageinformation about the amount of storage and the CPU load for the selected cluster (see

    Figure 4.15 ).

    Figure 4.15 - The Monitoring panel displays usage information.

    Use the TimeRangedrop-down listbox to modify the time period that the charted

    information on the Monitoringpanel spans.

    The graphs on the Monitoringpanel display resource usage information:

    The DataSpacechart displays the amount of allocated data space used by the

    selected cluster. The red line denotes the threshold specified by the DataSpaceThresholdslider on the Detailspanel (the threshold at which the cluster willbe scaled-up). The blue line indicates the amount of the data space that is

    currently in use.

    The Connectionschart displays a graph of the number of connections to thecluster during the selected time range. The red line denotes the threshold

    specified by the Connectionsslider on the Detailspanel.

    The CPULoadchart displays the processing load placed on the CPU byconnecting clients. The value displayed is the actual load average as read from

    the CentOS program, /proc/loadavg. The chart shows the number of jobs inthe run queue (state R) or waiting for disk I/O (state D), averaged over 15 minute

    periods.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 36

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    37/99

    Postgres Plus Cloud Database Getting Started Guide

    4.2.4 The Events Panel

    The Eventspanel (shown in Figure 4.16) displays an event log containing a history ofselected events for the connected user.

    Figure 4.16 - The Events panel displays server activity.

    Highlight a cluster name to display only events for that cluster; if you do not select a

    cluster, the Eventspanel will display the collected events for the connected user.

    Click a column heading to sort the logged activity by the selected column; clickagain to reverse the sort order.

    Use a mouse to select multiple rows from the event log for copy and pasteoperations.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 37

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    38/99

    Postgres Plus Cloud Database Getting Started Guide

    4.3 The Backups Tab

    Use the Backupstab (shown in Figure 4.17) to manage cluster backups; the tab displays

    a list of the available backups.

    Figure 4.17 - The Backups tab of the Cloud Database console.

    A backup captures and stores the status and condition of a cluster at a specific point-in-

    time. Click a column heading to sort the column contents; click again to reverse the sortorder.

    Use the icons on the left side of theBackups

    tab to restore or delete backups:

    Highlight a backup in the list, and click the RecoverBackupicon to open a

    dialog that allows you to restore a cluster from the selected backup. Specify a

    name for the cluster, and click the Recoverbutton to continue. A popup

    confirms that the cluster is being restored; close the popup and navigate to the

    Clusterstab to monitor the restoration process.

    Highlight a backup in the list and click the DeleteBackupicon to delete

    the selected backup. A popup will ask you to confirm that you wish to delete thebackup before the backup is actually deleted.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 38

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    39/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    40/99

    Postgres Plus Cloud Database Getting Started Guide

    The NotificationEmailfield displays the email address that receives messages about

    changes in the state of a running cluster. By default, the notification email address is the

    address supplied in the UserIDfield when registering with Cloud Database. To change

    the notification email address, enter a new address in the NotificationEmailfield,

    and click the ApplyChangesbutton. A popup dialog will open, prompting you to enter

    your password to confirm the change of address (see Figure 4.20).

    Figure 4.20 - Confirming a change in the notification email address.

    Enter your password, and click Confirmto modify the address, or click Cancelto exit

    the popup without applying the change.

    Figure 4.21 - The notification email address has been modified.

    If you elect to change the notification email address, Cloud Database will send a

    confirmation email to both the old notification address and the new notification address(see Figure 4.21).

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 40

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    41/99

    Postgres Plus Cloud Database Getting Started Guide

    Click the ChangePasswordbutton to open a dialog that allows you to change the

    password for the current user (see Figure 4.22).

    Figure 4.22 - The Change Password dialog.

    Provide the current user password in the CurrentPasswordfield, and enter the new

    password in the NewPasswordfield and ConfirmNewPasswordfield. Click

    Confirmto change the password, or Cancelto exit the dialog without modifying the

    existing password.

    Figure 4.23 - The password has been changed.

    A popup confirms that the change was successful (as shown in Figure 4.23).

    Use the DownloadSSHKeybutton to download the private key file for the current user.

    The SSH key allows you to establish terminal sessions directly to any server in your

    cluster to perform tasks manually, or examine (in detail) other aspects of the virtual

    machine.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 41

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    42/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    43/99

    Postgres Plus Cloud Database Getting Started Guide

    You can adjust the amount of storage used by the cluster, or number of replicas in

    the cluster as your resource demands change. For example, you can start with a

    m1.small instance to reduce development costs, and later, easily upgrade to a

    more capable c1.mediuminstance as your performance requirements dictate.

    If the new cluster should use an address on a virtual private cloud, specify thesubnet identity of the VPC in the SubnetIDfield. To create a subnet or locate

    the subnet identity associated with a virtual private cloud, select the Subnets

    menu option on the Amazon VPC management dashboard.

    Use the drop-down listbox in the Numberofnodesfield to specify the number

    of server nodes that you wish to create. The name specified in the Cluster

    Namefield will apply to the master node; each additional node will act as a

    replication server for the master node.

    Use the StorageGBfield to specify the initial size of the data space (in

    Gigabytes).

    Enter the name of the cluster owner in the MasterUserfield.

    Enter the password associated with the name in the MasterPasswordfield.

    Click the Nextbutton to continue to the Step2tab (shown in Figure 5.2).

    Figure 5.2 - Specify backup information on the Step2tab.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 43

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    44/99

    Postgres Plus Cloud Database Getting Started Guide

    Use the fields on the Step2tab to specify additional database information:

    Use the # of Backups to retainfield to specify the number of serverbackups stored. When the specified number of server backups is reached, Cloud

    Database will delete the oldest backup to make room for a new backup.

    Use the BackupWindowfield to specify a time that it is convenient to backup theserver (you may wish to schedule backups to occur when the CPU load is the

    lightest).

    Use the Previousbutton or select a tab to return to the Step 1tab to review or update

    information; when you have completed the CreateaNewServerdialog, click Launch

    to create the database cluster.

    A popup dialog confirms that Cloud Database is creating a new cluster (see Figure 5.3);

    click the Xin the upper-right corner of the popup to close the popup.

    Figure 5.3 - A popup confirms that the new cluster is being created.

    Navigate to the Clusterstab of the Cloud Database console to monitor the creation of

    the cluster.

    The default security rules for a newly-created cluster specify that port 9999(the load

    balancing port) is open for connections from any IP address. You can customize thesecurity rules to selectively restrict the IP address/es from which the server will accept

    connections. For detailed information about modifying the security group to restrict

    access from unknown IP addresses, seeSection 13.3,Securing a Cloud Database Cluster.

    Each database server is created with the default parameter settings that are displayed in

    the Configurationspanel of the Clusterstab. You can use the Configurations

    panel to create one or more named configurations that contain customized parameter

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 44

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    45/99

    Postgres Plus Cloud Database Getting Started Guide

    values that, when applied to a cluster will override the default parameters specified in the

    postgresql.confand pg_hba.conffile.

    5.1.1 Creating a Developer Sandbox

    With a few simple steps, you can create a developer sandbox that is an exact duplicate ofthe original master node:

    1. Navigate to the Clusterstab.

    2. Highlight the name of the cluster you wish to clone into the sandbox.

    3. Click the Cloneicon located on the left side of the window.

    Figure 5.11 - Creating a clone of a database.

    When the Create clone...dialog (shown in Figure 5.11) opens, specify a name for

    the clone in the ClusterNamefield, a subnet identity in the SubnetIDfield (if

    applicable), and use the ServerClassdrop-down listbox to specify the size of the new

    cluster.

    When you've completed the dialog, click the Clonebutton to create the sandbox.

    When you clone a database, only the master node is recreated in the new cluster; for

    information about manually adding replica servers to the new cluster, seeChapter 9,Manual Scaling.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 45

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    46/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    47/99

    Postgres Plus Cloud Database Getting Started Guide

    more information about modifying a security group, please seeSection 13.3,

    Securing a Cloud Database Cluster.

    Use the authentication information (MasterUserand MasterPassword) provided on

    the CreateaNewServerClusterdialog to establish the initial connection as the

    database superuser, using a client application (such as EDB-PSQL or Postgres EnterpriseManager). Please note that connecting with this identity grants you superuser privileges

    on the server; you should not share this connection information with un-trusted users.

    After connecting as the database superuser, you should create lesser-privileged user roleswith which non-administrative users will connect.

    For detailed information about connecting to a Cloud Database cluster with ssh, edb-

    psql(or psql), or the Postgres Enterprise Manager client (including pgAdmin), please

    seeSection 13.2,Connecting to the Cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 47

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    48/99

    Postgres Plus Cloud Database Getting Started Guide

    7 Managing Backups and Recovery

    When you take a backup, Cloud Database makes a copy of the contents of the

    PostgreSQL PGDATAdirectory. The PGDATAdirectory contains the data and the meta-

    data required to construct an exact copy of the Postgres data cluster (the data and thedatabase objects that reside within that Postgres instance).

    To capture a backup of a cluster, navigate to the Clusterstab, highlight a name in

    the cluster list, and click the Backupicon.

    Figure 7.1 - The Backup Data? dialog.

    You can include a reference note about the backup that can be viewed on the Backups

    tab by adding a message to the Optionalnotesfield on the BackupData?dialog

    before clicking the Backupbutton (see Figure 7.1).

    When you click the Backupbutton, Cloud Database will perform the backup. While

    Cloud Database performs the backup, the PENDINGcolumn of the selected cluster (on the

    Clusterstab) will display the message, Backupinprogress.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 48

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    49/99

    Postgres Plus Cloud Database Getting Started Guide

    7.1 Reviewing Stored Backups

    Navigate to the Backupstab (shown in Figure 7.2) to review a list of stored cluster

    backups.

    Figure 7.2 - The Backups tab of the Cloud Database console.

    A backup captures and stores the status and condition of a cluster at a specific point-in-

    time.

    The IDcolumn contains a unique backup identifier.

    The CLUSTERcolumn displays the name of the cluster that was the target of thebackup.

    The NOTEScolumn displays an informational note (provided by either the user orthe system at the time of backup).

    The ENGINE VERSIONcolumn contains a description of the Postgres version thatthe saved cluster is using.

    The CAPACITYcolumn contains the storage capacity of the cluster at the time thatthe backup was taken.

    The STARTEDcolumn displays the date and time that the backup was initiated.

    The ENDEDcolumn displays the data and time that the backup completed.

    You can use the icons on the left side of the Backupstab to restore or delete the selected

    backup:

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 49

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    50/99

    Postgres Plus Cloud Database Getting Started Guide

    Highlight a backup in the list, and click the RecoverBackupicon to open a

    dialog that allows you to restore a cluster from the selected backup.

    Highlight a backup in the list and click the DeleteBackupicon to deletethe selected backup. A popup will ask you to confirm that you wish to delete the

    specified backup before it is actually deleted.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 50

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    51/99

    Postgres Plus Cloud Database Getting Started Guide

    7.2 Restoring a Cluster from Backup

    You can restore a cluster, recovering the state of a cluster at the time that a selected

    snapshot was taken, or use the restoration process to create a developer sandbox. To

    restore a cluster, navigate to the Backupstab, and highlight the backup to be restored in

    the onscreen list.

    Click the RecoverBackupicon, located on the left side of the window.

    Figure 7.3 - The Recover Data from a Backup dialog.

    When the RecoverData dialog (shown in Figure 7.3) opens, specify a name for the

    restored cluster, provide a subnet identity in the SubnetIDfield (if applicable), and

    click the Recoverbutton to continue.

    A popup confirms that the cluster is being restored (see Figure 7.4); close the popup andnavigate to the Clusterstab to monitor the restoration process.

    Figure 7.4 The recovery is in progress.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 51

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    52/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    53/99

    Postgres Plus Cloud Database Getting Started Guide

    8 Automatic Failover

    The Cloud Database cluster manager constantly monitors the state of each cluster. Each

    cluster is composed of a single master Postgres instance that operates in read-write mode

    (performing all writes to the database) and one or more replica Postgres instances.Replica nodes are read-only, automatically duplicating all data found on the master node,

    and all changes made to that data.

    If a replica fails, the cluster continues operating, with the master servicing writes and

    reads, and the remaining replicas servicing reads. Overall read performance may degrade

    for a short period of time until the replica is replaced, bringing the cluster to full strengthagain. During failover, Cloud Database automatically spins up a new replica instance

    and attaches it to the master database.

    If a master failover occurs, the server will enforce one of two behaviors, specified by the

    Clusterhealingmoderadio buttons, located on the Detailspanel:

    Select the Replacefailedmasterwithanewmasterradio button tospecify that the cluster manager should create a new master to replace a failedmaster node. This is the default behavior.

    When replacing a failed master node with a new master node, the EBS data

    volumes from the failed instance are attached to the new master node, preserving

    all transactions that were committed on the master.

    Select the Replacefailedmasterwithexistingreplicaradio button to

    specify that the cluster manager should promote a replica node to be the newmaster node for the cluster. Choose this option when speed of recovery is

    important, and your application can tolerate the loss of some transactions.

    When replacing a failed master node with an existing replica, a replica node is

    marked for promotion to master node, while the other replica nodes are re-configured to replicate data from the new master node. Since replica nodes use

    asynchronous replication, any data that was committed to the old master node, but

    not yet pushed to the replica prior to the node failure will be lost.

    If you opt to promote a replica to replace the master node, a replacement replica

    will also be added to the cluster during the failover process, returning the clusterto full strength. This self-healing property is at the heart of providing high

    availability to cluster users.

    Please note that replacing a failed master node with a new master node can take a bit

    longer than promoting a replica node to the role of master, but it does have the advantageof guaranteeing that no committed data will be lost.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 53

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    54/99

    Postgres Plus Cloud Database Getting Started Guide

    Triggering a Failover

    The only condition that will trigger Cloud Database to initiate a failover is when the

    Service Provider (e.g. Amazon Web Services) reports that the instance is down. Missing

    heartbeats from the Cloud Database instance do not trigger a failover; a missing heartbeat

    may merely be a sign of interrupted communication, rather than a complete instancefailure.

    By design, Cloud Database does *not*perform a failover when the Postgres server is

    stopped, because the server stop or restart may be intentional:

    A user may intentionally restart the server when performing maintenance oftuning. For example, a server restart is required when updating server

    configuration parameters; this restart will not invoke failover.

    If a user intentionally kills the postmasterprocess, the server will not failover;

    the postmasterprocess is responsible for restarting the server.

    The Postgres server may intentionally perform a server restart. For example,when a backend server process crashes (or is intentionally killed by a user), thePostgres server automatically invokes a restart.

    When a failover is complete, the original master instance of the database server will

    still be available on Amazon EC2, allowing you to perform any post-mortem

    activities that may be required. If you do not wish to utilize the preserved instance,

    you should use the Amazon management console to delete the instance.

    Please note: A cluster will not fail-over to an existing replica, if the name of that replicahas been changed (in the AWS console) from the original Cloud Database generated

    name; when you change a cluster name, the cluster manager is unable to identify this

    instance as part of the cluster.

    Modifying Termination Protection in the AWS console

    The Amazon Management console's context menu (accessed by right-clicking on an

    instance name) allows you to modify the termination protection for your CloudDatabase cluster.

    Please note that enabling termination protection through the Amazon Management

    console will interfere with normal Cloud Database functions such as failover,

    scaling-up, or upgrading your cluster. You should neverenable termination

    protection.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 54

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    55/99

    Postgres Plus Cloud Database Getting Started Guide

    9 Manual Scaling

    The Cloud Database console makes it simple to add replicas and storage to an existing

    cluster, or to upgrade to a larger server class (i.e. vertical scaling).

    Adding additional replicas to your database cluster increases the CPU poweravailable to handle additional client requests or applications, increasing the

    number of client connections that can be serviced. When the scale up is complete,

    each additional replica automatically assumes a share of the read-only workload

    from incoming queries.

    Adding additional storage to the cluster increases the amount of data that can bestored by the database servers. When you add additional storage to the cluster,each member of the cluster gets the additional storage amount.

    Vertically scaling to a larger server class increases the processing capabilities ofyour cluster, allowing the server to process customer requests with greater speed.

    During vertical scaling, you can move the elastic IP of the old cluster to the new

    cluster, making the migration to a larger server class transparent to connectingclients.

    You can also downsize a cluster by selectively removing a replica.

    9.1 Manually Adding Replicas and Storage

    Cloud Database's ScaleUpdialog makes it simple to manually add additional replicas toa cluster if you find that server resources are strained. The dialog also allows you toincrease the amount of storage available to a cluster.

    If you specify that Cloud Database should add both storage and replicas, Cloud Databasewill process the request for additional storage beforeadding replicas to the cluster. All of

    the nodes on the cluster will be of the newly specified storage size.

    To add a replica or storage space to a cluster, navigate to the Clusterstab, and

    select the ScaleUpicon. The Scale Updialog opens as shown in Figure 9.1.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 55

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    56/99

    Postgres Plus Cloud Database Getting Started Guide

    Figure 9.1 - The Scale Up dialog.

    Use the drop-down listboxes on the Step 1tab to specify:

    The number of replicas to add to the cluster.

    The amount of storage memory (in Gigabytes) that will be added to each server inthe cluster.

    When you've completed the dialog, click Nextto continue to the Step 2tab (shown in

    Figure 9.2).

    Figure 9.2 - The Scale Up dialog.

    Click the Previousbutton to return to the Step1tab to modify specified values, or

    click the Xin the upper corner of the dialog to exit without saving modifications to the

    server. Use the ScaleUpbutton to confirm that you wish to add the specified number of

    replication servers or the specified amount of memory to the cluster, or the Cancel

    button to exit without modifying the cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 56

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    57/99

    Postgres Plus Cloud Database Getting Started Guide

    Figure 9.3 - Scaling up is in progress.

    Cloud Database will confirm that replicas or memory are being added to the cluster (asshown in Figure 9.3).

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 57

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    58/99

    Postgres Plus Cloud Database Getting Started Guide

    9.2 Manually Removing a Replica

    Cloud Database's ScaleDowndialog makes it simple to manually remove one or more

    unneeded replicas from a cluster.

    To delete a replica, navigate to the Clusterstab, and click the ScaleDownicon

    (shown above). The ScaleDowndialog opens as shown in Figure 9.4.

    Figure 9.4 - The Scale Down dialog.

    Check the box to the left of the name of a replica, and click Nextto proceed to the Step

    2tab of the dialog (shown in Figure 9.5).

    Figure 9.5 - The Step 2 tab of the Scale Down dialog.

    Click Scale Downto confirm that you wish to remove the replica, or Previousto

    return to the Step 1tab. Select Cancelto exit the dialog without modifying the

    cluster.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 58

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    59/99

    Postgres Plus Cloud Database Getting Started Guide

    9.3 Manually Changing the Server Class

    When your RAM processing needs, CPU power, or other circumstances warrant a larger

    virtual machine for your application, you can vertically scale to a larger server class by:

    Using the ScaleMachineTypedialog to copy the cluster into a larger AmazonServer Class.

    When you use the ScaleMachineTypedialog to move your cluster into a

    larger server class, you must provide an alternate name for the upgraded cluster.You can also use the dialog to specify that Cloud Database should re-assign the IP

    address of the cluster, so the upgrade will be transparent to connecting clients.

    Please note: you may wish to postpone the IP address reassignment to perform

    configuration tasks or test the new server size.

    Using the pg_dumpand pg_restoreutilities to move the cluster into a largerserver class.

    To move to a larger server class, use the pg_dumputility to make a backup of the

    cluster on a local system. After backing up the cluster, create a new instance with

    the larger server class, and use pg_restoreto restore the cluster on the new

    instance. For more information about using pg_dumpand pg_restore, seeSection 13.1,Moving an Existing Database into a New Cluster.

    When you vertically scale your cluster with the ScaleMachineTypedialog, CloudDatabase will copy the existing cluster into a new cluster of a different server class, andoptionally re-assign the elastic IP address of the existing cluster to the new cluster.

    To open the ScaleMachineTypedialog, navigate to the Clusterstab, and

    select the ScaleMachineTypeicon.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 59

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    60/99

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    61/99

    Postgres Plus Cloud Database Getting Started Guide

    10 Automatic Scaling

    When auto-scaling in enabled, Cloud Database monitors the server storage and

    connection resources in use, and automatically adds additional resources when usage

    exceeds a user specified percent (by default, 90%). Controls on the Detailspanel of theClusterstab makes it easy to adjust the threshold at which Cloud Database

    automatically scales up resources.

    When the DataSpaceThresholdis reached, Cloud Database adds additionalstorage space.

    When the ConnectionThresholdis reached, Cloud Database adds replicanodes.

    Adding additional replicas to your database cluster increases the number of client

    connections and queries that each cluster can handle, while maintaining a high-level ofoverall performance. Each additional replica automatically assumes a share of the read-

    only workload from incoming queries.

    10.1 Adjusting the Automatic Scaling Thresholds

    Use the Auto-Scaling Thresholdscontrols (located on the Detailspanel) to

    adjust the threshold at which Cloud Database automatically scales up cluster resources.

    To access the Detailspanel, navigate to the Clusterstab, and highlight the name of a

    cluster. Click the Detailsnavigation bar on the Clusterstab to open the Details

    panel for the cluster (shown in Figure 10.1).

    Figure 10.1 - The Details panel on the Clusters tab.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 61

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    62/99

    Postgres Plus Cloud Database Getting Started Guide

    Adjust the Auto-ScalingThresholdssliders to increase or decrease the thresholds at

    which automatic scaling is invoked. When you modify the values, Cloud Database will

    display a NewValueSavednotice, alerting you that your changes have been saved.

    Auto-scaling is enabled by default; when auto-scaling is enabled, Cloud Database will

    automatically increase your data space by 50% when the disk usage exceeds the valuespecified by the DataSpaceThresholdslider. To disable auto-scaling, un-check the

    Auto-Scalingcheckbox.

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 62

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    63/99

    Postgres Plus Cloud Database Getting Started Guide

    11 Load Balancing

    Cloud Database uses pgPool functionality to implement automatic load balancing. Load

    balancing increases system performance by distributing client queries to replica nodes,

    while routing database modifications to the master node. Any modifications to themaster node are subsequently propagated to each replica using Postgres streaming

    replication.

    Utilizing Load Balancing

    By default, load balancing is enabled on a Cloud Database cluster. To utilize load

    balancing, you should direct client applications to connect to the load balancing port (by

    default, 9999). A cluster's load balancing port number is displayed in the LBPORT

    column on the Detailspane of the Clusterstab of the Cloud Database management

    console.

    pgPool may direct the following statement types to eithera primary or a standby node:

    SELECT statements (not listed below)

    COPY TO

    DECLARE

    FETCH

    CLOSE

    SHOW

    SET

    DISCARD

    DEALLOCATE ALL

    When deciding which node a query should be routed to, pgPool checks the transaction

    log number; if the transaction log number on the standby server is lower than the lognumber on the master, pgPool routes the statement to the master node. This helps to

    ensure that the data returned by the query is the most recent available.

    In some cases, specific clauses within a query statement will signal pgPool to direct a

    statement to the master node. In other cases, the transaction type, or order of commands

    within a transaction can direct a statement to the master node. By default, the followingtransaction types will always be executed on the master node:

    SELECTINTO,SELECT FOR UPDATEor SELECTFOR SHAREstatements

    SELECTstatements within SERIALIZABLEtransactions

    SELECTstatements that follow an INSERTstatement

    SETSESSIONCHARACTERISTICSASTRANSACTIONREADWRITEstatements

    SET transaction_read_only = offstatements

    EXPLAINand EXPLAIN ANALYZE SELECTstatements

    Copyright 2011 - 2014 EnterpriseDB Corporation. All rights reserved. 63

  • 8/10/2019 Postgres Plus Cloud Database Getting Started Guide 20140121

    64/99

    Postgres Plus Cloud Database Getting Started Guide

    STARTTRANSACTIONREADWRITEstatements

    LOCKcommands that are stricter than ROWEXCLUSIVEMODE

    Transactions that start with a BEGINstatement

    The nextval()and setval()sequence functions

    Large objects creation commands

    Please Note: If your application uses JDBC, and the autocommit option is set to false,

    the JDBC driver will include a BEGINand COMMITstatement with each SELECT

    statement. To enable load balancing when using the JDBC driver, your application must

    include a call to setAutoCommit(true).

    pgPool directs the following non-query statement types to the master node only:

    INSERT

    UPDATE

    DELETE COPYFROM

    TRUNCATE

    CREATE

    DROP

    ALTER

    COMMENT

    PREPARETRANSACTION

    COMMITPREPARED

    ROLL