Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running multiple PostgreSQL instances on gentoo?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
LordVan
Developer
Developer


Joined: 28 Nov 2002
Posts: 67
Location: Austria

PostPosted: Tue Apr 28, 2009 8:07 am    Post subject: Running multiple PostgreSQL instances on gentoo? Reply with quote

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
View user's profile Send private message
Tekeli Li
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jan 2009
Posts: 95

PostPosted: Tue Apr 28, 2009 9:20 am    Post subject: Reply with quote

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
View user's profile Send private message
LordVan
Developer
Developer


Joined: 28 Nov 2002
Posts: 67
Location: Austria

PostPosted: Tue Apr 28, 2009 9:57 am    Post subject: Reply with quote

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
View user's profile Send private message
hannibal218bc
n00b
n00b


Joined: 11 Jul 2011
Posts: 3

PostPosted: Mon Jul 11, 2011 11:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
hannibal218bc
n00b
n00b


Joined: 11 Jul 2011
Posts: 3

PostPosted: Thu Jul 14, 2011 4:11 pm    Post subject: Reply with quote

I added this "enhancement request" to bugzilla:

https://bugs.gentoo.org/show_bug.cgi?id=375185
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Fri Jul 15, 2011 12:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
hannibal218bc
n00b
n00b


Joined: 11 Jul 2011
Posts: 3

PostPosted: Fri Jul 15, 2011 8:14 pm    Post subject: Reply with quote

Ah, I see -- it's that easy!? Cool, already works. Thank you!
Back to top
View user's profile Send private message
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 881

PostPosted: Thu Feb 16, 2012 6:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Thu Feb 16, 2012 10:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
svoop
n00b
n00b


Joined: 11 Jan 2009
Posts: 63

PostPosted: Thu Jan 02, 2014 7:19 pm    Post subject: Reply with quote

[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
View user's profile Send private message
KAMIKAZE_
Guru
Guru


Joined: 09 Oct 2003
Posts: 309
Location: Riga, Latvia

PostPosted: Fri Apr 18, 2014 2:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum