Re: PostgreSQL in FreeBSD jails

2005-05-11 Thread Marton Kenyeres
Dag-Erling Smørgrav wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
'k, I've been doing multiple since 7.2 on the same machine, all on the
same port, all different IPs, all on 4.x servers ... have never had an
issue with crashes (its pretty much my most stable 4.x server) ...

It was never possible.  8.0 has a hack to detect and avoid shared
memory collisions, but I think it will still have problems with
semaphores.  I have no idea why it works (or seems to work) for you;
it never did for anyone else.
DES
Maybe he's runing pjd@ 's privipc patch?
http://lists.freebsd.org/pipermail/freebsd-arch/2003-June/000926.html
Cheers,
m.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-11 Thread Marc G. Fournier
On Wed, 11 May 2005, Marton Kenyeres wrote:
Dag-Erling Smørgrav wrote:
Marc G. Fournier [EMAIL PROTECTED] writes:
'k, I've been doing multiple since 7.2 on the same machine, all on the
same port, all different IPs, all on 4.x servers ... have never had an
issue with crashes (its pretty much my most stable 4.x server) ...

It was never possible.  8.0 has a hack to detect and avoid shared
memory collisions, but I think it will still have problems with
semaphores.  I have no idea why it works (or seems to work) for you;
it never did for anyone else.
DES
Maybe he's runing pjd@ 's privipc patch?
http://lists.freebsd.org/pipermail/freebsd-arch/2003-June/000926.html
Nope, stock 4.11 kernel from Tue Feb 15 21:36:53 AST 2005 ... sorry ...

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-03 Thread Dag-Erling Smørgrav
Marc G. Fournier [EMAIL PROTECTED] writes:
 You've all lost me here ... what exactly is the problem?

You can't run multiple instances of PostgreSQL on the same machine
(even in chroot or jail, even without TCP/IP support) without changing
the port number in postgresql.conf.  PostgreSQL creates shared memory
segments with keys based on the port number, so separate instances
will try to create and use the same segments if configured to use the
same port number.

   PostgreSQL
 works under FreeBSD 4.x jails without any modifications, so how is
 PostgreSQL itself currently broken?  It seems to me that the problem
 is with FreeBSD 5.x's jail side of things, if the same daemon runs
 fine under 4.x, but, nto under 5.x ...

PostgreSQL has always had this problem, both on 4.x and 5.x.  A hack
was put in place last November to work around it, but it still exists,
and while it may now be possible (with 8.0) for multiple postmasters
to run on the same machine, it is also still possible for malicious
code in one jail to crash postmasters in other jails.

The underlying problem is that FreeBSD does not have separate SHM
namespaces in each jail, but, as has already been pointed out, that
problem is fairly hard to fix.  Patching PostgreSQL to use something
else than SysV shared memory is easier and will benefit other OSes as
well.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-03 Thread Marc G. Fournier
On Tue, 3 May 2005, [iso-8859-1] Dag-Erling Smørgrav wrote:
PostgreSQL has always had this problem, both on 4.x and 5.x.  A hack was 
put in place last November to work around it, but it still exists, and 
while it may now be possible (with 8.0) for multiple postmasters to run 
on the same machine
'k, I've been doing multiple since 7.2 on the same machine, all on the 
same port, all different IPs, all on 4.x servers ... have never had an 
issue with crashes (its pretty much my most stable 4.x server) ...

