pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
initdb fails
9+ messages / 6 participants
[nested] [flat]

* initdb fails
@ 2004-09-15 20:09 Tom Burns <tramseyburns@yahoo.com>
  2004-09-16 04:22 ` Re: initdb fails Frans <fransgunawan@gmail.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Tom Burns @ 2004-09-15 20:09 UTC (permalink / raw)
  To: pgsql-admin


Hi All,

Just installed PostgreSQL 7.4.5 with Cigwin and get the output copied below when running initdb.

Thanks in advance for any help.

Tom

$ initdb -d
Running in debug mode.

initdb: internal variables:
  PGDATA=/usr/share/postgresql/data
  datadir=/usr/share/postgresql
  PGPATH=/usr/bin
  ENCODING=
  ENCODINGID=0
  POSTGRES_SUPERUSERNAME=Tom Burns
  POSTGRES_BKI=/usr/share/postgresql/postgres.bki
  POSTGRES_DESCR=/usr/share/postgresql/postgres.description
  POSTGRESQL_CONF_SAMPLE=/usr/share/postgresql/postgresql.conf.sample
  PG_HBA_SAMPLE=/usr/share/postgresql/pg_hba.conf.sample
  PG_IDENT_SAMPLE=/usr/share/postgresql/pg_ident.conf.sample
The files belonging to this database system will be owned by user "Tom Burns".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /usr/share/postgresql/data... ok
creating directory /usr/share/postgresql/data/base... ok
creating directory /usr/share/postgresql/data/global... ok
creating directory /usr/share/postgresql/data/pg_xlog... ok
creating directory /usr/share/postgresql/data/pg_clog... ok
selecting default max_connections... Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
10
selecting default shared_buffers... Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
Signal 12
50
creating configuration files... ok
creating template1 database in /usr/share/postgresql/data/base/1... DEBUG:  invoking IpcMemoryCreate(size=1081344)
Signal 12

initdb: failed
initdb: removing data directory "/usr/share/postgresql/data"

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2004-09-15 20:09 initdb fails Tom Burns <tramseyburns@yahoo.com>
@ 2004-09-16 04:22 ` Frans <fransgunawan@gmail.com>
  2004-09-16 12:09   ` Re: initdb fails Tom Burns <tramseyburns@yahoo.com>
  0 siblings, 1 reply; 9+ messages in thread

From: Frans @ 2004-09-16 04:22 UTC (permalink / raw)
  To: Tom Burns <tramseyburns@yahoo.com>; +Cc: pgsql-admin

Hi Tom,

Have You start Ipc-daemon before initdb ?


-- 
Best Regards,

Frans



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2004-09-15 20:09 initdb fails Tom Burns <tramseyburns@yahoo.com>
  2004-09-16 04:22 ` Re: initdb fails Frans <fransgunawan@gmail.com>
@ 2004-09-16 12:09   ` Tom Burns <tramseyburns@yahoo.com>
  0 siblings, 0 replies; 9+ messages in thread

From: Tom Burns @ 2004-09-16 12:09 UTC (permalink / raw)
  To: Frans <fransgunawan@gmail.com>; +Cc: pgsql-admin

Yes. Cygwin IPC Daemon 2 is running as an NT service.

Frans <fransgunawan@gmail.com> wrote:Hi Tom,

Have You start Ipc-daemon before initdb ?


-- 
Best Regards,

Frans

^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* initdb fails
@ 2005-12-07 06:10 Anne M. Hammond <hammond@solarz.Colorado.EDU>
  2005-12-07 09:19 ` Re: initdb fails Pandurangan R S <pandurangan.r.s@gmail.com>
  2005-12-07 14:35 ` Re: initdb fails Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 9+ messages in thread

From: Anne M. Hammond @ 2005-12-07 06:10 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Anne M. Hammond <hammond@solarz.Colorado.EDU>

This is running on a Solaris 8 machine.

I installed V 7.4.7 to use with OpenACS.

lcd[34]% /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
...
selecting default max_connections... 10
selecting default shared_buffers... 50
creating configuration files... ok
creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=1, size=1081344, 03600).
...

lcd[36]% sysdef -i | grep SHMMAX
   1048576 max shared memory segment size (SHMMAX)

-----------
So the shared memory request is greater than the SHMMAX in
the kernel.  If I just wanted to use a smaller number of shared_buffers
(24), I tried editing /usr/local/pgsql/data/pgsql.conf.

But initdb -D /usr/local/pgsql/data
finds that the directory is not empty and will not create the databases.
I have also tried
setenv PGOPTIONS="shared_buffers = 24"
and tried initdb, but initdb uses the default number.

Could you tell me how to set shared_buffers from the default so
that a smaller shared memory segment will be requested?

If you could also tell me how to set the max_connections to a value
different from the default, that would be great.

Any advice appreciated.

Anne Hammond, University of Colorado at Boulder





^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2005-12-07 06:10 initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
@ 2005-12-07 09:19 ` Pandurangan R S <pandurangan.r.s@gmail.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Pandurangan R S @ 2005-12-07 09:19 UTC (permalink / raw)
  To: Anne M. Hammond <hammond@solarz.colorado.edu>; +Cc: pgsql-admin

