Configuring the use of Slony-i in Pgadmin

Source: Internet
Author: User

Environment:

Main Library: CentOS virtual machine (Linux 32bit)

Standby Library: CentOS virtual machine (Linux 32bit)


1. installation package

Postgresql-9.2.13-3-linux.run

Edb_slony_i_pg92.bin

2. Prepare the main and standby libraries

Main Library:

Installation directory:/OPT/POSTGRESQL/9.2/

ip=192.168.100.240

port=5433

Dbname=mdb

slony Replication User ( required to be a super User ) : Postgres

Standby Library:

Installation directory:/OPT/POSTGRESQL/9.2/

ip=192.168.100.241

port=5433

Dbname=sdb

Slony Replication User ( requires Superuser ):postgres



3. Initialize slony cluster

for the main library, create a new slony cluster: Cluster01.

to the repository, create a new cluster - Join the existing cluster Cluster01.


4. Create a node path

for the main library, build cluster01 node master node, and create a new path:

host=192.168.100.241 port=5433 dbname=sdb user=postgres password=postgres


for standby, build Cluster01 nodes slave node , create a new path:

host=192.168.100.240 port=5433 Dbname=mdb user=postgres password=postgres


5. Create a Copy collection

In the main library, new replication collection 1:


In the main library MDB and the repository SDB, create the data tables to be synchronized (must have primary key to be used for slony-i data synchronization):

CREATE TABLE lyy2 (ID int primary key, name varchar);


in the main library, under Copy collection 1, Add the table public.lyy2 that you want to copy .


6. Start Slon Deamon

On the machine where the main library is located, start its Slon deamon:

[Email protected] bin]#/slon-h Cluster01 "port=192.168.100.240 port=5433 dbname=mdb user=postgres password=postgres" &

On the machine where the standby is located, start its Slon deamon:

[Email protected] bin]#/slon-h Cluster01 "port=192.168.100.241 port=5433 dbname=sdb user=postgres password=postgres" &



Configuring the use of Slony-i in Pgadmin

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.