edb slony replication guide - enterprisedb...edb slony replication guide edb slony replication is a...

32
EDB Slony Replication Guide EDB Slony Replication Guide Nov 04, 2020

Upload: others

Post on 06-Feb-2021

35 views

Category:

Documents


0 download

TRANSCRIPT

  • EDB Slony Replication Guide

    EDB Slony Replication Guide

    Nov 04, 2020

  • Contents

    1 Installing Slony Replication 21.1 Installing Slony Replication on a CentOS Host . . . . . . . . . . . . . . . . . . . 51.2 Installing Slony on a RHEL Host . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 Installing Slony on a RHEL/CentOS 7 PPCLE Host . . . . . . . . . . . . . . . . 101.4 Installing Slony Replication on a Debian or Ubuntu Host . . . . . . . . . . . . . . 121.5 Installing Slony Replication on a Windows Host . . . . . . . . . . . . . . . . . . 14

    2 Configuring Slony Replication 22

    3 Upgrading Slony Replication 24

    4 Uninstalling Slony Replication 254.1 Uninstalling Slony Replication on a RHEL/CentOS Host . . . . . . . . . . . . . . 254.2 Uninstalling Slony Replication on a Debian or Ubuntu Host . . . . . . . . . . . . 264.3 Uninstalling Slony Replication on a Windows Host . . . . . . . . . . . . . . . . . 27

    5 Conclusion 28

    Index 30

    i

  • EDB Slony Replication Guide

    EDB Slony Replication is a primary-standby replication environment that is well-suited for largedatabases with a limited number of standby systems. It shares data in one direction only (from aprimary node to a standby node), is cascading (a standby node may pass data to another standbynode), and does not allow modification of data on standby nodes.

    This guide acts provides information about installing and uninstalling EDB Slony Replication. Fordetailed information about reference and usage, please visit the project site.

    Contents 1

    https://www.slony.info

  • CHAPTER 1

    Installing Slony Replication

    This section walks you through installing EDB Slony Replication on a RHEL/CentOS host, aDebian/Ubuntu host, and a Windows host.

    The EDB Slony Replication version required by your Advanced Server installation is version-specific, but the documented and supported functionality of each version is the same.

    The following table lists the latest Slony Replication versions and their corresponding AdvancedServer versions, and platforms supported by Slony Replication. The information in this guideapplies to each version listed in the table below.

    Supported SlonyReplication Version

    Supported AdvancedServer Version

    Supported Platforms

    Slony Replication2.2.8

    Advanced Server 13RHEL 7 - x86_64RHEL 8 - x86_64RHEL 7 - ppc64leDebian 9x StretchDebian 10x BusterUbuntu 18.04 Bionic BeaverUbuntu 20.04 LTS Focal FossaWindows x86_64

    continues on next page

    2

  • EDB Slony Replication Guide

    Table 1 – continued from previous pageSupported SlonyReplication Version

    Supported AdvancedServer Version

    Supported Platforms

    Slony Replication2.2.8

    Advanced Server 12RHEL 6 - x86_64RHEL 7 - x86_64RHEL 8 - x86_64RHEL 7 - ppc64leDebian 9x StretchDebian 10x BusterUbuntu 18.04 Bionic BeaverWindows x86_64

    Slony Replication2.2.8

    Advanced Server 11RHEL 6 - x86_64RHEL 7 - x86_64RHEL 7 - ppc64leDebian 9x StretchUbuntu 18.04 Bionic Beaver

    Slony Replication2.2.6

    Advanced Server 10RHEL 6 - x86_64RHEL 7 - x86_64RHEL 7 - ppc64leWindows x86_64Linux graphical installer

    Slony Replication2.2.5

    Advanced Server 9.6RHEL 6 - x86_64RHEL 7 - x86_64RHEL 7 - ppc64leWindows x86_64Linux graphical installer

    Slony Replication2.2.6

    Advanced Server 9.5RHEL 7 - x86_64

    continues on next page

    3

  • EDB Slony Replication Guide

    Table 1 – continued from previous pageSupported SlonyReplication Version

    Supported AdvancedServer Version

    Supported Platforms

    Slony Replication2.2.4

    Advanced Server 9.5RHEL 6 - x86_64RHEL 7 - x86_64RHEL 7 - ppc64leWindows x86_64Linux graphical installer

    4

  • EDB Slony Replication Guide

    1.1 Installing Slony Replication on a CentOS Host

    Before creating the repository configuration file, you must have credentials that allow access to theEnterpriseDB repository. If you need credentials, visit the EDB website.

    Follow the steps given below to install Slony Replication:

    1. To create the repository configuration file, assume superuser privileges and invoke one of thefollowing platform-specific commands:

    On CentOS 6 and 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-→˓latest.noarch.rpm

    On CentOS 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-→˓latest.noarch.rpm

    2. Replace the USERNAME:PASSWORD variable in the following command with the usernameand password of a registered EnterpriseDB user:

    sed -i "s@:@USERNAME:PASSWORD@" /etc/yum.repos.→˓d/edb.repo

    3. Before installing Slony, execute the following command to install the Extra Packages forEnterprise Linux (EPEL) release package:

    On CentOS 6:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-→˓latest-6.noarch.rpm

    sed -i "s@^#baseurl=@baseurl=@;s@^mirrorlist=@#mirrorlist=@" /etc/→˓yum.repos.d/epel.repo

    On CentOS 6, you must install the SCL repository:

    yum -y install centos-release-scl

    On CentOS 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-→˓latest-7.noarch.rpm

    On CentOS 8:

    1.1. Installing Slony Replication on a CentOS Host 5

    https://www.enterprisedb.com/user

  • EDB Slony Replication Guide

    dnf -y install epel-release

    4. For CentOS 8, enable the PowerTools repository to satisfy package dependencies:

    dnf config-manager --set-enabled PowerTools

    5. For CentOS 8, disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql

    6. Use the following platform-specific command to install Slony:

    On CentOS 6 and 7:

    yum -y install edb-as-slony-replication

    Where is the Slony version you want to install.

    On CentOS 8:

    dnf -y install edb-as-slony-replication

    Where is the Slony version you want to install.

    To install Slony 2.2.8 on CentOS 8 for EDB Advanced Server version 13, the command is:

    dnf -y install edb-as13-slony-replication

    Note: To install Slony Replication for Advanced Server version 9.5, you need to execute the yuminstall ppas95-replication command. The ppas95-replication.servicepath is /usr/lib/systemd/system/ppas95-replication.service and the instal-lation path is /usr/ppas-9.5.

    1.1. Installing Slony Replication on a CentOS Host 6

  • EDB Slony Replication Guide

    1.2 Installing Slony on a RHEL Host

    Before installing the repository configuration file, you must have credentials that allow access tothe EnterpriseDB repository. For information about requesting credentials, visit the EDB website.

    Follow the steps given below to install Slony Replication:

    1. To create the repository configuration file, assume superuser privileges and invoke one of thefollowing platform-specific commands:

    On RHEL 6 and 7:

    yum -y install https://yum.enterprisedb.com/edbrepos/edb-repo-→˓latest.noarch.rpm

    On RHEL 8:

    dnf -y install https://yum.enterprisedb.com/edbrepos/edb-repo-→˓latest.noarch.rpm

    2. Replace the USERNAME:PASSWORD variable in the following command with the usernameand password of a registered EnterpriseDB user:

    sed -i "s@:@USERNAME:PASSWORD@" /etc/yum.repos.→˓d/edb.repo

    3. Before installing Slony, execute the following command to install the Extra Packages forEnterprise Linux (EPEL) release package:

    On RHEL 6:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-→˓latest-6.noarch.rpm

    sed -i "s@^#baseurl=@baseurl=@;s@^mirrorlist=@#mirrorlist=@" /etc/→˓yum.repos.d/epel.repo

    On RHEL 6, you need to install SCL repository:

    yum -y install centos-release-scl

    1.2. Installing Slony on a RHEL Host 7

    https://www.enterprisedb.com/user

  • EDB Slony Replication Guide

    On RHEL 7:

    yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-→˓latest-7.noarch.rpm

    On RHEL 8:

    dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-→˓latest-8.noarch.rpm

    4. Enable the repository:

    On RHEL 7, enable the optional, extras, and HA repositories to satisfy packagedependencies:

    subscription-manager repos --enable "rhel-*-optional-rpms" --→˓enable "rhel-*-extras-rpms" --enable "rhel-ha-for-rhel-*-server-→˓rpms"

    On RHEL 8, enable the codeready-builder-for-rhel-8-*-rpms repository tosatisfy package dependencies:

    ARCH=$( /bin/arch )

    subscription-manager repos --enable "codeready-builder-for-rhel-8-$→˓{ARCH}-rpms"

    5. For RHEL 8, disable the built-in PostgreSQL module:

    dnf -qy module disable postgresql

    6. Use the following platform-specific command to install Slony:

    On RHEL 6 and 7:

    yum -y install edb-as13-slony-replication

    Where is the Slony version you want to install.

    On RHEL 8:

    dnf -y install edb-as13-slony-replication

    Where is the Slony version you want to install.

    To install Slony 2.2.8 on RHEL 8 for EDB Advanced Server version 13, use the followingcommand:

    1.2. Installing Slony on a RHEL Host 8

  • EDB Slony Replication Guide

    dnf -y install edb-as13-slony-replication

    The following table lists the path to the service, installation, and configuration files.

    Platform Service File Path InstallationFile Path

    Configuration File Path

    RHEL/CentOS6

    /etc/init.d/edb-slony-replication-

    /usr/edb/as

    The configuration fileslony-replication.ini is locatedin /etc/edb/slony-replication

    RHEL/CentOS 7and 8

    /usr/lib/systemd/system/edb-slony-replication-.service

    /usr/edb/as

    The configuration fileslony-replication.ini is locatedin /etc/edb/slony-replication

    In the above table, represents the Advanced Server version.

    1.2. Installing Slony on a RHEL Host 9

  • EDB Slony Replication Guide

    1.3 Installing Slony on a RHEL/CentOS 7 PPCLE Host

    Before installing the repository configuration file, you must have credentials that allow access tothe EnterpriseDB repository. For information about requesting credentials, visit the EDB website.

    Perform the following steps to install Slony on a RHEL/CentOS 7 PPC64LE Host:

    1. Install Advance Toolchain:

    rpm --import https://public.dhe.ibm.com/software/server/POWER/→˓Linux/toolchain/at/redhat/RHEL7/gpg-pubkey-6976a827-5164221b

    cat > /etc/yum.repos.d/advance-toolchain.repo

  • EDB Slony Replication Guide

    subscription-manager repos --enable "rhel-*-optional-rpms" --→˓enable "rhel-*-extras-rpms" --enable "rhel-ha-for-rhel-*-server-→˓rpms"

    6. Invoke the following command to install Slony:

    yum -y install edb-as-slony-replication

    Where is the Slony version you want to install.

    1.3. Installing Slony on a RHEL/CentOS 7 PPCLE Host 11

  • EDB Slony Replication Guide

    1.4 Installing Slony Replication on a Debian or UbuntuHost

    You must install Advanced Server before installing Slony Replication. For details about installingand configuring Advanced Server, see the EDB Advanced Server Installation Guide available atthe EDB website. To install a package on a Debian or Ubuntu host, you must have credentials toaccess the EnterpriseDB repository. If you need EnterpriseDB credentials, visit the EDB website.

    The following steps will walk you through using the EnterpriseDB repository to install a DEBpackage. When using the commands, replace the username and password with the credentialsprovided by EnterpriseDB.

    1. Assume superuser privileges:

    sudo su -

    2. Configure the EnterpriseDB repository:

    On Debian 9, Ubuntu 18 and Ubuntu 20:

    sh -c 'echo "deb https://username:[email protected]/→˓$(lsb_release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/→˓sources.list.d/edb-$(lsb_release -cs).list'

    On Debian 10:

    a. Set up the EnterpriseDB repository:

    sh -c 'echo "deb [arch=amd64] https://apt.enterprisedb.com/$(lsb_→˓release -cs)-edb/ $(lsb_release -cs) main" > /etc/apt/sources.→˓list.d/edb-$(lsb_release -cs).list'

    b. Substitute your EnterpriseDB credentials for the username and password place-holders in the following command:

    sh -c 'echo "machine apt.enterprisedb.com login →˓password " > /etc/apt/auth.conf.d/edb.conf'

    3. Add support to your system for secure APT repositories:

    apt-get install apt-transport-https

    4. Add the EDB signing key:

    wget -q -O - https://apt.enterprisedb.com/edb-deb.gpg.key | sudo→˓apt-key add -

    5. Update the repository metadata:

    1.4. Installing Slony Replication on a Debian or Ubuntu Host 12

    https://www.enterprisedb.com/edb-docs/p/edb-postgres-advanced-serverhttps://www.enterprisedb.com/user

  • EDB Slony Replication Guide

    apt-get update

    6. Install the Debian package:

    apt-get -y install edb-as-slony-replication

    where is the Advanced Server version.

    For example, to install Slony Replication for Advanced Server version 13, execute the fol-lowing command:

    apt-get -y install edb-as13-slony-replication

    The following table lists the path of the service, installation, and configuration path.

    Service File Path Installation FilePath

    Configuration File Path

    /lib/systemd/system/edb-as-slony-replication.service

    /usr/lib/edb-as/

    The configuration file namedslony-replication.ini is locatedin /etc/edb/slony-replication

    Where represents the Advanced Server version.

    1.4. Installing Slony Replication on a Debian or Ubuntu Host 13

  • EDB Slony Replication Guide

    1.5 Installing Slony Replication on a Windows Host

    Graphical installers for Slony Replication are available via StackBuilder Plus (for Advanced Serverhosts) or Stack Builder (on PostgreSQL hosts).

    The following steps walk you through installing Slony Replication via StackBuilder Plus. You canaccess StackBuilder Plus through your Windows start menu.

    1. Open StackBuilder Plus and select your Advanced Server installation from the drop-downlist on the Welcome window. Click Next to continue to the application selection page.

    Fig. 1: The StackBuilder Plus Welcome window

    1.5. Installing Slony Replication on a Windows Host 14

  • EDB Slony Replication Guide

    2. Expand the Replication Solutions node, and check the box next to the Slony Repli-cation version. Click Next to continue.

    3. The selected packages and the default download directory are displayed. Change the down-load directory location if required. Click Next.

    4. Once you have downloaded the installation files, a confirmation message is displayed. ClickNext to start the Slony Replication installation.

    Fig. 2: Installing Slony

    1.5. Installing Slony Replication on a Windows Host 15

  • EDB Slony Replication Guide

    5. Select an installation language and click OK.

    Fig. 3: The Slony language selection window

    1.5. Installing Slony Replication on a Windows Host 16

  • EDB Slony Replication Guide

    6. The installer welcomes you to the setup wizard. Click Next.

    Fig. 4: The Slony Welcome window

    1.5. Installing Slony Replication on a Windows Host 17

  • EDB Slony Replication Guide

    7. Use the Installation Directory field to specify the directory in which you wish toinstall Slony Replication. Then, click Next to continue.

    Fig. 5: The Installation Directory window

    1.5. Installing Slony Replication on a Windows Host 18

  • EDB Slony Replication Guide

    8. The Ready to Install window notifies you when the installer has all of the infor-mation needed to install Slony Replication on your system. Click Next to install SlonyReplication. Progress bars inform you as the installation progresses.

    Fig. 6: The Ready to Install window

    1.5. Installing Slony Replication on a Windows Host 19

  • EDB Slony Replication Guide

    9. The installer notifies you when the setup wizard has completed the installation. ClickFinish to exit the installer.

    Fig. 7: The installation is complete

    1.5. Installing Slony Replication on a Windows Host 20

  • EDB Slony Replication Guide

    10. Click Finish to exit the StackBuilder Plus.

    Fig. 8: Exit StackBuilder Plus

    1.5. Installing Slony Replication on a Windows Host 21

  • CHAPTER 2

    Configuring Slony Replication

    On a CentOS and Debian host, the configuration file (slony-replication.ini) is locatedin the /etc/edb/slony-replication directory and the ppas95-replication configu-ration file (ppas95-replication.ini) is located in the /etc/ppas95-replicationdirectory. Use the configuration file to specify connection information for the master and standbynodes.

    On a Windows host, the configuration files are named master.conf.sample and slave.conf.sample, and are located in the /etc directory, under the Advanced Server installation;before configuring Slony Replication, you must rename the configuration files to master.confand slave.conf.

    For information about configuring a Slony Replication environment, please refer to the Slony offi-cial project documentation.

    After specifying configuration options, you must start the Slony Replication service on all nodesof the replication environment. For detailed information about controlling a service, see EDBAdvanced Server Installation Guide available at the EDB website.

    After installing, configuring and starting the Slony Replication, on a Linux system, you mustmanually configure your system to autostart the service when your system reboots.

    To configure a service to autostart on a Linux system, open a command line, assume superuserprivileges, and enter the following command.

    On a Redhat-compatible Linux system:

    /sbin/chkconfig service_name on

    22

    https://www.slony.info/adminguide/2.2/doc/adminguide/slony.pdfhttps://www.slony.info/adminguide/2.2/doc/adminguide/slony.pdfhttps://www.enterprisedb.com/edb-docs/p/edb-postgres-advanced-server

  • EDB Slony Replication Guide

    Where service_name specifies the name of the service.

    On a Debian-compatible Linux system, use the command:

    /usr/sbin/update-rc.d service_name enable

    Where service_name specifies the name of the service.

    Please note that if you are using a Windows system, the Slony Replication service will be config-ured to autostart by default. On Windows, you can use the Service Properties dialog tocontrol the service startup type.

    23

  • CHAPTER 3

    Upgrading Slony Replication

    The following section outlines the process of upgrading Slony Replication.

    Assume identity of the root user and invoke the following command:

    yum upgrade edb-as-slony-replication*

    where is the Advanced Server version.

    For example, to upgrade Slony Replication for Advanced Server version 9.6, you need to executethe command:

    yum upgrade epas96-replication

    Similarly, to upgrade Slony Replication for Advanced Server version 9.5, you need to execute thecommand:

    yum upgrade ppas95-replication

    24

  • CHAPTER 4

    Uninstalling Slony Replication

    This section walks you through uninstalling Slony Replication.

    4.1 Uninstalling Slony Replication on a RHEL/CentOSHost

    To uninstall Slony Replication on a RHEL/CentOS host, assume identity of the root user andinvoke the following command:

    On RHEL/CentOS 6 and 7:

    yum remove edb-as-slony-replication*

    where is the Advanced Server version.

    Note: To uninstall Slony Replication for Advanced Server 9.5 version, you need to execute theyum remove ppas95-replication command.

    On RHEL/CentOS 8:

    dnf remove edb-as-slony-replication*

    25

  • EDB Slony Replication Guide

    4.2 Uninstalling Slony Replication on a Debian or UbuntuHost

    To uninstall Slony Replication on a Debian or Ubuntu host, invoke the following command:

    apt-get remove edb-as-slony-replication*

    where is the Advanced Server version.

    Note: To uninstall Slony Replication for Advanced Server 9.5 version, you need to execute theapt-get remove ppas95-replication command.

    4.2. Uninstalling Slony Replication on a Debian or Ubuntu Host 26

  • EDB Slony Replication Guide

    4.3 Uninstalling Slony Replication on a Windows Host

    The Slony Replication graphical installer creates an uninstaller in the installation directory.

    To uninstall Slony Replication on a Windows Host:

    1. Navigate into the installation directory that contains the uninstaller and assume superuserprivileges. Open the uninstaller and click Yes to begin uninstalling Slony Replication:

    Fig. 1: The Slony Replication Uninstaller

    2. The uninstallation process begins. Click OK once the process completes.

    Fig. 2: Uninstallation completes

    4.3. Uninstalling Slony Replication on a Windows Host 27

  • CHAPTER 5

    Conclusion

    EDB Slony Replication User’s Guide

    Copyright © 2020 EnterpriseDB Corporation.

    All rights reserved.

    EnterpriseDB® Corporation

    34 Crosby Drive, Suite 201, Bedford, MA 01730, USA

    T +1 781 357 3390 F +1 978 467 1307 E

    [email protected]

    www.enterprisedb.com

    • EnterpriseDB and Postgres Enterprise Manager are registered trademarks of EnterpriseDBCorporation. EDB and EDB Postgres are trademarks of EnterpriseDB Corporation. Ora-cle is a registered trademark of Oracle, Inc. Other trademarks may be trademarks of theirrespective owners.

    • EDB designs, establishes coding best practices, reviews, and verifies input validation forthe logon UI for EDB Postgres product where present. EDB follows the same approach foradditional input components, however the nature of the product may require that it acceptsfreeform SQL, WMI or other strings to be entered and submitted by trusted users for whichlimited validation is possible. In such cases it is not possible to prevent users from enteringincorrect or otherwise dangerous inputs.

    • EDB reserves the right to add features to products that accept freeform SQL, WMI or otherpotentially dangerous inputs from authenticated, trusted users in the future, but will ensure

    28

    mailto:[email protected]

  • EDB Slony Replication Guide

    all such features are designed and tested to ensure they provide the minimum possible risk,and where possible, require superuser or equivalent privileges.

    • EDB does not that warrant that we can or will anticipate all potential threats and thereforeour process cannot fully guarantee that all potential vulnerabilities have been addressed orconsidered.

    29

  • Index

    CConclusion, 28Configuring Slony Replication, 22

    IInstalling Slony on a RHEL Host,

    7Installing Slony on a

    RHEL/CentOS 7 PPCLE Host,10

    Installing Slony Replication, 2Installing Slony Replication on

    a CentOS Host, 5Installing Slony Replication on

    a Debian or Ubuntu Host, 12Installing Slony Replication on

    a Windows Host, 14

    UUninstalling Slony Replication,

    25Uninstalling Slony Replication

    on a Debian or UbuntuHost, 26

    Uninstalling Slony Replicationon a RHEL/CentOS Host, 25

    Uninstalling Slony Replicationon a Windows Host, 27

    Upgrading Slony Replication, 24

    30

    Installing Slony ReplicationInstalling Slony Replication on a CentOS HostInstalling Slony on a RHEL HostInstalling Slony on a RHEL/CentOS 7 PPCLE HostInstalling Slony Replication on a Debian or Ubuntu HostInstalling Slony Replication on a Windows Host

    Configuring Slony ReplicationUpgrading Slony ReplicationUninstalling Slony ReplicationUninstalling Slony Replication on a RHEL/CentOS HostUninstalling Slony Replication on a Debian or Ubuntu HostUninstalling Slony Replication on a Windows Host

    ConclusionIndex