Hi,

The following link will help you

http://www.powerpostgresql.com/Downloads/annotated_conf_80.html

On 12/7/05, Anne M. Hammond <hammond@solarz.colorado.edu> wrote:
> This is running on a Solaris 8 machine.
>
> I installed V 7.4.7 to use with OpenACS.
>
> lcd[34]% /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
> ...
> selecting default max_connections... 10
> selecting default shared_buffers... 50
> creating configuration files... ok
> creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
> could not create shared memory segment: Invalid argument
> DETAIL:  Failed system call was shmget(key=1, size=1081344, 03600).
> ...
>
> lcd[36]% sysdef -i | grep SHMMAX
>    1048576 max shared memory segment size (SHMMAX)
>
> -----------
> So the shared memory request is greater than the SHMMAX in
> the kernel.  If I just wanted to use a smaller number of shared_buffers
> (24), I tried editing /usr/local/pgsql/data/pgsql.conf.
>
> But initdb -D /usr/local/pgsql/data
> finds that the directory is not empty and will not create the databases.
> I have also tried
> setenv PGOPTIONS="shared_buffers = 24"
> and tried initdb, but initdb uses the default number.
>
> Could you tell me how to set shared_buffers from the default so
> that a smaller shared memory segment will be requested?
>
> If you could also tell me how to set the max_connections to a value
> different from the default, that would be great.
>
> Any advice appreciated.
>
> Anne Hammond, University of Colorado at Boulder
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>


--
Regards
Pandu



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2005-12-07 06:10 initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
@ 2005-12-07 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 9+ messages in thread

From: Tom Lane @ 2005-12-07 14:35 UTC (permalink / raw)
  To: Anne M. Hammond <hammond@lcd.Colorado.EDU>; +Cc: pgsql-admin

"Anne M. Hammond" <hammond@lcd.Colorado.EDU> writes:
> So the shared memory request is greater than the SHMMAX in
> the kernel.  If I just wanted to use a smaller number of shared_buffers
> (24), I tried editing /usr/local/pgsql/data/pgsql.conf.

You're going to have to increase SHMMAX anyway, so you might as well
just do that, rather than trying to outflank initdb.  PG's performance
with any less than several hundred shared buffers is just too awful to
consider using.

I haven't done this on Solaris personally, but according to our docs
http://www.postgresql.org/docs/7.4/static/kernel-resources.html
it's just a matter of editing /etc/system and rebooting.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
@ 2005-12-07 18:04 Anne M. Hammond <hammond@solarz.Colorado.EDU>
  2005-12-07 19:27 ` Re: initdb fails Tom Lane <tgl@sss.pgh.pa.us>
  2005-12-07 20:28 ` Re: initdb fails Simon Riggs <simon@2ndquadrant.com>
  0 siblings, 2 replies; 9+ messages in thread

From: Anne M. Hammond @ 2005-12-07 18:04 UTC (permalink / raw)
  To: pgsql-admin; +Cc: pandurangan.r.s@gmail.com; tgl@sss.pgh.pa.us; hammond@solarz.Colorado.EDU

Summary:

I used a workstation where /usr/local/pgsql was mounted, and
which had a larger SHMMAX.  initdb worked there.  

Then I returned to the server, edited /usr/local/pgsql/data/pgsql.conf
for smaller sizes than the default shared_buffers and max_connections.

Thanks to Pandu and Tom Lane for the following links which describe
in detail the various configuration options:

http://www.powerpostgresql.com/Downloads/annotated_conf_80.html
http://www.postgresql.org/docs/7.4/static/kernel-resources.html

However, when the server SHMMAX is smaller than the size required
by the defaults for shared_buffers and max_connections, I have
not been able to find a way (other than the above), to tell
initdb to use a nondefault values.  If this is possible, it 
should be documented.  The conf file is in the data
directory--initdb will not init if there are existing files
in that directory.

