Solved

PostgreSQL synchronization (master-slave)

Posted on 2011-09-29
13
1,284 Views
Last Modified: 2012-05-12
Hi,

I have two PostgreSQL server's, one with ubuntu + PostgreSQL 8.3 as a master and the other with CentOS 5 + PostgreSQL 8.4 as a slave.

I want to configrure a one-way synchronization between master and slave.

How can I do this? What is the best program?

Best regards

André Bolinhas
0
Comment
Question by:abolinhas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +1
13 Comments
 
LVL 22

Expert Comment

by:earth man2
ID: 36818641
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36818786
How can I upgrade from 8.X to 9.X in ubuntu and centos ?
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36818788
A important question before try upgrade, postgres 9.X support postgis ?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 22

Expert Comment

by:earth man2
ID: 36900554
One way is to use the 9.1 PostgreSQL source and compile and install on your machine.
The commands are basically ./configure and make install
pg_dump can be used to create a database backup.  psql can be used to create the new database.

You'll have to recompile Postgis as well with new PostgreSQL server headers.

Postgis requrements state PostgreSQL 8.3 or higher.
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36909488
My cpanel / whm don't support the postgres 9.X

I already have the 8.3.16 on both sides  (mastes and slave)

To configrure a one-way synchronization between master and slave, the slony-I is the best choise ?
0
 
LVL 9

Expert Comment

by:crazedsanity
ID: 36909870
I would highly recommend Slony.  I used it several years ago to keep three machines synchronized and it worked quite well, though the documentation wasn't as clear in some areas as I'd like.  From personal experience, it would be a good idea to have something that specifically monitors Slony, just so you're aware if it gets stuck.
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36909902
I need to install slony on both server or only in master ?
0
 
LVL 9

Expert Comment

by:crazedsanity
ID: 36910402
Unless something has changed, it must be installed (and configured) on both.  It has been a few years since I've dealt with it, though.
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36910428
I'm starting read slony documentation but is very very confuse and hard.

Starting i can not install on my server (master), I get this error on make
 
slony1_funcs.c:23:23: error: miscadmin.h: No such file or directory
slony1_funcs.c:24:29: error: nodes/makefuncs.h: No such file or directory
slony1_funcs.c:25:29: error: parser/keywords.h: No such file or directory

Open in new window


You had this kind of problems to ?
0
 
LVL 9

Expert Comment

by:crazedsanity
ID: 36911397
Did you compile it from source?  It might be easier (though not necessarily as up-to-date) to install a package, such as using "apt-get install" in Debian/Ubuntu.
0
 
LVL 9

Author Comment

by:abolinhas
ID: 36911411
yes I compile from source.

Ok, I will try apt-get
0
 
LVL 62

Accepted Solution

by:
gheist earned 500 total points
ID: 37127310
just an advice on terms - you do not want synchronisation (two events happening at the same moment in time)

You are looking into database replication.

http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling

Or for Java-only http://c-jdbc.ow2.org/
0
 
LVL 9

Author Closing Comment

by:abolinhas
ID: 37130558
Thank for help to find rubygrep.

Rubygreps works  very well on my postgres and do exactly what I need.
0

Featured Post

 Database Backup and Recovery Best Practices

Join Percona’s, Architect, Manjot Singh as he presents Database Backup and Recovery Best Practices (with a Focus on MySQL) on Thursday, July 27, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7). In the case of a failure, do you know how long it will take to restore your database?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: http://www.postgresql.org/ (http://www.postgresql.org/) This requires some add-o…
Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question