In fact:
# ps aux | grep postmaster | egrep -v postmaster: | sort +1 -n
scrappy 36569  0.0  0.0 14552  600  ??  IsJ  19Apr05   0:21.48 
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 36675  0.0  0.0 258184 1052  ??  SsJ  19Apr05  14:10.24 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 36865  0.0  0.0 16556  836  ??  IsJ  19Apr05   0:14.17 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
pgsql   37518  0.0  0.0 16400  396  ??  IsJ  19Apr05   0:04.02 
/usr/local/bin/postmaster (postgres)
pgsql   37815  0.0  0.0  8144  436  p9- IJ   19Apr05   0:14.62 
/usr/local/bin/postmaster (postgres)
pgsql   37962  0.0  0.0  8680  560  ??  IsJ  19Apr05   0:08.72 
/usr/local/bin/postmaster (postgres)
pgsql   38168  0.0  0.0 16400  452  ??  IsJ  19Apr05   0:37.69 
/usr/local/bin/postmaster (postgres)
pgsql   38316  0.0  0.0  7144  464  ??  IsJ  19Apr05   0:04.08 
/usr/local/bin/postmaster (postgres)
pgsql   38458  0.0  0.0  7208  380  ??  IsJ  19Apr05   0:04.01 
/usr/local/bin/postmaster (postgres)
pgsql   38596  0.0  0.0  6952  452  ??  IsJ  19Apr05   0:03.90 
/usr/local/bin/postmaster (postgres)
scrappy 38717  0.0  0.0  6952  436  ??  IsJ  19Apr05   0:03.98 
/usr/local/bin/postmaster (postgres)
pgsql   38868  0.0  0.0  8224  552  ??  SsJ  19Apr05   0:03.39 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
pgsql   38993  0.0  0.0  7912  584  ??  IsJ  19Apr05   0:06.41 
/usr/local/bin/postmaster (postgres)
pgsql   39126  0.0  0.0  7480  400  ??  IsJ  19Apr05   0:01.80 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
pgsql   87544  0.0  0.1  7948 3528  ??  IsJ  Sun08PM   0:00.78 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
# ipcs -a | fgrep -f /tmp/pids | sort +10 -n
m 3276835432003 --rw---  scrappy 1001  scrappy 1001  7 
10256384  36569  38717 8:40:46 11:51:28  8:37:57
m 1310765432004 --rw---  scrappy 1001  scrappy 1001100 
257957888  36675  38717 8:40:46 11:54:16  8:38:04
m 100925495432005 --rw---  scrappy 1001  scrappy 1001 12 
10362880  36865  38717 8:40:46 11:29:20  8:38:25
m 1310805432007 --rw---pgsqlpgsqlpgsqlpgsql  1 
10436608  37518  39126 8:41:20 11:53:08  8:39:18
m 1310815432008 --rw---pgsqlpgsqlpgsqlpgsql  6 
2449408  37815  39126 8:41:20 11:52:32  8:39:43
m 3932265432009 --rw---pgsqlpgsqlpgsqlpgsql  9 
2596864  37962  39126 8:41:20 11:50:25  8:39:55
m 1310835432010 --rw---pgsqlpgsqlpgsqlpgsql  1 
10436608  38168  39126 8:41:20 11:52:15  8:40:06
m 10485885432011 --rw---pgsqlpgsqlpgsqlpgsql  1 
1024000  38316  39126 8:41:20 11:51:53  8:40:19
m 1310855432012 --rw---pgsqlpgsqlpgsqlpgsql  1 
1024000  38458  39126 8:41:20 11:50:28  8:40:29
m 1310865432013 --rw---pgsqlpgsqlpgsqlpgsql  1 
761856  38596  39126 8:41:20 11:53:02  8:40:38
m 1310875432014 --rw---  scrappy 1001  scrappy 1001  1 
761856  38717  38717 8:40:46 11:50:42  8:40:46
m 1310885432015 --rw---pgsqlpgsqlpgsqlpgsql  2 
811008  38868  39126 8:41:20  1:59:39  8:40:58
m 15073455432016 --rw---pgsqlpgsqlpgsqlpgsql  1 
761856  38993  39126 8:41:20 11:50:37  8:41:07
m 13107385432017 --rw---pgsqlpgsqlpgsqlpgsql  2 
811008  39126  39126 8:41:20  0:59:01  8:41:20
m 1966155432001 --rw---pgsqlpgsqlpgsqlpgsql 11 
1548288  87544  8754420:32:30 11:50:56 20:32:30
So, unless I'm missing something here, each postmaster is acquiring its 
own ID, and the above servers consist of the following versions (all of 
which are built from ports):

   1 postgresql-7.2.4_2
   1 postgresql-7.4.1
   1 postgresql-7.4.1_1
   1 postgresql-7.4.2
   2 postgresql-7.4.5
   4 postgresql-7.4.6
   1 postgresql-devel-8.0.0,1
   1 postgresql-server-7.4.7
   1 postgresql-server-7.4.7_3
   1 postgresql-server-8.0.0
   1 postgresql-server-8.0.1_3
So, unless I'm missing something, 4.x did allow for running multiple 
PostgreSQL servers, on the same machine, in multiple jails, each with 
their own distinct shared memory segment ... or am I mis-reading the 
above?

it is also still possible for malicious code in one jail to crash
postmasters in other jails.
That one I can agree with, which is why all our 

Re: PostgreSQL in FreeBSD jails

2005-05-03 Thread Dag-Erling Smørgrav
Marc G. Fournier [EMAIL PROTECTED] writes:
 'k, I've been doing multiple since 7.2 on the same machine, all on the
 same port, all different IPs, all on 4.x servers ... have never had an
 issue with crashes (its pretty much my most stable 4.x server) ...

It was never possible.  8.0 has a hack to detect and avoid shared
memory collisions, but I think it will still have problems with
semaphores.  I have no idea why it works (or seems to work) for you;
it never did for anyone else.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-02 Thread Dag-Erling Smørgrav
An unknown poster wrote:
 AFAIR PostgreSQL generates the shared memory identifier based on
 the port it is runing on. It is possible to run two instances of
 PostgreSQL on different ports, so it should work if they are in
 seperate jails.

Correct.

Alexander Rusinov [EMAIL PROTECTED] writes:
 I guess this is a workaround but not a solution though.

There are two possible solutions:

 - hack the SysV IPC code to use separate namespaces for each jail

 - make PostgreSQL use POSIX shared memory instead of SysV shared
   memory

I suspect that the latter is significantly easier, and would probably
improve performance as well.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-02 Thread Richard Coleman
Dag-Erling Smørgrav wrote:
There are two possible solutions:
 - hack the SysV IPC code to use separate namespaces for each jail
 - make PostgreSQL use POSIX shared memory instead of SysV shared
   memory
I suspect that the latter is significantly easier, and would probably
improve performance as well.
DES
It might be easier to hack PostgreSQL so that the shared memory 
identifier depends not only on the port, but also on the IP address 
(which will of course be different for each jail).  Or better yet, to be 
able to specify the shared memory identifier to use directly in the 
config file.

Richard Coleman
[EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-02 Thread Marc G. Fournier
yOn Mon, 2 May 2005, Richard Coleman wrote:
Dag-Erling Smørgrav wrote:
There are two possible solutions:
 - hack the SysV IPC code to use separate namespaces for each jail
 - make PostgreSQL use POSIX shared memory instead of SysV shared
   memory
I suspect that the latter is significantly easier, and would probably
improve performance as well.
DES
It might be easier to hack PostgreSQL so that the shared memory identifier 
depends not only on the port, but also on the IP address (which will of 
course be different for each jail).  Or better yet, to be able to specify the 
shared memory identifier to use directly in the config file.
You've all lost me here ... what exactly is the problem?  PostgreSQL works 
under FreeBSD 4.x jails without any modifications, so how is PostgreSQL 
itself currently broken?  It seems to me that the problem is with FreeBSD 
5.x's jail side of things, if the same daemon runs fine under 4.x, but, 
nto under 5.x ...


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-05-02 Thread Jonathan Noack
On 5/2/2005 4:03 PM, Marc G. Fournier wrote:
yOn Mon, 2 May 2005, Richard Coleman wrote:
Dag-Erling Smørgrav wrote:
There are two possible solutions:
 - hack the SysV IPC code to use separate namespaces for each jail
 - make PostgreSQL use POSIX shared memory instead of SysV shared
   memory
I suspect that the latter is significantly easier, and would probably
improve performance as well.
DES
It might be easier to hack PostgreSQL so that the shared memory 
identifier depends not only on the port, but also on the IP address 
(which will of course be different for each jail).  Or better yet, to 
be able to specify the shared memory identifier to use directly in the 
config file.
You've all lost me here ... what exactly is the problem?  PostgreSQL 
works under FreeBSD 4.x jails without any modifications, so how is 
PostgreSQL itself currently broken?  It seems to me that the problem is 
with FreeBSD 5.x's jail side of things, if the same daemon runs fine 
under 4.x, but, nto under 5.x ...
From my reading on this thread:
PostgreSQL generates the shared memory identifier based on the port it 
is running on, but (on 5.x at least) shared memory is not segregated 
between jails.  Thus, a new instance will corrupt the shared memory of 
another instance (in another jail, on another IP address, etc.) *if* 
they are running on the same port.  The workaround is to ensure every 
instance (regardless of jail or IP address) is running on a unique port.

--
Jonathan Noack | [EMAIL PROTECTED] | OpenPGP: 0x991D8195


signature.asc
Description: OpenPGP digital signature


Re: PostgreSQL in FreeBSD jails

2005-05-02 Thread Dag-Erling Smørgrav
Richard Coleman [EMAIL PROTECTED] writes:
 It might be easier to hack PostgreSQL so that the shared memory
 identifier depends not only on the port, but also on the IP address
 (which will of course be different for each jail).  Or better yet, to
 be able to specify the shared memory identifier to use directly in the
 config file.

That's not a sufficiently general solution.  First of all, in most
setups postgresql runs either a) without TCP/IP; b) only on 127.0.0.1;
c) on all interfaces.  Very rarely does it listen only on one single
identifiable IP address.  Therefore, relying on the IP address is
useless.  Besides, the shm id is an integer, which makes it difficult
to encode both the IP address and the port number without collisions.

The ideal solution is to use a type of shared memory that does not
need a namespace at all.

One option is to use a threads instead of child processes.  This would
require a major rewrite of the backend, and is not likely to happen
any time soon.

The other option is to add support for mmap()-based shared memory.  I
happen to have a patch, but testing it properly and getting it
approved and merged will take a while.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-27 Thread Alexander Rusinov

Just add the following line to your /etc/rc.conf
jail_sysvipc_allow=YES
and ipc configuration will be shared with the jails
 

I have IPC enabled for jails already. So unfortunately this is not a 
solution.

Is anybody here who do run several jailed PostgreSQL servers?
AFAIR PostgreSQL generates the shared memory identifier based on the 
port it is runing on. It is possible to run two instances of 
PostgreSQL on different ports, so it should work if they are in 
seperate jails.
Actually, I'm using unix sockets for those servers so I never thought 
about changing the port number. But now I tried and ... that helped! 
Thank you!

I guess this is a workaround but not a solution though.
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


PostgreSQL in FreeBSD jails

2005-04-26 Thread Alexander Rusinov
Hi,
I need to run a number of PostgreSQL servers in different FreeBSD jails. 
I managed to run a first instance of PostgreSQL server in a jail, but 
after I launch a new server in another jail the first one starts to 
return an error messages like the following:

semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
The problem in general is: only one instance of PostgreSQL server 
processes clients' connections, all of the others return semctl errors.

The system is FreeBSD 5.4-PRERELEASE.  PostgreSQL-7.4.7. SEM and SHM 
sysctl setting are:

# sysctl -a | grep shm
kern.ipc.shmmax: 1
kern.ipc.shmmin: 1
kern.ipc.shmmni: 192
kern.ipc.shmseg: 128
kern.ipc.shmall: 32768
kern.ipc.shm_use_phys: 0
kern.ipc.shm_allow_removed: 0
# sysctl -a | grep sem
kern.ipc.semmap: 256
kern.ipc.semmni: 256
kern.ipc.semmns: 512
kern.ipc.semmnu: 256
kern.ipc.semmsl: 60
kern.ipc.semopm: 100
kern.ipc.semume: 10
kern.ipc.semusz: 92
kern.ipc.semvmx: 32767
kern.ipc.semaem: 16384
Trying to solve the problem I've set the following in postgresql.conf 
files:
max_connections = 5
shared_buffers = 100

Please help! What am I doing wrong?
--
Alexander Rusinov
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Spartak Radchenko
On Tue, Apr 26, 2005 at 05:58:27PM +0300, Alexander Rusinov wrote:
 Hi,
 
 I need to run a number of PostgreSQL servers in different FreeBSD jails.

Is SYSV IPC allowed for jails? It's not enabled by default.

-- 
Spartak Radchenko SVR1-RIPE
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Bill Moran
Alexander Rusinov [EMAIL PROTECTED] wrote:
 Hi,
 
 I need to run a number of PostgreSQL servers in different FreeBSD jails. 
 I managed to run a first instance of PostgreSQL server in a jail, but 
 after I launch a new server in another jail the first one starts to 
 return an error messages like the following:
 
 semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
 
 The problem in general is: only one instance of PostgreSQL server 
 processes clients' connections, all of the others return semctl errors.

I had this exact same problem.  I never found a solution.  The cause
appears to be that, since shared memory is not segregated between jails,
the newly launched Postgres instances corrupt the shared memory of
previously running Postgres instances.

Supposedly, this shouldn't be possible, but it was happening and I never
found a solution.

 
 The system is FreeBSD 5.4-PRERELEASE.  PostgreSQL-7.4.7. SEM and SHM 
 sysctl setting are:
 
 # sysctl -a | grep shm
 kern.ipc.shmmax: 1
 kern.ipc.shmmin: 1
 kern.ipc.shmmni: 192
 kern.ipc.shmseg: 128
 kern.ipc.shmall: 32768
 kern.ipc.shm_use_phys: 0
 kern.ipc.shm_allow_removed: 0
 
 # sysctl -a | grep sem
 kern.ipc.semmap: 256
 kern.ipc.semmni: 256
 kern.ipc.semmns: 512
 kern.ipc.semmnu: 256
 kern.ipc.semmsl: 60
 kern.ipc.semopm: 100
 kern.ipc.semume: 10
 kern.ipc.semusz: 92
 kern.ipc.semvmx: 32767
 kern.ipc.semaem: 16384
 
 Trying to solve the problem I've set the following in postgresql.conf 
 files:
 max_connections = 5
 shared_buffers = 100
 
 Please help! What am I doing wrong?
 
 -- 
 Alexander Rusinov
 
 ___
 freebsd-stable@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-stable
 To unsubscribe, send any mail to [EMAIL PROTECTED]


-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Renato Botelho
On 26/04/05, Alexander Rusinov [EMAIL PROTECTED] wrote:
 Hi,
 
 I need to run a number of PostgreSQL servers in different FreeBSD jails.
 I managed to run a first instance of PostgreSQL server in a jail, but
 after I launch a new server in another jail the first one starts to
 return an error messages like the following:
 
 semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
 
 The problem in general is: only one instance of PostgreSQL server
 processes clients' connections, all of the others return semctl errors.
 
 The system is FreeBSD 5.4-PRERELEASE.  PostgreSQL-7.4.7. SEM and SHM
 sysctl setting are:

Just add the following line to your /etc/rc.conf

jail_sysvipc_allow=YES 

and ipc configuration will be shared with the jails

Regards
-- 
Renato Botelho
ICQ: 54596223
AIM: RBGargaBR
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Alexander Rusinov
Spartak Radchenko wrote:
On Tue, Apr 26, 2005 at 05:58:27PM +0300, Alexander Rusinov wrote:
 

Hi,
I need to run a number of PostgreSQL servers in different FreeBSD jails.
   

Is SYSV IPC allowed for jails? It's not enabled by default.
 

Yes, it is on:
security.jail.sysvipc_allowed: 1
I wouln't be able to run the first instance of PostgreSQL server with 
IPC disabled.

--
Alexander Rusinov
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Alexander Rusinov
Renato Botelho wrote:
On 26/04/05, Alexander Rusinov [EMAIL PROTECTED] wrote:
 

Hi,
I need to run a number of PostgreSQL servers in different FreeBSD jails.
I managed to run a first instance of PostgreSQL server in a jail, but
after I launch a new server in another jail the first one starts to
return an error messages like the following:
semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
The problem in general is: only one instance of PostgreSQL server
processes clients' connections, all of the others return semctl errors.
The system is FreeBSD 5.4-PRERELEASE.  PostgreSQL-7.4.7. SEM and SHM
sysctl setting are:
   

Just add the following line to your /etc/rc.conf
jail_sysvipc_allow=YES 

and ipc configuration will be shared with the jails
 

I have IPC enabled for jails already. So unfortunately this is not a 
solution.

Is anybody here who do run several jailed PostgreSQL servers?
--
Alexander Rusinov
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Marc G. Fournier
On Tue, 26 Apr 2005, Bill Moran wrote:
Alexander Rusinov [EMAIL PROTECTED] wrote:
Hi,
I need to run a number of PostgreSQL servers in different FreeBSD jails.
I managed to run a first instance of PostgreSQL server in a jail, but
after I launch a new server in another jail the first one starts to
return an error messages like the following:
semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
The problem in general is: only one instance of PostgreSQL server
processes clients' connections, all of the others return semctl errors.
I had this exact same problem.  I never found a solution.  The cause
appears to be that, since shared memory is not segregated between jails,
the newly launched Postgres instances corrupt the shared memory of
previously running Postgres instances.
I'm running 9 jails on a server right now, each with their own instance:
# ps aux | grep postmaster|grep -- -D
scrappy 20043  0.0  0.0 18856  504  ??  SsJ  Thu08PM   0:58.55 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
pgsql   39126  0.0  0.0  7480  400  ??  SsJ  19Apr05   0:00.99 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
pgsql   38868  0.0  0.0  8224  552  ??  SsJ  19Apr05   0:02.08 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
pgsql   37375  0.0  0.0  7180  404  ??  SsJ  19Apr05   0:02.47 
/usr/local/bin/postmaster -D /usr/local/pgsql/data (postgres)
scrappy 36865  0.0  0.0 16556  744  ??  SsJ  19Apr05   0:08.32 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 36675  0.0  0.0 258184 1000  ??  SsJ  19Apr05   7:29.85 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 36569  0.0  0.0 14552  596  ??  SsJ  19Apr05   0:12.27 
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 35961  0.0  0.0 16624  580  ??  SsJ  19Apr05  12:26.68 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
scrappy 54328  0.0  0.0 258248 1596  ??  SJ1:55PM   0:00.00 
/usr/local/bin/postmaster -D /usr/local/pgsql/data -S (postgres)
and never noticed any issues ... but, this is with 4.11, not 5.x, so maybe 
something has changed?

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Bill Moran
Marc G. Fournier [EMAIL PROTECTED] wrote:

 On Tue, 26 Apr 2005, Bill Moran wrote:
 
  Alexander Rusinov [EMAIL PROTECTED] wrote:
  Hi,
 
  I need to run a number of PostgreSQL servers in different FreeBSD jails.
  I managed to run a first instance of PostgreSQL server in a jail, but
  after I launch a new server in another jail the first one starts to
  return an error messages like the following:
 
  semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
 
  The problem in general is: only one instance of PostgreSQL server
  processes clients' connections, all of the others return semctl errors.
 
  I had this exact same problem.  I never found a solution.  The cause
  appears to be that, since shared memory is not segregated between jails,
  the newly launched Postgres instances corrupt the shared memory of
  previously running Postgres instances.
 
 I'm running 9 jails on a server right now, each with their own instance:

snip

 and never noticed any issues ... but, this is with 4.11, not 5.x, so maybe 
 something has changed?

I was running 5.2 when I had the problems.  So it's possible that this
guess is correct.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: PostgreSQL in FreeBSD jails

2005-04-26 Thread Alexander Rusinov
Marc G. Fournier wrote:
On Tue, 26 Apr 2005, Bill Moran wrote:
Alexander Rusinov [EMAIL PROTECTED] wrote:
Hi,
I need to run a number of PostgreSQL servers in different FreeBSD 
jails.
I managed to run a first instance of PostgreSQL server in a jail, but
after I launch a new server in another jail the first one starts to
return an error messages like the following:

semctl(1507328, 4, SETVAL, 0) failed: Invalid argument
The problem in general is: only one instance of PostgreSQL server
processes clients' connections, all of the others return semctl errors.

I had this exact same problem.  I never found a solution.  The cause
appears to be that, since shared memory is not segregated between jails,
the newly launched Postgres instances corrupt the shared memory of
previously running Postgres instances.

I'm running 9 jails on a server right now, each with their own instance:

and never noticed any issues ... but, this is with 4.11, not 5.x, so 
maybe something has changed?

Can you tell please what version of PostgreSQL are you running?
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to [EMAIL PROTECTED]