I am doing this for a class where there initially will be only
one connection; and it's not possible to reboot the server at this
time.  So I realize my solution is a suboptimal configuration, 
but would like to get it up and working.

If there is another way to do this, such as command line options
or environmental values for initdb, I haven't found it.

Thanks for the help and suggestions.

Anne 


On 12/7/05, Anne M. Hammond <hammond@solarz.colorado.edu> wrote:
> This is running on a Solaris 8 machine.
>
> I installed V 7.4.7 to use with OpenACS.
>
> lcd[34]% /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
> ...
> selecting default max_connections... 10
> selecting default shared_buffers... 50
> creating configuration files... ok
> creating template1 database in /usr/local/pgsql/data/base/1... FATAL:
> could not create shared memory segment: Invalid argument
> DETAIL:  Failed system call was shmget(key=1, size=1081344, 03600).
> ...
>
> lcd[36]% sysdef -i | grep SHMMAX
>    1048576 max shared memory segment size (SHMMAX)
>
> -----------
> So the shared memory request is greater than the SHMMAX in
> the kernel.  If I just wanted to use a smaller number of shared_buffers
> (24), I tried editing /usr/local/pgsql/data/pgsql.conf.
>
> But initdb -D /usr/local/pgsql/data
> finds that the directory is not empty and will not create the databases.
> I have also tried
> setenv PGOPTIONS="shared_buffers = 24"
> and tried initdb, but initdb uses the default number.
>
> Could you tell me how to set shared_buffers from the default so
> that a smaller shared memory segment will be requested?
>
> If you could also tell me how to set the max_connections to a value
> different from the default, that would be great.
>
> Any advice appreciated.
>
> Anne Hammond, University of Colorado at Boulder
>




^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2005-12-07 18:04 Re: initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
@ 2005-12-07 19:27 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 9+ messages in thread

From: Tom Lane @ 2005-12-07 19:27 UTC (permalink / raw)
  To: Anne M. Hammond <hammond@lcd.Colorado.EDU>; +Cc: pgsql-admin; pandurangan.r.s@gmail.com

"Anne M. Hammond" <hammond@lcd.Colorado.EDU> writes:
> However, when the server SHMMAX is smaller than the size required
> by the defaults for shared_buffers and max_connections, I have
> not been able to find a way (other than the above), to tell
> initdb to use a nondefault values.

Well, initdb is just a shell script in 7.4, so it's not that hard
to edit it to try even-smaller values for max_connections and/or
shared_buffers.  I stand by my comment that performance is going to
suck though, and you may even run into "out of buffers" failures.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 9+ messages in thread

* Re: initdb fails
  2005-12-07 18:04 Re: initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
@ 2005-12-07 20:28 ` Simon Riggs <simon@2ndquadrant.com>
  1 sibling, 0 replies; 9+ messages in thread

From: Simon Riggs @ 2005-12-07 20:28 UTC (permalink / raw)
  To: Anne M. Hammond <hammond@solarz.Colorado.EDU>; +Cc: pgsql-admin; pandurangan.r.s@gmail.com; tgl@sss.pgh.pa.us

On Wed, 2005-12-07 at 11:04 -0700, Anne M. Hammond wrote:

> If there is another way to do this, such as command line options
> or environmental values for initdb, I haven't found it.

There's no need to run initdb on the smaller machine.

Run the initdb on the larger machine, then *while postmaster is
shutdown* copy the entire data directory across to the smaller machine.
From there you can edit the postgresql.conf and startup.

Best Regards, Simon Riggs




^ permalink  raw  reply  [nested|flat] 9+ messages in thread


end of thread, other threads:[~2005-12-07 20:28 UTC | newest]

Thread overview: 9+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-09-15 20:09 initdb fails Tom Burns <tramseyburns@yahoo.com>
2004-09-16 04:22 ` Frans <fransgunawan@gmail.com>
2004-09-16 12:09   ` Tom Burns <tramseyburns@yahoo.com>
2005-12-07 06:10 initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
2005-12-07 09:19 ` Pandurangan R S <pandurangan.r.s@gmail.com>
2005-12-07 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-12-07 18:04 Re: initdb fails Anne M. Hammond <hammond@solarz.Colorado.EDU>
2005-12-07 19:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-12-07 20:28 ` Simon Riggs <simon@2ndquadrant.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox