Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Running multiple PostgreSQL instances on gentoo?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
11 posts • Page 1 of 1
Author
Message
LordVan
Developer
Developer
User avatar
Posts: 67
Joined: Thu Nov 28, 2002 11:06 pm
Location: Austria
Contact:
Contact LordVan
Website

Running multiple PostgreSQL instances on gentoo?

  • Quote

Post by LordVan » Tue Apr 28, 2009 8:07 am

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.
Top
Tekeli Li
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 95
Joined: Sat Jan 03, 2009 12:22 am

  • Quote

Post by Tekeli Li » Tue Apr 28, 2009 9:20 am

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?
Top
LordVan
Developer
Developer
User avatar
Posts: 67
Joined: Thu Nov 28, 2002 11:06 pm
Location: Austria
Contact:
Contact LordVan
Website

  • Quote

Post by LordVan » Tue Apr 28, 2009 9:57 am

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.
Top
hannibal218bc
n00b
n00b
Posts: 3
Joined: Mon Jul 11, 2011 11:15 pm

  • Quote

Post by hannibal218bc » Mon Jul 11, 2011 11:19 pm

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!
Top
hannibal218bc
n00b
n00b
Posts: 3
Joined: Mon Jul 11, 2011 11:15 pm

  • Quote

Post by hannibal218bc » Thu Jul 14, 2011 4:11 pm

I added this "enhancement request" to bugzilla:

https://bugs.gentoo.org/show_bug.cgi?id=375185
Top
titanofold
Developer
Developer
Posts: 235
Joined: Tue Dec 30, 2003 7:00 pm
Location: Bryson City, NC USA

  • Quote

Post by titanofold » Fri Jul 15, 2011 12:53 pm

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
Top
hannibal218bc
n00b
n00b
Posts: 3
Joined: Mon Jul 11, 2011 11:15 pm

  • Quote

Post by hannibal218bc » Fri Jul 15, 2011 8:14 pm

Ah, I see -- it's that easy!? Cool, already works. Thank you!
Top
Vieri
l33t
l33t
Posts: 935
Joined: Sun Dec 18, 2005 12:26 pm

  • Quote

Post by Vieri » Thu Feb 16, 2012 6:51 pm

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
Top
titanofold
Developer
Developer
Posts: 235
Joined: Tue Dec 30, 2003 7:00 pm
Location: Bryson City, NC USA

  • Quote

Post by titanofold » Thu Feb 16, 2012 10:57 pm

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
Top
svoop
n00b
n00b
Posts: 64
Joined: Sun Jan 11, 2009 11:45 am

  • Quote

Post by svoop » Thu Jan 02, 2014 7:19 pm

titanofold wrote:
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.
Top
KAMIKAZE_
Guru
Guru
Posts: 309
Joined: Thu Oct 09, 2003 3:56 pm
Location: Riga, Latvia
Contact:
Contact KAMIKAZE_
Website

  • Quote

Post by KAMIKAZE_ » Fri Apr 18, 2014 2:46 pm

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]=-
Top
Post Reply

11 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic