View previous topic :: View next topic |
Author |
Message |
LordVan Developer
Joined: 28 Nov 2002 Posts: 67 Location: Austria
|
Posted: Tue Apr 28, 2009 8:07 am Post subject: Running multiple PostgreSQL instances on gentoo? |
|
|
hi.
i was wondering if there was some standard way of running multiple instances of postgresql (e.g. on port 5432 and 5433) with different Data dirs (same postgres version).
I know i can copy the init script and config and modify them so that it works but did anyone do this already?
Thanks _________________ I don't suffer from insanity. I enjoy every minute of it. |
|
Back to top |
|
|
Tekeli Li Tux's lil' helper
Joined: 03 Jan 2009 Posts: 95
|
Posted: Tue Apr 28, 2009 9:20 am Post subject: |
|
|
I've never done it, and I believe if I did, I'd be doing separate init script for that. Although I believe the data dir env var is still being ignored (bug)?
Still, why would you want to run multiple pgsql instances on the same machine? |
|
Back to top |
|
|
LordVan Developer
Joined: 28 Nov 2002 Posts: 67 Location: Austria
|
Posted: Tue Apr 28, 2009 9:57 am Post subject: |
|
|
With dbmail and several other apps i found it to be an issue with vacuum and optimize .. also dbmail has lots and lots of inserts which seem to degrade performance on other apps/dbs as well as it takes up resources (i think) _________________ I don't suffer from insanity. I enjoy every minute of it. |
|
Back to top |
|
|
hannibal218bc n00b
Joined: 11 Jul 2011 Posts: 3
|
Posted: Mon Jul 11, 2011 11:19 pm Post subject: |
|
|
Sorry to revive this old thread, but I'm also searching for a sensible way to run multiple instances / clusters on one Gentoo machine. What I'd like to do is to have one machine serve as a server for one cluster and also as a streaming replication slave. So, I need two clusters and two instances.
Thanks for any input! |
|
Back to top |
|
|
hannibal218bc n00b
Joined: 11 Jul 2011 Posts: 3
|
|
Back to top |
|
|
titanofold Developer
Joined: 30 Dec 2003 Posts: 235 Location: Bryson City, NC USA
|
Posted: Fri Jul 15, 2011 12:53 pm Post subject: |
|
|
I won't be adding support in the init scripts for multiple instances per slot.
You'll have to create an additional cluster manually using initdb. (The init script assumes the user will be postgres, so make it easy on yourself and instruct initdb that the owner is postgres.)
ln -s /etc/init.d/postgresql-${SLOT} /etc/init.d/something-else
cp /etc/conf.d/postgresql-${SLOT} /etc/conf.d/something-else
Edit /etc/conf.d/something-else to point to the proper directory where you've created the additional cluster, where the configuration files are, and the port you want it to run on.
You should be good to go at that point. _________________ The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley |
|
Back to top |
|
|
hannibal218bc n00b
Joined: 11 Jul 2011 Posts: 3
|
Posted: Fri Jul 15, 2011 8:14 pm Post subject: |
|
|
Ah, I see -- it's that easy!? Cool, already works. Thank you! |
|
Back to top |
|
|
Vieri l33t
Joined: 18 Dec 2005 Posts: 881
|
Posted: Thu Feb 16, 2012 6:51 pm Post subject: |
|
|
I was looking for that too.
Could it be possible to have this information within the postgresql-server ebuilds (just as plain einfo)?
And/or on the official Gentoo postgresql documentation web page?
Thanks |
|
Back to top |
|
|
titanofold Developer
Joined: 30 Dec 2003 Posts: 235 Location: Bryson City, NC USA
|
Posted: Thu Feb 16, 2012 10:57 pm Post subject: |
|
|
Vieri wrote: | I was looking for that too.
Could it be possible to have this information within the postgresql-server ebuilds (just as plain einfo)?
And/or on the official Gentoo postgresql documentation web page?
Thanks |
Yes, it's possible, but I'll neither add it to the ebuild nor the quick start guide.
There are one or two edge cases where one would actually want two instances of the same version running on the same computer. It is not something that should be encouraged for the general public to consider as a solution. _________________ The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley |
|
Back to top |
|
|
svoop n00b
Joined: 11 Jan 2009 Posts: 63
|
Posted: Thu Jan 02, 2014 7:19 pm Post subject: |
|
|
[quote="titanofold"] Vieri wrote: | There are one or two edge cases where one would actually want two instances of the same version running on the same computer. It is not something that should be encouraged for the general public to consider as a solution. |
There's one quite common situation where you absolutely have to run two daemons: Say you have two servers: A for production and B for staging (very low traffic) and backup. In order to mirror the db on A to B, you'd have to use Postgres' Streaming Replication mechanism. However, you can't use the replicated database on B for anything else, so you need a second instance of Postgres on B to serve the staging. |
|
Back to top |
|
|
KAMIKAZE_ Guru
Joined: 09 Oct 2003 Posts: 309 Location: Riga, Latvia
|
Posted: Fri Apr 18, 2014 2:46 pm Post subject: |
|
|
another case: I don't want to replicate all my databases in one archive. If I will run recovery for one - it will rollback other dbs too, that's bad _________________ -=[powered by Gentoo]=- |
|
Back to top |
|
|
|