Cinema Movies | Domestic na Kanojo chap 139 | The Stolen Dog
EDB Failover Manager Guide December 17, 2013

EDB Failover Manager Guide

EDB Failover Manager Guide, Version 1.0 by EnterpriseDB Corporation Copyright © 2013 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 E [email protected] www.enterprisedb.com

Copyright © 2013 EnterpriseDB Corporation. All rights reserved.

EDB Failover Manager Guide

Table of Contents 1

Introduction ................................................................................................................. 4 1.1

2

3

Typographical Conventions Used in this Guide ................................................. 5

Failover Manager - Overview ..................................................................................... 6 2.1

Supported Platforms............................................................................................ 7

2.2

Prerequisites ........................................................................................................ 7

Installing and Configuring Failover Manager............................................................. 9 3.1

Configuring Failover Manager ........................................................................... 9

3.1.1

Encrypting Your Database Password............................................................ 10

3.1.2

Specifying Cluster Properties ....................................................................... 10

3.2

Using Failover Manager with Virtual IP Addresses ......................................... 16

3.3

Running Multiple Agents on a Single Node ..................................................... 18

4

Running Failover Manager ....................................................................................... 21

5

Controlling Logging.................................................................................................. 24

6

Notifications............................................................................................................. 25

7

8

Use Case Diagrams .................................................................................................. 28

7.1

Running ppfm start-agent cluster_name ........................................................... 28

7.2

Running ppfm stop cluster_name ..................................................................... 29

7.3

Running ppfm promote cluster_name ............................................................... 29

Failover vs. Failure Detection ................................................................................... 32 8.1

Supported Failover Scenarios ........................................................................... 32

8.1.1

Failover Scenario 2 - Master Database Node Failure ................................... 33

8.1.2

Failover Scenario 1 - Master Database is Down, While Host Remains Up . 35

8.2

9

Supported Failure Scenarios ............................................................................. 37

8.2.1

Failure Scenario 1 - Failover Manager Master Agent Exits ......................... 37

8.2.2

Failure Scenario 2 - Failover Manager Standby Agent Exits ....................... 38

8.2.3

Failure Scenario 3 - Standby Database is Down ........................................... 39

8.2.4

Failure Scenario 4 - Standby Node Failure ................................................... 40

8.2.5

Failure Scenario 5 - Failover Manager Witness Agent Exits / Node Fails ... 41

Feedback ................................................................................................................... 42

Copyright © 2013 EnterpriseDB Corporation. All rights reserved.

EDB Failover Manager Guide

1 Introduction EDB Failover Manager is a high-availability module from EnterpriseDB that enables a Postgres Master node to automatically failover to a Standby node in the event of a software or hardware failure on the Master. This guide provides information about installing, configuring and using Failover Manager. This document uses Postgres to mean either the PostgreSQL or Postgres Plus Advanced Server database. For more information about using Postgres Plus products, please visit the EnterpriseDB website at: http://www.enterprisedb.com/documentation We are very interested in hearing your feedback about Failover Manager. Please send all feedback about Failover Manager to the following address: [email protected]

Copyright © 2013 EnterpriseDB Corporation. All rights reserved. 4

EDB Failover Manager 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 term refers to any word or group of words that are language keywords, user-supplied values, literals, etc. A term’s exact meaning depends upon the context in which it is used. •



• • • • •

Italic font introduces a new term, typically, in the sentence that defines it for the first time. Fixed-width (mono-spaced) font is 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 * FROM

emp;

Italic fixed-width font is used for terms for which the user must substitute values in actual usage. For example, DELETE FROM table_name; A vertical pipe | denotes a choice between the terms on either side of the pipe. A vertical 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 © 2013 EnterpriseDB Corporation. All rights reserved. 5

EDB Failover Manager Guide

2 Failover Manager - Overview A Failover Manager (FM) cluster is comprised of FM processes that reside on the following hosts on a network: •

Master - The Master node is the primary database server that is servicing database clients.



Standby - The Standby node is a streaming replication server associated with the Master.



Witness - The Witness node confirms assertions of either the Master or the Standby in a failover scenario.

Traditionally, the expression cluster refers to a single instance of Postgres managing multiple databases. In this document, the term cluster refers to a Failover Manager cluster. A Failover Manager cluster consists of a Master agent, a Standby agent, and a Witness agent that reside on servers in a cloud or on a traditional network and communicate using the JGroups toolkit.

Figure 2.1 - A FM scenario employing a Virtual IP address. Copyright © 2013 EnterpriseDB Corporation. All rights reserved. 6

EDB Failover Manager Guide

JGroups provides technology that allows Failover Manager to create clusters whose member nodes can communicate with each other and detect node failures. For more information about JGroups, visit the official project site at: http://www.jgroups.org Each Failover Manager cluster on your network must have a unique name. The cluster name is the user-defined prefix of the name of the cluster properties file (discussed in Section 3.1). The cluster name is used to manage the cluster using the ppfm command when you invoke the ppfm command, you must provide an argument and the cluster name that matches the prefix of the cluster properties file. Please note that the cluster properties file name must be the same on each node of the cluster (the Master node, the Standby node, and the Witness node). Figure 2.1 illustrates a Failover Manager cluster that employs a virtual IP address. You can use a load balancer in place of a virtual IP address if you provide your own fencing script to re-configure the load balancer in the event of a failure. For more information about using Failover Manager with a virtual IP address, see Section 3.2. For more information about using a fencing script, see Section 3.1.

2.1 Supported Platforms Failover Manager is supported on Postgres Plus Advanced Server or PostgreSQL (version 9.0 and higher) installations running on the following 64-bit Linux platforms: •

CentOS 6.x



Red Hat Enterprise Linux 6.x

2.2 Prerequisites Before configuring a Failover Manager cluster, you must satisfy the prerequisites described below. Provide an SMTP Server Failover Manager sends notification emails to the email address specified in the cluster properties file. An SMTP server must be running on each node of the Failover Manager scenario. Configure Streaming Replication Failover Manager requires that PostgreSQL streaming replication be configured between the Master node and the Standby node. Failover Manager does not support other types of replication. For more information about streaming replication, see the PostgreSQL core documentation at http://www.enterprisedb.com/warm-standby.html . Copyright © 2013 EnterpriseDB Corporation. All rights reserved. 7

EDB Failover Manager Guide

Modify the pg_hba.conf File You must modify the pg_hba.conf file on the Master and Standby nodes, adding entries that allow communication between the Master, Standby and Witness servers. The following example demonstrates entries that might be made to the pg_hba.conf file on the Master node: # access for itself host fmdb ppfm 127.0.0.1/32 # access for standby host fmdb ppfm 127.0.0.1/32 # access for witness host fmdb ppfm 127.0.0.1/32

md5 md5 md5

Where: ppfm specifies the name of a valid database user. fmdb specifies the name of a database to which the ppfm user may connect.

The specified user must have read permission on the database specified by the db.database parameter in the properties file. For more information about the properties file, see Section 3.1. By default, the pg_hba.conf file resides in the data directory, under your Postgres installation. After modifying the pg_hba.conf file, you must reload the configuration file on each node for the changes to take effect. You can use the following command: /etc/init.d/ppas-9.x reload

Where x specifies the Postgres version. Ensure Communication Through Firewalls If a Linux firewall (i.e. iptables) is enabled on the host of a Failover Manager node, you may need to add rules to the firewall configuration that allow tcp communication between the PPFM processes in the cluster. For example: iptables -I INPUT -p tcp --dport 7800:7810 -j ACCEPT /sbin/service iptables save

The command shown above opens a small range of ports (7800 through 7810). Failover Manager will connect via the port that corresponds to the port specified in the cluster properties file. Other ports will be used for command line interface commands that need to connect to the cluster (for example, ppfm status cluster_name). Copyright © 2013 EnterpriseDB Corporation. All rights reserved. 8

EDB Failover Manager Guide

3 Installing and Configuring Failover Manager Failover Manager is packaged and delivered as an RPM. To install Failover Manager, copy the RPM package to the Master, Standby and Witness systems. After copying the archive to each system, use yum to install the package: yum install ppfm10-1.0.0-1.noarch.rpm

Please note: ppfm commands should be run as root, or as a user with root privileges. Failover Manager File Locations Failover Manager components are installed in the following locations: • • • • • •

Executables: /usr/ppfm-1.0/bin (symbolically linked to /usr/bin) Libraries: /usr/ppfm-1.0/lib Cluster configuration files: /etc/ppfm-1.0 Logs: /var/log/ppfm-1.0 Lock files: /var/lock/ppfm-1.0 Log rotation file: /etc/logrotate.d/ppfm-1.0

3.1 Configuring Failover Manager After installing Failover Manager RPM, you must create a cluster properties file. On each system in the cluster, copy the cluster properties file template to a file that is prefaced with the name of your cluster. The cluster properties file template is named ppfm.properties and is located in the /etc/ppfm-1.0 directory. For example, the following command creates a properties file for a cluster named employees: cp /etc/ppfm-1.0/ppfm.properties /etc/ppfm-1.0/employees.properties

The new cluster properties file must reside in the /etc/ppfm-1.0 directory. The properties file name must be the same on each node of the cluster (the Master node, the Standby node, and the Witness node). After creating the cluster configuration file, add (or modify) configuration parameter values as required. For detailed information about each parameter, see Section 3.1.2, Specifying Cluster Properties. Note that you must use the ppfm encrypt utility to encrypt the value supplied in the db.password.encrypted parameter. Copyright © 2013 EnterpriseDB Corporation. All rights reserved.

9

EDB Failover Manager Guide

3.1.1 Encrypting Your Database Password Failover Manager requires that you encrypt your database password before including it in the cluster properties file. To encrypt the password, you must use the Failover Manager encryption utility described below. To encrypt a password, open a command line, assume superuser privileges, and enter the command: # ppfm encrypt cluster_name

The encrypt utility will prompt you to enter the database password twice before generating an encrypted password for you to place in your cluster property file. When the utility shares the encrypted password, copy and paste the encrypted password into all of the cluster property files. The following example demonstrates using the encrypt utility to encrypt a password for the acctg cluster: # ppfm encrypt acctg This utility will generate an encrypted password for you to place in your PPFM cluster property file (/etc/ppfm-1.0/acctg.properties). Please enter the password and hit enter:

EDB_Failover_Manager_Guide_1.0.pdf

Copyright © 2013 EnterpriseDB Corporation. All rights reserved. Page 3 of 42. Main menu. Displaying EDB_Failover_Manager_Guide_1.0.pdf. Page 1 of 42.

803KB Sizes 0 Downloads 4 Views

Recommend Documents

No documents